[
    {
        "role": "user",
        "content": "what%20is%20openclaw%20setting%20to%20change%20workspace%20directory%3F"
    },
    {
        "role": "assistant",
        "content": "If you\u2019re using **OpenClaw** and want to change the workspace directory (where agents read/write their memory, identity files, etc.), here\u2019s how you can do it \u2014 plus related configuration tips and what the workspace does.\n\n---\n\n### What is the Workspace in OpenClaw\n\n- It\u2019s the folder where agents store their operating files: things like `AGENTS.md`, `SOUL.md`, `MEMORY.md`, daily memory files, custom skills, and other files used during sessions. ([openclaw.cc](https://openclaw.cc/en/concepts/agent-workspace?utm_source=openai))  \n- It\u2019s also where tools resolve relative paths. Unless sandboxing is enabled, absolute paths may access elsewhere. ([open-claw.bot](https://open-claw.bot/docs/concepts/agent-workspace/?utm_source=openai))  \n- By default, the workspace location is `~/.openclaw/workspace` (or `~/.openclaw/workspace-<profile>` if using profiles). ([openclaw.cc](https://openclaw.cc/en/concepts/agent-workspace?utm_source=openai))\n\n---\n\n### How to Change the Workspace Directory\n\nYou can change it using one of these methods:\n\n1. **Via the CLI setup command**\n\n   When you first run setup, or when reinitializing, use:\n\n   ```\n   openclaw setup --workspace <your-desired-path>\n   ```\n\n   This sets the workspace path in the config under `agents.defaults.workspace`. ([docs.openclaw.ai](https://docs.openclaw.ai/cli/setup?utm_source=openai))\n\n2. **By editing the configuration file directly**\n\n   In the file `~/.openclaw/openclaw.json` (which is JSON5-formatted), set:\n\n   ```json5\n   {\n     \"agents\": {\n       \"defaults\": {\n         \"workspace\": \"/full/path/to/your/workspace\"\n       }\n     }\n   }\n   ```\n\n   This overrides the default location. ([docs.openclaw.ai](https://docs.openclaw.ai/gateway/configuration?utm_source=openai))\n\n3. **Use `openclaw config` commands**\n\n   With the CLI, you can do:\n\n   ```\n   openclaw config set agents.defaults.workspace /full/path/to/workspace\n   ```\n\n   To check what it\u2019s currently set to, run:\n\n   ```\n   openclaw config get agents.defaults.workspace\n   ```\n\n   ([docs.openclaw.ai](https://docs.openclaw.ai/gateway/configuration?utm_source=openai))\n\n4. **Environment variable (optional/alternative)**\n\n   Some users recommend using `OPENCLAW_HOME` to set a base directory, which then changes where `.openclaw` and workspace are located. This is less documented in official docs but is used in practice. Be cautious; verify this works in your version. ([linkedin.com](https://www.linkedin.com/pulse/setting-up-openclaw-practical-guide-from-zero-your-first-ajeet-singh-rqxoc?utm_source=openai))\n\n---\n\n### Things to Check After Changing Workspace\n\n- **Permissions:** Make sure OpenClaw has read/write access to the new workspace path. If not, file operations (memory writes, skill installs, etc.) will fail. ([open-claw.bot](https://open-claw.bot/docs/concepts/agent-workspace/?utm_source=openai))  \n- **Sandboxing settings:** If sandboxing is enabled (`agents.defaults.sandbox`) or specific workspace access restrictions, these might restrict what agents can do even inside the workspace. ([open-claw.bot](https://open-claw.bot/docs/concepts/agent-workspace/?utm_source=openai))  \n- **Profile vs Default:** If you\u2019re using named profiles (non-default), your workspace may be `~/.openclaw/workspace-<profile>`. Be sure you know which profile you\u2019re using. ([open-claw.bot](https://open-claw.bot/docs/concepts/agent-workspace/?utm_source=openai))  \n- **Bootstrapping files:** When you set up a new workspace, OpenClaw creates certain default files if they\u2019re missing (`AGENTS.md`, `SOUL.md`, etc.). If you move a workspace or repoint to a directory, you may need to run `openclaw setup` to seed missing ones. ([open-claw.bot](https://open-claw.bot/docs/concepts/agent-workspace/?utm_source=openai))  \n\n---\n\nIf you tell me your OS (macOS, Linux, Windows) and how you installed OpenClaw, I can give you exact steps for your setup."
    }
]