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

-   A ready mount, and a running daemon. `attach` never starts one. See the [Quickstart](/docs/user-guide/stash/quickstart/index.md).
-   `codex` in the `harnesses` list of the mount config:

```toml
harnesses = ["codex"]
```

## Attach

```bash
cd ~/src/checkout-service
stash attach ops
codex
```

`attach` 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

-   Codex runs a new hook only after you trust it in `/hooks`.
-   Codex reads the project’s `.codex/config.toml` only 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

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

```bash
stash status ops
```

The `Workspaces` section lists the folder with `[codex]`. A mount gets turns only from the time of the attach.

## Next steps

-   [Attachment modes](/docs/user-guide/stash/guides/attachment-modes/index.md): MCP mode or CLI mode, and what the steering and the hooks do.
-   [Troubleshoot](/docs/user-guide/stash/guides/troubleshoot/index.md#the-harness): when the agent has no `stash` tools.