Skip to main content

Codex Integration

partio supports OpenAI Codex CLI as a first-class agent alongside Claude Code. When you use Codex in a partio-enabled repository, sessions are captured alongside your commits — the same way they are for Claude Code.

Detection

partio detects Codex by checking for a running codex process. When the pre-commit hook fires, it:
  1. Checks if a Codex process is active on the system (pgrep -f codex)
  2. Locates the latest session file under ~/.codex/sessions/, matching the session’s working directory against the current repository root
If both conditions are met, the session is marked as active and captured on commit.

Selecting the agent

By default the agent setting is empty, and partio auto-detects whichever supported agent is currently running (Claude Code or Codex). You usually don’t need to configure anything. To pin partio to Codex explicitly — useful if you run multiple agents — set the agent field or the PARTIO_AGENT environment variable:
.partio/settings.json
{
  "agent": "codex"
}
PARTIO_AGENT=codex git commit -m "..."
See Configuration → Choosing the agent for details.

What gets captured

For each commit made while Codex is active, partio captures the same checkpoint data as any other agent:
FileContents
full.jsonlThe complete JSONL transcript of the Codex session
context.mdA summary of the session context
diff.patchThe unified diff for the commit
prompt.txtThe initial prompt that started the session
metadata.jsonSession metadata (agent, token count, duration)

Session metadata

{
  "agent": "codex",
  "total_tokens": 11840,
  "duration": "6m10.2s"
}
Plan capture (plan.md) is specific to Claude Code’s plan mode and is not produced for Codex sessions.

Attribution & trailers

Attribution and commit trailers work identically for every agent. After each checkpoint, your commit is amended with:
Your commit message here

Partio-Checkpoint: a3f8c2d14e9b
Partio-Attribution: 82% agent

Troubleshooting

Checkpoints not being created

  1. Run partio doctor to check installation health
  2. Verify Codex is running when you commit — partio only captures when it detects an active process
  3. Check log output with partio --log-level debug status (the Agent: line shows which agent partio resolved)
  4. Verify hooks are installed — look for # Installed by partio in .git/hooks/post-commit

Session file not found

Codex stores session files under ~/.codex/sessions/. If partio can’t find the session:
  • Ensure Codex has been used in the current repository at least once
  • Check that the session file hasn’t been cleaned up before the commit