#Cloning new github project with openclaw setup

1 messages · Page 1 of 1 (latest)

solar pine
#

Hi @honest crown
I have a Windows 11 machine with wsl2 layer and docker installed. I have cloned openclaw into the docker container and it is accessible from the ubuntu workspace. Can I clone a new github project into this location which already has openclaw workspace artifacts? Help me set this up.

haughty thicketBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

wooden marshBOT
honest crownBOT
# solar pine Hi <@1457407575476801641> I have a Windows 11 machine with wsl2 layer and docke...

NinaChan: yes, you can clone another GitHub project somewhere under the OpenClaw workspace, but I’d avoid mixing it directly into the same directory as the OpenClaw workspace files like AGENTS.md, SOUL.md, MEMORY.md, etc.

First, please check your version since setup details can differ:

openclaw --version

Recommended layout:

~/.openclaw/workspace/        # OpenClaw agent workspace / memory / instructions
~/.openclaw/workspace/projects/my-app/   # your new cloned project
# or cleaner:
~/projects/my-app/            # your project repo
honest crownBOT
# solar pine Hi <@1457407575476801641> I have a Windows 11 machine with wsl2 layer and docke...

If you want the project inside the OpenClaw workspace:

mkdir -p ~/.openclaw/workspace/projects
cd ~/.openclaw/workspace/projects
git clone <your-github-repo-url> my-app
cd my-app

If you want OpenClaw’s active working directory to be that project, set the workspace explicitly:

openclaw setup --workspace ~/projects/my-app

That will make OpenClaw seed/use workspace files there. Only do this if you’re okay with OpenClaw files living in that repo. Usually I prefer keeping OpenClaw’s memory workspace separate and putting code repos under a projects/ folder.

honest crownBOT
# solar pine Hi <@1457407575476801641> I have a Windows 11 machine with wsl2 layer and docke...

Important bits:

  • Don’t clone your new project inside the OpenClaw source checkout unless you’re actually modifying OpenClaw itself.
  • Don’t commit ~/.openclaw/openclaw.json, credentials, sessions, tokens, or auth files.
  • If Docker/WSL is involved, run the clone from the same Ubuntu/container environment where the Gateway/tools will operate, so paths match what the agent can see.
  • If the workspace is already a git repo, cloning another repo directly at the root will make nested git weird. Use a subfolder.

Docs:
https://docs.openclaw.ai/concepts/agent-workspace
https://docs.openclaw.ai/cli/setup
https://docs.openclaw.ai/gateway/sandboxing

Send the output of openclaw --version and the path you currently cloned OpenClaw into, and I can give you the exact commands for your layout.

solar pine
#

version output: OpenClaw 2026.5.12
path openclaw is cloned into: /home/metallicmay/.openclaw

honest crownBOT
# solar pine version output: OpenClaw 2026.5.12 path openclaw is cloned into: /home/metallicm...

NinaChan thanks, that helps.

With OpenClaw 2026.5.12 and /home/metallicmay/.openclaw, I’d keep your new project in a subfolder, not at the root of .openclaw.

Use this:

mkdir -p /home/metallicmay/.openclaw/workspace/projects
cd /home/metallicmay/.openclaw/workspace/projects
git clone <your-github-repo-url> my-project
cd my-project

Then ask OpenClaw to work on that project by giving the full path in your prompt, for example:

honest crownBOT
# solar pine version output: OpenClaw 2026.5.12 path openclaw is cloned into: /home/metallicm...
Work in /home/metallicmay/.openclaw/workspace/projects/my-project and inspect the repo.

I would not clone the new repo directly into:

/home/metallicmay/.openclaw

That directory also contains OpenClaw state/config/workspace data, and mixing a project repo into the root can get confusing quickly.

One important check: if you literally cloned the OpenClaw source repo into /home/metallicmay/.openclaw, that’s not the usual layout. Normally .openclaw is state/config, while source checkouts go somewhere like:

~/projects/openclaw
honest crownBOT
honest crownBOT
solar pine
#

yes you're right the project is cloned into: /home/metallicmay/openclaw

but workspace is in .openclaw

where do i clone the new project?

honest crownBOT
honest crownBOT
# solar pine yes you're right the project is cloned into: /home/metallicmay/openclaw but wor...
/home/metallicmay/openclaw              # OpenClaw source repo
/home/metallicmay/.openclaw            # OpenClaw config/state/workspace
/home/metallicmay/projects/my-project  # your new app/repo

