Skip to main content

trailback

Vendor-neutral CLI/TUI for browsing local agent logs.

Note: The package is called trailback (uv pip install trailback), but the CLI command is trail — short to type, easy to remember. See docs/NAMING.md for background.

Current MVP supports Codex, Claude, and Gemini sessions for listing, viewing transcripts, and usage stats.

Install

Install the CLI as a uv tool so the trail executable is available from anywhere:

uv tool install -e .

Ensure the uv tool bin directory is on your PATH (usually ~/.local/bin):

export PATH="$HOME/.local/bin:$PATH"

Verify:

command -v trail
trail tui

CLI

  • trail sources
  • trail ls [--source codex] [--no-cwd]
  • trail ls [--group] [--header] [--show-ids]
  • trail open <session_id> [--source codex]
  • trail open <group_id>
  • trail stats [--source codex] [--format text|csv|json] [--period all|daily|monthly|yearly] [--no-header]
  • trail tui
  • trail init [--path PATH] [--force]

Config

Use ~/.config/trail/config.toml to add sources. Default Codex example:

[sources.codex]
kind = "codex"
path = "~/.codex"
include = ["sessions/**/*.jsonl", "sessions/**/*.json"]

Claude example:

[sources.claude]
kind = "claude"
path = "~/.claude"
include = ["projects/**/*.jsonl"]

Gemini example:

[sources.gemini]
kind = "gemini"
path = "~/.gemini"
include = ["tmp/*/chats/session-*.json", "tmp/*/logs.json"]

Log sync (multi-machine)

Use scripts/sync-logs.sh to sync logs from a secondary machine to a primary. It is designed for one-way sync (secondary -> primary) and uses a quiet window to avoid in-progress files.

Manual run:

PRIMARY_USER=youruser PRIMARY_HOST=your-primary-host ./scripts/sync-logs.sh

Dry run:

DRY_RUN=1 PRIMARY_USER=youruser PRIMARY_HOST=your-primary-host ./scripts/sync-logs.sh

Optional SSH options:

SSH_OPTS="-i ~/.ssh/your_key -o StrictHostKeyChecking=accept-new" \
  PRIMARY_USER=youruser PRIMARY_HOST=your-primary-host ./scripts/sync-logs.sh

LaunchAgent example (runs every 6 hours):

~/Library/LaunchAgents/com.trail.logs-sync.plist

Reload after edits:

launchctl unload -w ~/Library/LaunchAgents/com.trail.logs-sync.plist 2>/dev/null || true
launchctl load -w ~/Library/LaunchAgents/com.trail.logs-sync.plist
launchctl kickstart -k gui/$(id -u)/com.trail.logs-sync

For design details, see docs/LOG_SYNC.md.

Release files for trailback 0.1.1

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

Source distribution (sdist)

Source distribution for trailback 0.1.1
File Size Uploaded
trailback-0.1.1.tar.gz 72.3 kB Details

Built distribution (wheel)

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

Total release size: 108.3 kB

Release files / trailback-0.1.1.tar.gz

Download URL trailback-0.1.1.tar.gz
Size 72.3 kB
Tags Source
SHA-256 checksum
How to use checksums
78c5396b91a55d13d87fbe53bfad7db8920ed82c33cde47a40ca8638d398e10f
BLAKE2b-256 checksum
How to use checksums
3cc17dd50a6cc1eb889fc57394f280cf858c1482ca053d818c394dd551b50f4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / trailback-0.1.1-py3-none-any.whl

Download URL trailback-0.1.1-py3-none-any.whl
Size 36.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
930c98ff15ec48beb09887e82074c682588a1c00888662b757097047222a7775
BLAKE2b-256 checksum
How to use checksums
2df7d0b4c98405e5c88088465d4b3c50d001e7c6b72c272f63a519454b4eb665
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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