Real-time ingestion daemon for AI coding agent sessions
Project description
sessionlog
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 withtype="tool_use" - Tool results/errors:
message.content[]blocks withtype="tool_result"+is_error - Progress events: top-level
type="progress"withdata.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_itemrecords (function_call,function_call_output,message) - Cursor: project data +
agent-transcripts/*.txtfiles (plain text transcript sections) - Antigravity: protobuf files under
~/.gemini/antigravity/conversations/*.pbandannotations/*.pbtxt - Antigravity: markdown artifacts under
~/.gemini/antigravity/brain/<conversation-id>/*.mdwith*.metadata.jsontimestamps - Antigravity: high-entropy protobuf blobs appear encrypted/compressed-at-rest;
protoc --decode_rawdoes not decode directly
Popular agents to target next
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sessionlog-0.1.6.tar.gz.
File metadata
- Download URL: sessionlog-0.1.6.tar.gz
- Upload date:
- Size: 30.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
190fb68de9edf36d5de9b0c50d492553fdca367a4b7f6e8c0c11895fd44e7b94
|
|
| MD5 |
9f2279680dc3155369e6ffe9bd632e7c
|
|
| BLAKE2b-256 |
25cecfa8c6c21875792c68dbf79b607356b831aabfd13cddcb18f3232cef1e58
|
Provenance
The following attestation bundles were made for sessionlog-0.1.6.tar.gz:
Publisher:
publish.yml on npow/sessionlog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sessionlog-0.1.6.tar.gz -
Subject digest:
190fb68de9edf36d5de9b0c50d492553fdca367a4b7f6e8c0c11895fd44e7b94 - Sigstore transparency entry: 1204561921
- Sigstore integration time:
-
Permalink:
npow/sessionlog@5bb6a19b23ce2581821155d73ed03c3f43f87499 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/npow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5bb6a19b23ce2581821155d73ed03c3f43f87499 -
Trigger Event:
push
-
Statement type:
File details
Details for the file sessionlog-0.1.6-py3-none-any.whl.
File metadata
- Download URL: sessionlog-0.1.6-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb23d8d0033a8f80d3dbf4f7da56e14719e3cd6261c317d1a8e6eeb716b05a72
|
|
| MD5 |
cc7b9430f4135d5eb42b225aaa18e67a
|
|
| BLAKE2b-256 |
0d0c19ac61d18c7062b56cfca6bff94e4c59024d78e7e1ac72526f4d8592299d
|
Provenance
The following attestation bundles were made for sessionlog-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on npow/sessionlog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sessionlog-0.1.6-py3-none-any.whl -
Subject digest:
cb23d8d0033a8f80d3dbf4f7da56e14719e3cd6261c317d1a8e6eeb716b05a72 - Sigstore transparency entry: 1204561929
- Sigstore integration time:
-
Permalink:
npow/sessionlog@5bb6a19b23ce2581821155d73ed03c3f43f87499 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/npow
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5bb6a19b23ce2581821155d73ed03c3f43f87499 -
Trigger Event:
push
-
Statement type: