Repository navigation
Description
tracekit audit replays an agent's past tool calls through the policy and reports what it would have held or denied, read-only. It reads Claude Code's sessions today; #669 adds Codex's and #714 adds a table of readers, one entry per agent. Cursor writes an agent transcript for each chat, so its users could audit last week the same way.
Where Cursor keeps them
~/.cursor/projects/<encoded working dir>/agent-transcripts/<id>/<id>.jsonl, for both the IDE's agent and thecursor-agentCLI. Older builds wrote a flat<id>.jsonl. A subagent's file is in<id>/subagents/(CLI changelog, v2026.10.17). Cursor's hooks are given this file astranscript_path(hooks docs, CLI changelog).- Cursor is closed source, so this comes from its docs and forum posts (staff post, a user's sample). Please confirm it against a real file and describe one line's shape (no content) in the PR.
How a tool call looks
{"role": "assistant", "message": {"content": [{"type": "tool_use", "name": "Shell", "input": {"command": "ls", "description": "…"}}]}}This is close to Claude Code's shape, but a line has no id, no timestamp and no tool result; the staff post says Cursor leaves outputs out on purpose. So:
- Names:
agent_hooks.tool("cursor", name, input)maps them as the live hook does (CURSOR_TOOLS,tracekit/agent_hooks.pyL101). - Time: with no time per call,
--sincegoes by the file's modification time. A file last written before the window is skipped, and one written in it counts whole. Say so in the limits row. - Copies: with no ids, a call can't be told from a copy of it, so each line counts.
Out of scope: the IDE's chat database (state.vscdb), whose layout is known only from reverse engineering.
Acceptance
- A reader with tracekit audit: any agent's calls from one plain file, and each known agent's sessions read without a folder #714's signature, and its table entry with Cursor's default folder.
- Tests in
tests/test_audit.py, with lines written in the test:Shelldecided asBash;- a subagent's file, counted under its session;
- an older flat
<id>.jsonl; - a file older than
--since, skipped; - a malformed line, counted.
docs/audit.mdsays where Cursor keeps its transcripts, and the Audit row ofdocs/limits.mdnames Cursor and the time rule.- Run it on a real Cursor install and paste the summary line (not the calls) in the PR.
This builds on #714. The reader and its tests can come first; its table entry is one line once #714 is in. 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).
Activity
Purv-Kabaria commentedon Nov 11, 2026
I'd like to claim this one. I'll write the reader with #714's signature and the tests listed in the acceptance section first, then the one-line table entry once #714 is in. I'll also update
docs/audit.mdanddocs/limits.md, and run it against a real Cursor install for the summary line in the PR. Commits will be signed off.LoopGlitch26 commentedon Nov 11, 2026
It's yours, @Purv-Kabaria. #714 is being built in #730 now: a reader yields
(time, session, tool, args)per call andNonefor a line it can't read, so you can write against that signature today.LoopGlitch26 commentedon Nov 12, 2026
#714 is in (#730): add your reader as an entry in
READERSintracekit/audit.py, with the signature it has there.tracekit audit: a reader for Cursor's agent transcripts (#755)