Skip to main content

agent-trace

PyPI Python CI GitHub Marketplace Open VSX VS Marketplace License PyPI Downloads

Before you merge an agent's pull request, see what its session did and did not prove.

Used by Meta, ByteDance, Zama.ai & more

Meta   ByteDance   Zama

agent-strace records a coding agent's session as local files, then reads that recording for the pull request.

How it works: one recording, read three ways. Hooks save the agent's session as local files in .agent-traces/, with secrets redacted. Each command reads that recording, with no LLM: review posts findings on the pull request, share writes one HTML file that needs no server, and cognitive-debt shows what merged without review, keeping reviewed, not reviewed, and unknown lines apart.

  • review posts findings on the pull request.
  • share writes a privacy-minimized evidence packet for the reviewer.
  • cognitive-debt shows how much agent-written code merged without review.

agent-strace is not the Agent Trace spec from Cursor and Cognition, but review and cognitive-debt read its records and git-ai notes.

Entire records agent sessions and can review them with LLM agents. agent-strace grades what a session proved, with no model, and can read Entire checkpoints.

Quick start

uv tool install agent-strace
agent-strace setup --cli copilot   # or claude, codex, gemini, cursor

Restart the agent and do one task on a branch. Then:

agent-strace replay   # the latest session, in order
agent-strace health   # what the capture recorded and what it missed
agent-strace review   # findings for this branch

For Claude Code, setup prints the hooks to merge into ~/.claude/settings.json. A plugin installs the hooks instead: use one or the other, not both.

Or let your coding agent install it

Paste this into Claude Code, Copilot CLI, Codex, Gemini CLI, or Cursor; it lists the commands before running them:

Set up agent-strace (https://github.com/Siddhant-K-code/agent-trace) to record this coding agent's sessions as local traces. First, say which agent you are and list the commands you'll run. Never use sudo or hand-edit config files; if a step fails, stop and show me the error. 1. Install or upgrade the CLI: `uv tool install --upgrade agent-strace` (no uv: use pipx). If `agent-strace --version` fails, run `uv tool update-shell` (or `pipx ensurepath`), since the hooks call it from PATH. 2. Connect only this agent's capture path: Claude Code: `claude plugin marketplace add Siddhant-K-code/agent-trace`, then `claude plugin install agent-strace@agent-trace`. Copilot CLI: `copilot plugin marketplace add Siddhant-K-code/agent-trace`, then `copilot plugin install agent-strace@agent-trace`. Codex: `codex plugin marketplace add Siddhant-K-code/agent-trace`, then `codex plugin add agent-strace@agent-trace`. Gemini CLI: `agent-strace setup --cli gemini`. Cursor: `agent-strace setup --cli cursor`. Other agents: stop and point me to the agent-trace docs/setup.md guide. 3. Tell me to restart this agent from a new terminal (in Codex, trust the agent-strace hooks in /hooks), do one task, then run `agent-strace replay` and `agent-strace health`. Traces stay local in .agent-traces/; `agent-strace telemetry disable` turns off anonymous telemetry.
See it on a real session Terminal output of agent-strace replay, health and review on a real GitHub Copilot CLI session that fixes a small bug: replay lists the prompt, tool calls and results; health reports the evidence status and the provider's capture gaps; review reports rationale, scope, validation, stewardship and evidence health for the branch.

On the pull request

Five findings, posted on the pull request: the comment on the demo pull request, trimmed. A GitHub Copilot CLI session with 7 tool calls, recorded by agent-strace hooks. Rationale: present, high confidence, 1 prompt captured. Scope: present, medium, all 4 written files were named in a prompt or read. Validation: present, medium, unittest passed in the session. Stewardship: partial, medium, 1 human turn and no approval decisions. Evidence health: partial, high, redaction on, linked by branch. Check: pass; by default it fails on missing at medium or higher confidence.

The GitHub Action posts this comment (from a demo pull request) and uploads the evidence packet as an artifact. It reads .agent-traces/, so the branch has to carry the traces.

on: pull_request

permissions:
  contents: read
  pull-requests: write

jobs:
  reviewability:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha }}
          fetch-depth: 0
      - uses: Siddhant-K-code/agent-trace@v0.130.0
        with:
          review-commits: origin/${{ github.base_ref }}..HEAD

With the defaults, the Action reviews on every run and comments on pull_request events. A comment it cannot post is a warning, not a failure.

No CI? Paste agent-strace review --format markdown into the pull request body. That is the author's own claim, so the Action is the stronger path. See the pull request evidence workflow and the Action reference.