If your OpenClaw tools are sandboxed and can only see the workspace, use this instead:

mkdir -p /home/metallicmay/.openclaw/workspace/projects
cd /home/metallicmay/.openclaw/workspace/projects
git clone <your-github-repo-url> my-project

My recommendation: start with /home/metallicmay/projects/my-project. If OpenClaw says it cannot access that path, move/clone it under .openclaw/workspace/projects/ or adjust sandbox/workspace access later.

solar pine
#

ok if i set up the project outside of openclaw in a separate directory, how do i configure openclaw to use that path? give me a sample configuration

honest crownBOT
# solar pine ok if i set up the project outside of openclaw in a separate directory, how do i...

Use agents.defaults.workspace if you want OpenClaw’s default working directory to be the new project.

Example project path:

/home/metallicmay/projects/my-project

Set it with the CLI:

openclaw config set agents.defaults.workspace "/home/metallicmay/projects/my-project"
openclaw config get agents.defaults.workspace
openclaw setup --workspace /home/metallicmay/projects/my-project

Or the equivalent in ~/.openclaw/openclaw.json is:

honest crownBOT
# solar pine ok if i set up the project outside of openclaw in a separate directory, how do i...
{
  agents: {
    defaults: {
      workspace: "/home/metallicmay/projects/my-project",
    },
  },
}

Then restart the gateway so new sessions pick it up:

openclaw gateway restart

Important tradeoff: OpenClaw workspace files like AGENTS.md, SOUL.md, TOOLS.md, HEARTBEAT.md, and possibly memory files will now live in that project directory. That’s fine if this repo is your agent’s main working repo, but don’t commit private OpenClaw memory/instructions to a public project by accident.

honest crownBOT
# solar pine ok if i set up the project outside of openclaw in a separate directory, how do i...

If you want to keep OpenClaw memory separate, don’t change the config. Keep:

/home/metallicmay/.openclaw/workspace   # OpenClaw memory/instructions
/home/metallicmay/projects/my-project  # your code repo

Then just tell OpenClaw: Work in /home/metallicmay/projects/my-project. That’s the cleaner setup for most people.

Docs: https://docs.openclaw.ai/concepts/agent-workspace and https://docs.openclaw.ai/gateway/configuration-reference#agentsdefaultsworkspace

solar pine
#

ok
how do i upgrade my version of openclaw first?

honest crownBOT
# solar pine ok how do i upgrade my version of openclaw first?

For your setup, use the built-in updater first. It should detect whether your install is npm/global or the source checkout.

Run this from WSL/container shell:

openclaw update --dry-run
openclaw update
openclaw doctor
openclaw health

If the gateway does not restart cleanly after the update, run:

openclaw gateway restart
openclaw health
honest crownBOT
# solar pine ok how do i upgrade my version of openclaw first?

Since you also have the source repo at /home/metallicmay/openclaw, if openclaw update says it cannot handle the install type, use the source/manual path:

cd /home/metallicmay/openclaw
git pull
pnpm install
pnpm build
openclaw gateway restart
openclaw doctor
openclaw health

Do not use clawdbot update for this; that’s a config modernization wizard, not the code/package updater.

Docs: https://docs.openclaw.ai/install/updating

If any command fails, paste the exact error plus which openclaw and openclaw --version.

solar pine
#

metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ pnpm install
Command 'pnpm' not found, did you mean:
command 'npm' from deb npm (9.2.0~ds1-2)
Try: sudo apt install <deb name>

honest crownBOT
honest crownBOT
honest crownBOT
solar pine
#

do i need to run these commands also through docker exec?

honest crownBOT
# solar pine do i need to run these commands also through docker exec?

Run the update/build commands in the same environment that actually runs OpenClaw.

If your Gateway runs inside Docker, then yes, use docker exec into that container:

docker ps
docker exec -it <container-name-or-id> bash
cd /home/metallicmay/openclaw
node --version
corepack enable
corepack prepare pnpm@latest --activate
pnpm install
pnpm build
pnpm ui:build
openclaw gateway restart
honest crownBOT
# solar pine do i need to run these commands also through docker exec?

If your Gateway runs directly in WSL Ubuntu and Docker is only installed/available, then do not use docker exec; run the commands directly in WSL, like you were doing at:

metallicmay@LAPTOP-JKEAGAT2:~/openclaw$

Quick way to tell:

openclaw health
docker ps
which openclaw

