Skip to main content

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 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)
  • Blame — trace every agent edit to a file across all trajectory sources, with line/char deltas
  • HTML exporttrajectoriz-cli show <id> --html renders a trajectory as a self-contained HTML page

CLI

# List trajectories in the current directory
trajectoriz-cli list

# Search all trajectories for a keyword (in-process grep, default)
# 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

trajectoriz-cli search raven
# 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
# Metadata-only search (no trajectory parsing, much faster)
trajectoriz-cli search foo --fast

# 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

API

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")

License

MIT

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

If you're not sure about the file name format, learn more about wheel file names.

trajectoriz-0.42.0-py3-none-any.whl (35.6 kB view details)

Uploaded Python 3

File details

Details for the file trajectoriz-0.42.0-py3-none-any.whl.

File metadata

  • Download URL: trajectoriz-0.42.0-py3-none-any.whl
  • Upload date:
  • Size: 35.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for trajectoriz-0.42.0-py3-none-any.whl
Algorithm Hash digest
SHA256 918a687b44d9bb69d5e8715bf57be915add540f44ca687b0d41a95978225bd77
MD5 0f8f2ccc2545f8ede9cdc48b13b59921
BLAKE2b-256 eac75e86b29cfc47be88eb59410d2f8ed962dece3834c6f5dcec041c169af4b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for trajectoriz-0.42.0-py3-none-any.whl:

Publisher: pypi-publish.yml on monperrus/trajectoriz

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.45.0

1 file

0.44.0

1 file

0.43.0

1 file

This release

0.42.0 This release

1 file

0.41.0

1 file

0.40.0

1 file

0.39.0

1 file

0.38.0

1 file

0.37.0

1 file

0.36.0

1 file

0.35.0

1 file

0.34.0

1 file

0.33.0

1 file

0.32.0

1 file

0.31.0

1 file

0.30.0

1 file

0.29.0

1 file

0.28.0

1 file

0.27.0

1 file

0.26.0

1 file

0.25.0

1 file

0.24.0

1 file

0.23.0

1 file

0.22.0

1 file

0.21.0

1 file

0.20.0

1 file

0.19.0

1 file

0.18.0

1 file

0.17.0

1 file

0.16.0

1 file

0.15.0

1 file

0.14.0

1 file

0.13.0

1 file

0.12.0

1 file

0.11.0

1 file

0.10.0

1 file

0.9.0

1 file

0.8.0

1 file

0.7.0

1 file

0.6.0

1 file

0.5.0

1 file

0.4.0

1 file

0.3.0

1 file

0.2.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page