What review checks

It checks the session, not the code. What review looks for: rationale, the prompt that asked for the change; scope, files written versus files asked for or read; validation, tests and checks run in the session; stewardship, human turns and approvals; evidence health, capture gaps, redaction, and the session link. What it can't tell you: CI results, which it does not read; whether the code is right; what the hooks did not record, which is reported as a gap; and which session it was, if the session is linked by time only. Each finding is present, partial, missing, or inconclusive, with low, medium, or high confidence.

With no linked session, every finding is inconclusive at low confidence. By default the check fails only on missing at medium confidence or higher (threshold). A session picked by commit time, or as the latest one, is a weak link. How to read the findings. It can also compare the AI assistance a pull request declares with that evidence.

Share and team view

agent-strace share --dry-run   # what it would disclose; writes nothing
agent-strace share             # writes session-<id>.html
agent-strace cognitive-debt --since 30d --by repository

The packet leaves out prompts, responses, commands, paths, and tool values unless you pass --include-content. Do not commit it. See the disclosure preview.

cognitive-debt keeps reviewed, unreviewed, and unknown lines apart; unknown never counts as reviewed. It is a workflow metric, not a code quality score. See cognitive debt.

Agents

Agent What its hooks record
Claude Code Prompts, the final response, tool calls, failed tools. No model or tokens.
OpenAI Codex Prompts, responses, tool calls; tokens from 0.164.0. A failed shell command is a result.
GitHub Copilot CLI Prompts and tool calls. No response text, model, or tokens.
Copilot cloud agent Partial and unverified, only through a collector.
Gemini CLI, Cursor Hooks via setup; not in the capture matrix yet.

Details: capture matrix. Plugins install the hooks plus a skill that runs review before a pull request opens:

claude plugin marketplace add Siddhant-K-code/agent-trace && claude plugin install agent-strace@agent-trace
copilot plugin marketplace add Siddhant-K-code/agent-trace && copilot plugin install agent-strace@agent-trace
codex plugin marketplace add Siddhant-K-code/agent-trace && codex plugin add agent-strace@agent-trace

In Codex, trust the hooks in /hooks. Guides: Claude Code · Copilot CLI · Codex. Also: an MCP server (agent-strace mcp), a VS Code extension, machine-wide installs, and a Python library for your own agent:

from agent_trace import trace_tool, start_session, end_session

Privacy and telemetry

Traces stay local in .agent-traces/, with secret redaction on by default (security). Anonymous CLI telemetry is on after a one-time notice and off in CI and test environments. It never sends prompts, arguments, paths, repository data, or trace contents. Turn it off with agent-strace telemetry disable or DO_NOT_TRACK=1.

Labs

agent-strace --help shows the core commands. Experimental and specialist ones are in labs (agent-strace labs), including OpenTelemetry export, the collector server, auto-instrumentation, eval gates, and watch. The Action runs eval only when .agent-evals.yaml exists, or with run-eval: "true".

Docs

Docs index · Review · Command reference · Setup · Capture matrix · Action inputs

Run the tests with python -m unittest discover -s tests -v.

License

MIT. Use it however you want.


Sponsor · ADRs · Security · Contributing · Share your use case · Release guide · PyPI

Metadata

Release files for agent-strace 0.130.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agent-strace 0.130.0
File Size Uploaded Provenance Actions
agent_strace-0.130.0.tar.gz 2.9 MB Without provenance Details for agent_strace-0.130.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agent-strace 0.130.0
File Interpreter ABI Platform Actions
agent_strace-0.130.0-py3-none-any.whl Python 3 none any Details for agent_strace-0.130.0-py3-none-any.whl

Total release size: 3.9 MB

Release files / agent_strace-0.130.0.tar.gz

Download URL agent_strace-0.130.0.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
3462cfef09207611bef47e59188495ba65989cc3e6fe662629a7f5ce3dfe8388
BLAKE2b-256 checksum
How to use checksums
9a13c3d66111dd23a9d7d0f3f7583debe40768ea86948d27c7855ce889953f65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / agent_strace-0.130.0-py3-none-any.whl

Download URL agent_strace-0.130.0-py3-none-any.whl
Size 1.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
edbc8e59fab4fc162fe118ef1ca4b20ed276334221c3ea7c322a940fbd03fd7e
BLAKE2b-256 checksum
How to use checksums
8404d71193140754e78e3556b5921b0193500c9c362db0600b99ffcbabb6beb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for agent-strace 0.130.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.130.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page