If docker ps shows an OpenClaw container that is running your gateway, use docker exec. If not, stay in WSL. The key is: update the copy at /home/metallicmay/openclaw from the place where that path and the running openclaw command both exist.

solar pine
#

$ node --version
Command 'node' not found, but can be installed with:
sudo apt install nodejs

honest crownBOT
honest crownBOT
solar pine
#

$ corepack enable
corepack prepare pnpm@latest --activate
Internal Error: EACCES: permission denied, symlink '../lib/node_modules/corepack/dist/pnpm.js' -> '/usr/bin/pnpm'
at async Object.symlink (node:internal/fs/promises:1002:10)
at async EnableCommand.generatePosixLink (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:23218:5)
at async Promise.all (index 0)
at async EnableCommand.execute (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:23199:5)
at async EnableCommand.validateAndExecute (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:20278:22)
at async _Cli.run (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:21215:18)
at async Object.runMain (/usr/lib/node_modules/corepack/dist/lib/corepack.cjs:23704:19)
Preparing pnpm@latest for immediate activation...

honest crownBOT
# solar pine $ corepack enable corepack prepare pnpm@latest --activate Internal Error: EACCES...

That’s a permissions issue: corepack enable is trying to create /usr/bin/pnpm, and /usr/bin is root-owned.

Use the user-local install path first:

mkdir -p ~/.local/bin
corepack enable --install-directory ~/.local/bin
corepack prepare pnpm@latest --activate
export PATH="$HOME/.local/bin:$PATH"
pnpm --version

Make the PATH permanent:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
honest crownBOT
honest crownBOT
solar pine
#

completed these steps successfully now

honest crownBOT
# solar pine completed these steps successfully now

Good. Next verify the upgrade actually landed and the gateway is healthy:

openclaw --version
openclaw doctor
openclaw health

If those look good, clone your actual project outside the OpenClaw source repo:

mkdir -p /home/metallicmay/projects
cd /home/metallicmay/projects
git clone <your-github-repo-url> my-project
cd my-project
git status
honest crownBOT
# solar pine completed these steps successfully now

Then either keep OpenClaw’s workspace separate and prompt it with:

Work in /home/metallicmay/projects/my-project

or make that project the default workspace:

openclaw config set agents.defaults.workspace "/home/metallicmay/projects/my-project"
openclaw setup --workspace /home/metallicmay/projects/my-project
openclaw gateway restart

I’d use the first option unless you specifically want OpenClaw’s AGENTS.md/memory files inside that project repo.

solar pine
#

I need help updating openclaw version first

honest crownBOT
# solar pine I need help updating openclaw version first

Got it. Since your OpenClaw source checkout is /home/metallicmay/openclaw, do the source update path first.

Run these exactly from WSL/container shell where you installed Node + pnpm:

cd /home/metallicmay/openclaw
git status
git pull
pnpm install
pnpm build
pnpm ui:build

Then restart and verify:

honest crownBOT
# solar pine I need help updating openclaw version first
openclaw gateway restart
openclaw --version
openclaw doctor
openclaw health

If git status shows local changes before git pull, stop and paste that output here first. Don’t reset/delete anything.

If openclaw --version still shows the old version after the build, paste:

which openclaw
openclaw --version
cd /home/metallicmay/openclaw && git rev-parse --short HEAD && git branch --show-current
honest crownBOT
solar pine
#

still seeing old version:

metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ docker exec -it openclaw-openclaw-gateway-1 which openclaw
/usr/local/bin/openclaw
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ docker exec -it openclaw-openclaw-gateway-1 openclaw --version
OpenClaw 2026.5.12
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ cd /home/metallicmay/openclaw && git rev-parse --short HEAD && git branch --show-current
eb7f3b7b50
main
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$

honest crownBOT
# solar pine still seeing old version: metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ docker exec -...

That explains it: you’re checking the OpenClaw version inside the Docker gateway container. The container is still using the old baked image, so updating/building the host checkout won’t change /usr/local/bin/openclaw until you rebuild/recreate the Docker container.

From the repo root on WSL:

cd /home/metallicmay/openclaw
git status
git pull
docker compose build openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway

Then verify inside the container:

docker exec -it openclaw-openclaw-gateway-1 openclaw --version
honest crownBOT
# solar pine still seeing old version: metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ docker exec -...
docker compose ps
docker compose logs --tail=80 openclaw-gateway

If your compose file uses the prebuilt image instead of local build, do this instead:

cd /home/metallicmay/openclaw
docker compose pull openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway

