Locate agent trajectory files on the local machine
Project description
trajectoriz
Library to work with agent trajectory files. Support Claude, Codex, OpenCode and others
Installation
pip install trajectoriz
Features
- Unified record API — iterate and parse sessions from Claude Code, Codex, Copilot, OpenCode, Hermes, agent_probe and more through a single
iter_records()/parse_record()interface - Full-content search — three backends: in-process
grep(default, no setup),recoll(Xapian index),sqlite(FTS5 index) - CLI — list, search, show, blame, stats, and advanced shell-program analysis
- Blame — trace every agent edit to a file across all trajectory sources, with line/char deltas
- HTML export —
trajectoriz-cli show <id> --htmlrenders a trajectory as a self-contained HTML page
Usage
from trajectoriz import iter_records, parse_record
# Iterate sessions across all supported agents (Claude, Codex, Copilot, OpenCode, …)
for record in iter_records():
print(record.agent, record.timestamp[:10], record.first_msg[:60])
# Iterate sessions for the current project only
for record in iter_records(cwd="/path/to/repo"):
trajectory = parse_record(record)
if trajectory is not None:
print(f"{record.agent}: {len(trajectory.steps)} steps, {trajectory.total_tokens} tokens")
CLI
# List trajectories in the current directory
trajectoriz-cli list
# Search all trajectories for a keyword (in-process grep, default)
trajectoriz-cli search raven
# OR search — matches any of the terms
trajectoriz-cli search "theraven\|raven\|password"
# Metadata-only search (no trajectory parsing, much faster)
trajectoriz-cli search foo --fast
# Search backends
trajectoriz-cli search foo --backend grep # in-process substring scan (default)
trajectoriz-cli search foo --backend recoll # Xapian index via recoll CLI
trajectoriz-cli search foo --backend sqlite # local SQLite FTS5 index
# Build / update the recoll and SQLite indexes
trajectoriz-cli refresh # both
trajectoriz-cli refresh --no-sqlite # recoll only
trajectoriz-cli refresh --no-recoll # SQLite only
# Show a trajectory (markdown, paginated)
trajectoriz-cli show cl-1234abcd
trajectoriz-cli show cl-1234abcd --last
trajectoriz-cli show cl-1234abcd --html > out.html
# Blame a file — every agent edit in chronological order with line deltas
trajectoriz-cli blame src/main.py
# Aggregate shell-invoked programs across a repo
trajectoriz-cli advanced tools --dir /path/to/repo --json
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 trajectoriz-0.34.0-py3-none-any.whl.
File metadata
- Download URL: trajectoriz-0.34.0-py3-none-any.whl
- Upload date:
- Size: 33.9 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 |
49430776498d1708aa31b77871fcb0f574ce8cd843ee26faa7a5f7c61e165f1e
|
|
| MD5 |
0f94fcd530840052a1c04dfdb7f05027
|
|
| BLAKE2b-256 |
e19d8196168f53451b5ce83e2947d9c3310ca1db01acd5edd83fd6cb45c1673a
|
Provenance
The following attestation bundles were made for trajectoriz-0.34.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on monperrus/trajectoriz
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trajectoriz-0.34.0-py3-none-any.whl -
Subject digest:
49430776498d1708aa31b77871fcb0f574ce8cd843ee26faa7a5f7c61e165f1e - Sigstore transparency entry: 2019137877
- Sigstore integration time:
-
Permalink:
monperrus/trajectoriz@498c3b3302b91b9eb5eb2db7fdca7993c7ea2840 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/monperrus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@498c3b3302b91b9eb5eb2db7fdca7993c7ea2840 -
Trigger Event:
push
-
Statement type: