Skip to main content
Trace every Codex turn — model calls, tool calls, sub-agents and token usage — live, with the traceroot Codex plugin.

Install

Requires Node.js 22 or later.
Start codex and choose Trust all and continue at the “Hooks need review” prompt, or trust them later with /hooks.

Set up

Create ~/.codex/traceroot.json:
The plugin runs as a Codex hook, which doesn’t reliably inherit your shell environment, so the config file is preferred. Environment variables win over a project .codex/traceroot.json, which wins over the global file. api_key, host_url and capture_images are read only from environment variables or the global file, so a repository you open can’t redirect your traces. The plugin README lists every setting.

Usage

Use Codex as usual. Each turn becomes one trace, sent live while Codex works. Traces from the same thread share a session ID.
For codex exec and other runs without a prompt, trust has to be in place first, because untrusted hooks are skipped without any message. Run codex exec --skip-git-repo-check "echo hello" < /dev/null; the output should include hook: Stop Completed. The README shows how to carry trust to CI.

Verify

Run one prompt in Codex and confirm the trace arrives:
  1. In the traceroot UI: Navigate to Tracing > Traces in traceroot Cloud. You should see a trace with root span Codex Turn.
  2. Via the CLI: Run traceroot traces list to inspect your recent traces from the terminal.

What gets captured

Prompts, tool inputs and tool outputs are sent as they are, including commands and file contents. Nothing is redacted. Self-hosted instances store images as attachments when ATTACHMENT_ENABLED=true. See Data Capture and Privacy.

Limitations

  • If no trace arrives, check that the hooks are trusted (/hooks) and that enabled is true. Set debug to true (TRACEROOT_CODEX_DEBUG) to log to stderr.
  • Codex asks you to trust the hooks again after every plugin update. Until you do, no traces are sent.

Run the example

traceroot-codex-plugin

Source, full settings and headless setup

Next steps

Sessions

See a whole Codex thread as one timeline.

Data Capture and Privacy

Control what leaves your machine.