Tracing agents
Attach thirdeye to Claude Code, Cursor, Codex, Gemini, and Copilot.
thirdeye add --<platform> registers a hook with each supported agent so every subsequent session is captured into your local trace store. Hooks are platform-specific — usually a config entry that runs a thirdeye shim wrapping the agent's session lifecycle — but the surface area is identical from your perspective: run the add command, then use your agent normally.
All captured data lives under <thirdeye_home>/traces/<platform>/<sid>/, where <thirdeye_home> defaults to ~/.thirdeye (override with THIRDEYE_HOME).
| File | Purpose |
|---|---|
events.alog | Append-only event log (msgpack frames). Never mutated. |
events.idx | Index of frame offsets for fast seq lookup. |
tags.jsonl | Sidecar with tag add/remove operations (append-only, replayable). |
meta.yaml | Session metadata (platform, cwd, timestamps, status). |
usage.jsonl | Per-turn token usage sidecar (see Token usage). |
evals.jsonl | Eval results, if any (see Evaluations). |
Claude Code
thirdeye add --claudeRegisters a session lifecycle hook with the claude CLI so each session emits events into <thirdeye_home>/traces/claude/<sid>/. Includes the use-thirdeye and use-thirdeye-evals skills if you've installed them.
Verify:
claude # run any prompt, exit
thirdeye list --platform claudeYou should see a new session at the top.
Cursor
thirdeye add --cursorWires the Cursor agent CLI through thirdeye. Cursor sessions land under <thirdeye_home>/traces/cursor/<sid>/.
Verify with thirdeye list --platform cursor after running an agent session in Cursor.
Codex
thirdeye add --codexHooks the OpenAI Codex CLI (codex). Codex's read-only sandbox is preserved — thirdeye only observes events, it doesn't relax the sandbox.
Verify with thirdeye list --platform codex.
Gemini
thirdeye add --geminiHooks the Gemini CLI (gemini). Gemini's approval modes (plan / default / yolo) pass through unchanged.
Verify with thirdeye list --platform gemini.
Copilot
thirdeye add --copilotHooks the GitHub Copilot CLI (copilot).
Verify with thirdeye list --platform copilot.
Detaching
thirdeye remove --<platform> reverses the hook for that platform. Captured session data is left in place — you can re-enable later and your history is intact. To wipe captured data, delete ~/.thirdeye/traces/ (or the directory pointed to by THIRDEYE_HOME).
Troubleshooting
- No sessions appear after
add.addtakes effect on the next agent run. Start a new session and checkthirdeye listagain. - Duplicate hook entries. Shouldn't happen —
addis idempotent. If it does, runthirdeye remove --<platform>thenthirdeye add --<platform>to reset. - Usage rows missing. See Token usage; the usage sidecar is written by a separate path that may need
thirdeye usage reindex.