Append-only JSONL session traces.
One daily file. Assemble rebuilds the chat payload for one request.
Quickstart
pip install agents-traces && agents-traces init
Creates ~/.agents/traces/, copies skills, and merges MCP into host configs whose directories already exist.
Source checkouts can also be installed and managed with vand.
What it does
Each UTC day is one append-only file: ~/.agents/traces/YYYY-MM-DD.jsonl (override AGENTS_TRACES_DIR). No daemon, no database. Append is a file write.
Inspect. MCP reads the same files an agent just wrote: timeline, recent errors, token and cost totals, per-model failure rates.
Assemble. agents-traces assemble --session <id> rebuilds chat-completions messages for that session from the JSONL. Tool bodies can be dropped; user turns stay.
Session text. session_snap, session_grep, and session_tail search message text in this store. They do not read agents-memory.
Ingest. ingest copies IDE transcripts (Antigravity, Cursor, Claude, Cline) into the daily files. Live sessions already on disk are not duplicated.
Retention. cleanup deletes files older than --keep-days (default 30). --compress gzips them instead.
Bare agents-traces (no subcommand) prints today's stats. The MCP server is serve or mcp, not the default.
Where it runs
Floor: any MCP client or a terminal. python -m agents_traces serve is enough.
init autowires hosts it finds. It does not install an IDE.
| Layer | What you get | Who |
|---|---|---|
| JSONL + MCP/CLI | Record, inspect, stats, assemble | Any MCP host / any shell |
| Autowire on init | Merge agents-traces into the host MCP file when that config directory already exists; copy trace-inspect and trace-stats |
Cursor, Claude Desktop, Zed (context_servers), Antigravity / Gemini, Windsurf, Codex, Roo, Cline. Skills land in ~/.agents/skills, ~/.cursor/skills, ~/.gemini/config/skills |
MCP without autowire: point the host at python -m agents_traces serve.
MCP tools
Primary surface. Agents diagnose a failed loop here.
| Tool | What it does |
|---|---|
get_last_session_trace |
Timeline for one session, or the latest. Optional trace: prefix on the id |
get_recent_errors |
Failed tool calls with args and stack |
get_session_stats |
Tokens, estimated cost, tool success for the last N days |
get_model_stats |
Same window, split by model, with failure rates |
record_trace |
Append one event |
ingest_traces |
Pull IDE transcripts into the daily files |
session_snap |
Recent user messages in the traces store |
session_grep |
Search those messages |
session_tail |
Last lines for one session, or the latest |
Nine tools. Full contract: abi/MCP.md.
CLI
Ops / install / batch. Machine-readable catalog: python -m agents_traces --help-json (do not scrape --help).
| Command | Purpose |
|---|---|
agents-traces init |
Traces dir, skills, MCP merge |
agents-traces stats [--date YYYY-MM-DD | --days N] [--by-model] [--json] |
Tokens, cost, tool rates. No flags = today |
agents-traces analyze-models [--days N] |
Stats split by model (default 7 days) |
agents-traces inspect [session-id] |
Terminal timeline. No id = latest session |
agents-traces sessions [--days N] [--limit N] |
Recent sessions with token and cost totals |
agents-traces tail [-n N] [-f] [--raw] |
End of today's file. -f follows |
agents-traces record … |
Append one event from a shell |
agents-traces assemble --session ID [--limit N] [--days N] [--include-tools] |
Rebuild chat messages for that session |
agents-traces ingest |
IDE transcripts → daily JSONL |
agents-traces cleanup [--keep-days N] [--compress] |
Delete old files, or gzip them |
agents-traces serve / mcp |
stdio MCP. Not the default command |
agents-traces skills / sync-mcp |
Re-copy skills, or re-merge MCP |
ABI
Layout and contracts in abi/:
WHY.md— JSONL instead of a tracing stackLAYOUT.md— daily filesSCHEMA.md— event fieldsMCP.md— tool surfaceCLI.md— commands
Tests
python tests/run_all_tests.py
License
MIT. See LICENSE.
Release files for agents-traces 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| agents_traces-0.0.3.tar.gz | 52.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agents_traces-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 103.7 kB
Release files / agents_traces-0.0.3.tar.gz
| Download URL | agents_traces-0.0.3.tar.gz |
|---|---|
| Size | 52.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c88db2221ece93e0d99012cf63b491a6b8581b7d7212b50f74092e80ae23cee3
|
|
BLAKE2b-256 checksum How to use checksums |
049667e60c7697c9e6e32dbb839e2d150c766209b0b54ea57255847cc7664afc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.6
|
Release files / agents_traces-0.0.3-py3-none-any.whl
| Download URL | agents_traces-0.0.3-py3-none-any.whl |
|---|---|
| Size | 51.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a6856cf7806a0e0c9d0a3d05577a892ba0025be1882121a3443359ab679c1eda
|
|
BLAKE2b-256 checksum How to use checksums |
679ba5c3851a2543b6aa147e350c4ad29c40d6bb6b437f4cfaa4e76141e99558
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.6
|