Pensieve Docs
Docs menu

Connect your agent

Pensieve for Codex

This page tells you how to connect Codex to Pensieve over MCP, and what changes on your computer.

Connect Codex

  1. Install Pensieve (see Install).
  2. Run one of these commands:
    pensieve integrate recommended   # every agent on this computer
    pensieve integrate codex-mcp codex pensieve-search   # only Codex
  3. Restart Codex. It loads its MCP servers when it starts.
  4. Ask Codex a question about your code, for example “where do we retry failed webhooks?”.

What Pensieve adds

Add-onIdFile
MCP servercodex-mcp~/.codex/config.toml
Instructions blockcodex~/.codex/AGENTS.md
Skillspensieve-search~/.agents/skills

The instructions block goes in ~/.codex/AGENTS.md, between <!-- pensieve:start --> markers.

Connect by hand

Add this entry to ~/.codex/config.toml. Use the full path of your pensieve command. To find it, run which pensieve.

# pensieve:start
[mcp_servers.pensieve]
command = "/Users/you/.local/bin/pensieve"
args = ["mcp"]
# pensieve:end

Pensieve writes its entry between the lines # pensieve:start and # pensieve:end. When you remove it, the rest of config.toml stays the same. If config.toml already has a server named pensieve that Pensieve did not add, Pensieve does not change it.

Pensieve indexes your Codex sessions from ~/.codex/sessions. Thus search with kind:session also finds earlier Codex work.

Remove

pensieve integrate codex-mcp codex --remove

Pensieve removes only the entries that it added.

See also: scopes, the MCP tools, and the benchmark.

Something wrong or missing? Tell us on GitHub.