Quick rule: since your running gateway is Docker, openclaw --version on the host and openclaw --version inside the container can be different. The one that matters for the running gateway is:

honest crownBOT
solar pine
#

unexpected fault address 0xffade0
fatal error: fault
[signal SIGBUS: bus error code=0x2 addr=0xffade0 pc=0xffade0]

goroutine 1 gp=0xc000002380 m=2 mp=0xc00007c808 [running]:
panic during panic
SIGBUS: bus error
PC=0x466449 m=2 sigcode=2 addr=0x1873f18

goroutine 0 gp=0xc000002c40 m=2 mp=0xc00007c808 [idle]:
metallicmay@LAPTOP-JKEAGAT2:~/openclaw$ docker compose up -d --force-recreate openclaw-gateway
SIGBUS: bus error
PC=0x46a815 m=4 sigcode=2 addr=0x1db3f30

goroutine 0 gp=0xc0001021c0 m=4 mp=0xc000100008 [idle]:

honest crownBOT
honest crownBOT
# solar pine unexpected fault address 0xffade0 fatal error: fault [signal SIGBUS: bus error c...

Then fully restart Docker Desktop, reopen Ubuntu/WSL, and try:

cd /home/metallicmay/openclaw
docker compose ps
docker compose up -d --force-recreate openclaw-gateway
docker exec -it openclaw-openclaw-gateway-1 openclaw --version

If it still SIGBUSes, try disabling BuildKit for the compose operation:

cd /home/metallicmay/openclaw
DOCKER_BUILDKIT=0 docker compose build openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway
honest crownBOT
solar pine
#

restarted and now working -
$ free -h
total used free shared buff/cache available
Mem: 7.7Gi 1.2Gi 4.9Gi 4.7Mi 1.8Gi 6.5Gi
Swap: 2.0Gi 0B 2.0Gi

now what do i run?

honest crownBOT
# solar pine restarted and now working - $ free -h total used fr...

Great, memory looks fine now. Continue with the Docker gateway update/recreate path:

cd /home/metallicmay/openclaw
git status
git pull
docker compose build openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway

Then verify:

docker exec -it openclaw-openclaw-gateway-1 openclaw --version
docker compose ps
docker compose logs --tail=80 openclaw-gateway
honest crownBOT
solar pine
#

Getting this error:

62.97 [ERR_PNPM_JSON_PARSE] Unexpected end of JSON input while parsing empty string in /app/node_modules/@anthropic-ai/claude-agent-sdk-linux-x64/package.json

honest crownBOT
# solar pine Getting this error: 62.97 [ERR_PNPM_JSON_PARSE] Unexpected end of JSON input wh...

That looks like the earlier crashed build left a corrupt/incomplete dependency inside the Docker build cache. Don’t touch your .openclaw state or volumes; just rebuild the image cleanly.

Run from the OpenClaw repo root:

cd /home/metallicmay/openclaw
docker compose build --no-cache openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway

If the same @anthropic-ai/claude-agent-sdk-linux-x64/package.json parse error comes back, clear only Docker’s build cache and retry:

docker builder prune -f
docker compose build --no-cache openclaw-gateway
docker compose up -d --force-recreate openclaw-gateway
honest crownBOT
solar pine
#

bus error again after clearing cache and rerunning build

honest crownBOT
# solar pine bus error again after clearing cache and rerunning build

At this point I’d stop trying to build locally. The SIGBUS is coming from Docker/WSL during image build, so use the prebuilt OpenClaw image instead.

From /home/metallicmay/openclaw, run:

cd /home/metallicmay/openclaw
export OPENCLAW_IMAGE=ghcr.io/openclaw/openclaw:latest
docker compose pull openclaw-gateway openclaw-cli
docker compose up -d --force-recreate openclaw-gateway

Then verify:

docker exec -it openclaw-openclaw-gateway-1 openclaw --version
docker compose ps
honest crownBOT
# solar pine bus error again after clearing cache and rerunning build
docker compose logs --tail=80 openclaw-gateway

If that works, make the image setting persistent by editing /home/metallicmay/openclaw/.env and setting:

OPENCLAW_IMAGE=ghcr.io/openclaw/openclaw:latest

Then future updates are just:

cd /home/metallicmay/openclaw
docker compose pull
docker compose up -d --force-recreate openclaw-gateway
honest crownBOT
solar pine
#

got it finally!

w$ docker exec -it openclaw-openclaw-gateway-1 openclaw --version
OpenClaw 2026.5.20

honest crownBOT
honest crownBOT