trace-cli

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0

README

Trace

Trace keeps local keyframes of coding-agent turns so a project can be inspected, rewound, and forked.

Status

The CLI records Claude Code, Codex, Cursor Agent, and Antigravity CLI (agy) turns, stores compressed keyframes, and supports log, show, rewind, status, why, fork, resume, garbage collection, read-only MCP history tools, and Agent Trace export. The daemon stays resident until stopped, recovers automatically from the next agent session, and rotates its log. Rewind handles files changing into directories and back, removes empty directories created by earlier restores, preserves ignored files, and records the restored tree as the latest keyframe. It captures available assistant text, tool names, and read paths from agent hooks or transcripts. Optional Tree-sitter builds classify structural edits. An opt-in Pro/Team sync client uploads history in Worker-sized batches, appends corrections for completed turns and sessions, and can recover it into a fresh Git checkout through the separate Trace app, which is not yet deployed. make test-sync checks the client. See quickstart and privacy.

Build and try it

Go 1.23 or newer and Git are required. Until the first tagged release, build from source:

git clone https://github.com/UseTrace-SI/trace-cli.git
cd trace-cli
make build
export PATH="$PWD/bin:$PATH"
cd /path/to/your/git/repo
trace init --agent codex

Choose claude-code, cursor, or agy instead of codex to install that agent's hooks. After an agent turn, run trace log, trace show 1, or trace why path/to/file.go:12. Preview a restore with trace rewind 1 --dry-run. See the quickstart for fork and resume.

Documentation

Guide Covers
Quickstart Record, inspect, rewind, and fork
CLI reference Commands and flags
How it works Keyframes, daemon, adapters, and restore
Privacy Redaction, exclusions, and local storage
Optional sync Encryption, recovery, and server protocol
Release Maintainer checks and packaging

Repository layout

Path Purpose
cmd/trace, internal/ Go CLI, daemon, and local storage
docs/ CLI, sync, privacy, and release guides
scripts/ Install, end-to-end, performance, and Homebrew tooling

The Go module and project Makefile live at the repository root. Run make lint test for the CLI and make test-sync for its sync client. When the private trace-app repository is checked out beside this one, make test-sync-integration exercises both sides of the protocol.

Trace is licensed under Apache 2.0.

Directories

Path Synopsis
cmd
trace command
internal
adapters/hookcmd
Package hookcmd builds and recognizes Trace agent hook commands.
Package hookcmd builds and recognizes Trace agent hook commands.
cli
id
mcp
textutil
Package textutil provides small, allocation-light string helpers shared by the CLI and MCP surfaces.
Package textutil provides small, allocation-light string helpers shared by the CLI and MCP surfaces.
why
scripts
homebrew command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL