Workspaces

A workspace is the execution root for an agent — where it reads files, runs commands, and applies patches. Every agent always has exactly one active workspace.

What a Workspace Defines

ConcernSet by workspace
Instruction rootWhere AGENTS.md and policy files resolve
Execution rootDefault working directory for commands
ApplyPatch targetWhere file mutations land
Memory scopeWorkspace-scoped episode records and indexes

Workspace vs Shell Directory

A workspace is not a shell cd. Shell cd changes the directory for that one command process. Agents use explicit binding and activation tools to change where runtime tools operate.

ActionEffect
cd /other in shellOnly affects that command
AttachWorkspaceAdds a workspace binding without switching
SwitchWorkspaceChanges active workspace for subsequent operations
holon workspace attach /pathAttaches and activates through the CLI compatibility flow

Workspace Commands

Attach

Attach to a project directory as the active workspace:

holon workspace attach /path/to/project
holon workspace attach --agent my-agent /path/to/project

This discovers or creates a workspace record for the directory and makes it active for the agent. The workspace persists across sessions.

Exit

Return to the agent's home workspace:

holon workspace exit
holon workspace exit --agent my-agent

Detach

Remove a workspace record entirely:

holon workspace detach <workspace-id>

Detaching does not delete the directory — it removes the workspace record from Holon's index. Memory and episode records associated with the workspace are preserved.

Worktree Isolation

CreateWorktree creates a managed linked worktree from an explicit attached workspace, branch, and base ref:

CreateWorktree {
  workspace_id: "ws_...",
  branch: "feature/example",
  base_ref: "origin/main"
}

Isolated workspaces are useful for:

Agent Home vs Project Workspace

Workspace TypePurposeExample
Agent homeAgent-local state and memory~/.holon/agents/my-agent/
Project workspaceCode and files being worked on/path/to/project

Every agent starts with its agent home as the active workspace. Use workspace attach to switch to a project workspace, and workspace exit to return to agent home.

Agent Workspace Tools

UseWorkspace remains a hidden compatibility alias for historical calls.

See Also