Skip to main content

sessionlog

CI PyPI License: Apache-2.0 Python 3.11+ Docs

See exactly what your AI coding agent did — every tool call, error, and decision, ingested in real time.

The problem

Coding agents generate rich session logs, but those logs are usually raw JSONL blobs in hidden folders. There's no way to query your sessions, spot error patterns, or understand where the agent stumbled. You're flying blind on what your agent actually did.

Quick start

pip install sessionlog
sessionlog ingest        # one-shot: parse all sessions into SQLite
sessionlog start         # daemon: watch for new sessions in real time

Your sessions are now in ~/.sessionlog/data.sqlite — query with any SQLite client.

Current support status

sessionlog now supports multiple source directories, but parser support is still format-specific.

Agent Source discovery Format parsing Tool-call extraction
Claude Code Yes (default) Yes (validated) Yes (tool_use, tool_result, agent_progress, bash_progress)
Codex (CLI / coding agent logs) Yes (default path) Yes (validated from local sample logs) Yes (response_item:function_call, function_call_output)
Cursor Yes (default path) Partial (validated transcript format: agent-transcripts/*.txt) No native tool-event extraction from transcript files
Antigravity Yes (default ~/.gemini/antigravity) Partial: protobuf storage plus validated brain/<id>/*.md(.resolved*) and code_tracker/active/** artifacts Partial: artifact/revision ingestion + bash-snippet heuristics (no protobuf-native tool events yet)
Other agents (Copilot, Windsurf, Cline, Roo, Aider, Gemini, Continue, OpenCode) Yes (default paths + --sources-dir) Not yet validated as native formats Pending per-agent adapters

Important: source support and parser support are different. We now have verified adapters for Claude + Codex, partial Cursor transcript ingestion, and partial Antigravity artifact ingestion from brain/*.md, brain/*.resolved*, and code_tracker/active/**. Other agents require schema samples + adapters for accurate tool analytics.

All ingested rows now include agent_type in SQLite (raw_entries.agent_type, progress_entries.agent_type) so cross-agent analytics can disambiguate source reliably.

Install

pip install sessionlog

From source:

git clone https://github.com/npow/agenttrace.git
cd agenttrace
make dev-install
source .venv/bin/activate

Usage

One-shot ingestion

Parse all existing sessions from known sources (Claude, Codex, Cursor):

sessionlog ingest
# Done. 42/42 files ingested, 18,302 raw entries, 5,841 progress entries
# (0 skipped, 0 failed). DB totals: 18302 entries, 127 sessions, 12 projects.

Real-time daemon

Watch default agent session roots and ingest new entries as sessions run:

sessionlog start
# Watching claude=/Users/you/.claude/projects, codex=/Users/you/.codex/sessions, cursor=/Users/you/.cursor/projects → /Users/you/.sessionlog/data.sqlite

Re-ingest from scratch

sessionlog ingest --force

Custom paths

sessionlog start \
  --db /path/to/my.sqlite \
  --sources-dir codex=/path/to/codex/sessions \
  --sources-dir cursor=/path/to/cursor/sessions \
  --sources-dir claude=/path/to/claude/projects

You can also set defaults via SESSIONLOG_SOURCES:

export SESSIONLOG_SOURCES="codex=~/.codex/sessions,cursor=~/.cursor/projects,claude=~/.claude/projects"

How it works

sessionlog watches one or more source directories for JSONL session files using watchdog. When a file changes, it runs an incremental parse: only new lines are read, tool calls and errors are classified, and everything is written to SQLite with WAL mode for concurrent access. A 30-second debounce prevents redundant ingestion when many files change at once.

Tool-call parsing details

Today, tool extraction logic is aligned with Claude-style JSONL:

  • Assistant tool calls: message.content[] blocks with type="tool_use"
  • Tool results/errors: message.content[] blocks with type="tool_result" + is_error
  • Progress events: top-level type="progress" with data.type in {"agent_progress","bash_progress"}

If another agent emits different field names/shapes, tool metrics can be incomplete or wrong until a dedicated adapter is implemented.

Verified on this machine

  • Codex: JSONL with response_item records (function_call, function_call_output, message)
  • Cursor: project data + agent-transcripts/*.txt files (plain text transcript sections)
  • Antigravity: protobuf files under ~/.gemini/antigravity/conversations/*.pb and annotations/*.pbtxt
  • Antigravity: markdown artifacts under ~/.gemini/antigravity/brain/<conversation-id>/*.md with *.metadata.json timestamps
  • Antigravity: high-entropy protobuf blobs appear encrypted/compressed-at-rest; protoc --decode_raw does not decode directly

Frequently used agents/editors in current workflows include:

  • OpenAI Codex / Codex CLI
  • Cursor
  • GitHub Copilot Agent
  • Windsurf (Cascade)
  • Cline / Roo Code
  • Aider
  • Gemini CLI
  • Continue
  • Antigravity
  • OpenCode

These should be treated as separate parser targets (not just directory aliases), each with fixture-based tests against real sample logs.

Development

git clone https://github.com/npow/agenttrace.git
cd agenttrace
make test

License

Apache-2.0 — see LICENSE.

Metadata

Release files for sessionlog 0.1.6

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

Source distribution (sdist)

Source distribution for sessionlog 0.1.6
File Size Uploaded Provenance
sessionlog-0.1.6.tar.gz 30.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sessionlog 0.1.6
File Interpreter ABI Platform
sessionlog-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 55.1 kB

Release files / sessionlog-0.1.6.tar.gz

Download URL sessionlog-0.1.6.tar.gz
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
190fb68de9edf36d5de9b0c50d492553fdca367a4b7f6e8c0c11895fd44e7b94
BLAKE2b-256 checksum
How to use checksums
25cecfa8c6c21875792c68dbf79b607356b831aabfd13cddcb18f3232cef1e58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Release files / sessionlog-0.1.6-py3-none-any.whl

Download URL sessionlog-0.1.6-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb23d8d0033a8f80d3dbf4f7da56e14719e3cd6261c317d1a8e6eeb716b05a72
BLAKE2b-256 checksum
How to use checksums
0d0c19ac61d18c7062b56cfca6bff94e4c59024d78e7e1ac72526f4d8592299d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

Security for sessionlog 0.1.6

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sessionlog-0.1.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 1, 2026.

Transparency log

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.

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