Skip to content

tracekit audit: read Cursor's agent transcripts #716

Closed

Description

@LoopGlitch26

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 the cursor-agent CLI. 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 as transcript_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.py L101).
  • Time: with no time per call, --since goes 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:
    • Shell decided as Bash;
    • 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.md says where Cursor keeps its transcripts, and the Audit row of docs/limits.md names 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

  1. Purv-Kabaria commented on Nov 11, 2026

    @Purv-Kabaria
    Contributor

    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.md and docs/limits.md, and run it against a real Cursor install for the summary line in the PR. Commits will be signed off.

  2. LoopGlitch26 commented on Nov 11, 2026

    @LoopGlitch26
    MemberAuthor

    It's yours, @Purv-Kabaria. #714 is being built in #730 now: a reader yields (time, session, tool, args) per call and None for a line it can't read, so you can write against that signature today.

  3. LoopGlitch26 commented on Nov 12, 2026

    @LoopGlitch26
    MemberAuthor

    #714 is in (#730): add your reader as an entry in READERS in tracekit/audit.py, with the signature it has there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions