Skip to content

Agent Workspace

The Agent Workspace is the directory where the agent runs, stores files, and manages its “home”. It serves as the persistent filesystem for the agent across restarts.

By default, the workspace is located at:

  • Linux/macOS: ~/.openclaw/workspace
  • Windows: %USERPROFILE%\.openclaw\workspace

You can verify the location by running:

Terminal window
openclaw config get agent.workspace

You can override the workspace location in your config.json (or via environment variables).

config.json
{
agent: {
// Custom workspace path
workspace: "/var/lib/openclaw/workspace"
}
}
  • OPENCLAW_WORKSPACE: Overrides the workspace path.

A typical workspace contains:

workspace/
├── .git/ # (Optional) Git history for backup
├── memories/ # Vector store or memory files
├── sessions/ # Session-specific data
├── skills/ # Local skills/tools
├── storage/ # General file storage for agents
└── temp/ # Temporary scratch space

Agents usually have read/write access to this directory.

  • Read: The agent can read any file in the workspace.
  • Write: The agent can create or modify files here.

The agent is sandboxed to this directory (logically). While the underlying process might have OS-level permissions, the OpenClaw runtime restricts high-level file operations to the workspace to prevent accidental modification of system files.

Since the workspace contains all your agent’s state (memories, custom skills, session logs), it is crucial to back it up.

OpenClaw has built-in support for using Git to version the workspace.

  1. Initialize a git repo in the workspace:
    Terminal window
    cd ~/.openclaw/workspace
    git init
  2. Configure a remote (e.g., private GitHub repo):
    Terminal window
    git remote add origin git@github.com:username/my-agent-workspace.git
  3. OpenClaw can be configured to auto-commit changes (feature availability depends on version).

Simply archive the directory:

Terminal window
tar -czvf openclaw-backup.tar.gz ~/.openclaw/workspace

To migrate your agent:

  1. Stop the OpenClaw service.
  2. Copy the entire workspace directory to the new machine.
  3. Install OpenClaw on the new machine.
  4. Point the config to the copied workspace.
  5. Start the service.