You connect Codex to a mount with stash attach. The next session in that folder starts
with the mount: the steering, a digest of what it holds, and the stash tools.
Before you start
Section titled “Before you start”- A ready mount, and a running daemon.
attachnever starts one. See the Quickstart. codexin theharnesseslist of the mount config:
harnesses = ["codex"]Attach
Section titled “Attach”cd ~/src/checkout-servicestash attach opscodexattach writes these files in the folder:
| File | What Stash adds |
|---|---|
.codex/hooks.json | The hooks |
AGENTS.md | The steering block |
.codex/config.toml | The stash MCP server |
A global attach writes ~/.codex/hooks.json, ~/.codex/AGENTS.md, and
~/.codex/config.toml.
Trust the project and the hooks
Section titled “Trust the project and the hooks”- Codex runs a new hook only after you trust it in
/hooks. - Codex reads the project’s
.codex/config.tomlonly in a project that it trusts. - Codex asks before each
stash note save.
In a project that Codex doesn’t trust, the agent has no stash tools, but the steering
names them. Trust the project, or attach in CLI mode with stash attach ops --no-mcp.
Avoid duplicate tools
Section titled “Avoid duplicate tools”When Codex also runs one of the mount’s MCP servers itself, the agent sees each tool
twice. attach names each such server. Set enabled = false on the Codex copy.
Check it
Section titled “Check it”stash status opsThe Workspaces section lists the folder with [codex]. A mount gets turns only from
the time of the attach.
Next steps
Section titled “Next steps”- Attachment modes: MCP mode or CLI mode, and what the steering and the hooks do.
- Troubleshoot: when the agent has no
stashtools.