Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
tracekit audit (#490, #491) replays the tool calls in Claude Code transcripts through the policy engine. Codex users can't use it yet: Codex writes its sessions as rollout files, ~/.codex/sessions/YYYY/MM/DD/rollout-*.jsonl, in a different shape.
What's needed
tracekit audit should read Codex rollouts too, deciding each call the way Tracekit's Codex hook would have decided it live.
Where it goes
- The mapping already exists.
tracekit/integrations/harness_hooks.py_use(item)takes thepayloadof a{"type": "response_item", "payload": {...}}line (_responses()unwraps it) and returns the call's name and arguments as the Codex PreToolUse payload has them, passed throughagent_hooks.tool("codex", ...). It returnsNonefor a call that fires no hook. It coversexec_command(asBash),apply_patchand MCP calls. It returns a dict for the model record (id, name, digest), not the arguments. - Split the mapping out. Move the part that builds
(hook, ti)from a call item and callsagent_hooks.tool("codex", hook, ti)into a small function that takes the payload item and returns(tool, args), orNonefor a call that fires no hook or has nocall_id(as_usedoes today)._use()andtracekit/audit.pyboth call it, so there is one mapping, not two. - Detect the format per line in
audit()(tracekit/audit.py, the loop overtranscript_entries, which today skips any entry whosetypeisn't"assistant"). A"response_item"line is Codex; an"assistant"line is Claude Code. A file then needs no flag. - Root.
default_root()stays the Claude Code folder. A user passes~/.codex/sessionsas ROOT. Optionally add a--codexshortcut for that folder. - Session. A rollout file is one session;
_session_from_pathalready names a session from the file. - Time. Use the line's
timestamp(_entry_timereads an entry's time today).
Acceptance
- Tests in
tests/test_audit.py, with a small rollout fixture written in the test as_calldoes for Claude Code lines:exec_commanddecided asBash;- an
apply_patch; - an MCP call;
- a call that fires no hook, which isn't counted;
- a malformed line, which is counted.
- One test checks a rollout call and the same call through
agent_hooks.toolget the same decision. tests/test_harness_hooks_v2.pypasses unchanged.docs/audit.mdsays where Codex keeps its sessions and shows the command.docs/limits.md(Audit section) has a row that says audit reads only Claude Code's transcripts and nothing from Codex or Gemini CLI: rewrite it for Codex, and note that a rollout's arguments are Codex's rewrite of what the model sent, asharness_hooksnotes.- Run
tracekit audit ~/.codex/sessions --since 7don a real Codex install and paste the summary line (not the calls) in the PR.
Read-only like the rest of tracekit audit: no signer, no writes, no network. Comment here to claim it. Commits need a DCO sign-off (git commit -s).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Activity
kausthubhk commentedon Nov 9, 2026
@LoopGlitch26 can i pick this?
LoopGlitch26 commentedon Nov 9, 2026
Yes, it's yours, @kausthubhk. Codex writes its rollouts as JSONL under ~/.codex/sessions; please follow how audit reads Claude Code sessions, and include a test built from a real rollout's record shapes.