Exact locations and lifecycle of registry, workspace, and runtime state.
Understanding where WSM stores data is essential for debugging issues and for manual recovery when things go wrong. This page documents every persisted file, what creates and updates it, and how to safely repair state.
WSM stores all persistent configuration under your user config directory:
~/.config/workspace-manager/
├── registry.json # discovered repository catalog
└── workspaces/
├── my-feature.json # workspace definition
├── another-workspace.json
└── ...
Workspace directories (the actual worktrees and files you work in) live separately, typically under a date-stamped root:
~/workspaces/
└── 2026-02-28/
└── my-feature/
├── workspace-manager/ # git worktree
├── geppetto/ # git worktree
├── go.work # if Go workspace detected
└── AGENT.md # if agent-source was specified
registry.json)The registry is a catalog of all git repositories WSM knows about. It maps repository names to their paths, remote URLs, current branches, and tags.
Created by: wsm discover
Updated by: wsm discover (overwrites with fresh scan results)
Read by: wsm create, wsm list repos, wsm fork, JS API
When you run wsm create --repos foo,bar, WSM looks up foo and bar in
this registry to find their on-disk paths and remote URLs. If a repository is
not in the registry, the create command fails with a "repositories not found"
error.
To refresh the registry, re-run discovery:
wsm discover ~/code
workspaces/*.json)Each workspace gets its own JSON file containing:
go.work) was createdCreated by: wsm create, wsm fork
Updated by: wsm add, wsm remove
Deleted by: wsm delete
Read by: wsm status, wsm info, wsm commit, all git commands
The workspace directory contains one subdirectory per repository. Each is a git worktree (not a full clone), which means it shares the object store with the original repository. This is fast and space-efficient.
When a workspace includes Go modules that reference each other, WSM
automatically creates a go.work file at the workspace root so that local
development works without module replace directives.
If --agent-source is specified during create or fork, WSM copies the given
file as AGENT.md into the workspace root.
Here is exactly which commands write to which files:
| Command | Writes to |
|---|---|
wsm discover | registry.json |
wsm create | New workspaces/<name>.json + creates worktree directories |
wsm fork | New workspaces/<name>.json + creates worktree directories |
wsm add | Updates existing workspaces/<name>.json |
wsm remove | Updates existing workspaces/<name>.json |
wsm delete | Removes workspaces/<name>.json + optionally deletes directory |
wsm merge | May remove workspaces/<name>.json if --keep-workspace is false |
No other commands write to disk. Status, diff, log, branch list, and the JS API are all read-only operations.
It is important to distinguish what is persisted from what is computed at runtime:
Persisted (survives restarts):
registry.json)workspaces/*.json)Computed at runtime (ephemeral):
.git/rebase-merge and .git/rebase-apply)If runtime output and persisted files ever seem inconsistent, the persisted files are the source of truth for workspace membership and configuration, while the filesystem is the source of truth for actual git state.
When you run a command like wsm status without specifying a workspace name,
WSM tries to detect which workspace you are in:
~/.config/workspace-manager/workspaces/.If detection fails, you get a not in a workspace directory error. Pass the
workspace name explicitly to avoid this:
wsm status my-feature
# or
wsm status --workspace my-feature
WSM commands are the safest way to modify state. However, if you need manual repair:
wsm list workspaces and wsm info <name> to
confirm the repair looks correct.Common manual fixes:
~/.config/workspace-manager/workspaces/, or run wsm delete <name>.wsm discover on the parent directory.path field to match the actual
directory location.| Problem | Cause | Solution |
|---|---|---|
| Workspace appears in list but path is missing | Workspace JSON exists, directory was deleted manually | Run wsm delete <name> to clean up, then recreate |
| Create fails with repo lookup errors | Registry is stale or does not include the repo | Re-run wsm discover on the correct directories |
| Status detects wrong workspace | Working directory is inside multiple workspace paths | Pass explicit --workspace <name> |
go.work references wrong modules | Repos were added/removed after workspace creation | Delete go.work and re-run wsm add/wsm remove |
wsm help wsm-getting-startedwsm help wsm-troubleshootingwsm help wsm-architecture-overview