Skip to content

assimovt/trce-cli

Repository files navigation

trce

trce — See what your coding agents do

See what your coding agents do.

Read Inside a coding agent run for the story behind trce.

CI License: MIT

trce records Claude Code and Codex CLI sessions locally as structured events. Inspect each trace on your machine, or explicitly share it for live viewing and replay.

Recording is local. Nothing leaves your machine until you explicitly share. Redaction runs on-device before every upload.

Install

npm install -g @trce/cli@next
trce help

The package installs a self-contained native executable; Bun is not required at runtime. Install scripts and optional dependencies must be enabled so npm can select the binary for your platform.

Supported targets:

  • macOS, Linux, and Windows
  • arm64 and x64

Quick start

Preview and install hooks for the current project:

# Claude Code
trce init --harness claude-code --scope project --dry-run
trce init --harness claude-code --scope project --yes

# Codex CLI
trce init --harness codex-cli --scope project --dry-run
trce init --harness codex-cli --scope project --yes

Use --scope global to install for every project. Start a new Claude Code or Codex session after installation; hooks then record lifecycle events locally in ~/.trce/spool/.

Share the latest session when you choose:

trce share --latest          # one-shot share
trce share --latest --live   # live updates until the session ends
trce share --latest --local  # redacted JSON and HTML; no upload

Claude Code users can also run /trce-share or /trce-share live. In Codex, ask the agent to run the same trce share command, or run it yourself.

Delete a hosted copy without deleting the local recording:

trce unshare https://trce.sh/t/<share-id>

How it works

  1. Harness hooks append native events to a local JSONL spool. trce spool does no network work, normalization, or redaction.
  2. An explicit share action combines the spool with the native transcript, normalizes it, and redacts it on-device.
  3. The CLI writes a local trace.json, redaction report, and HTML preview. It uploads only when --local is not set.

Long sessions are uploaded in ordered, retry-safe batches. Oversized event payloads are reduced to a visible first/last preview for sharing while the raw local recording remains untouched.

Privacy

Applied trce init creates a random device token in ~/.trce/config.toml. The token is never printed or included in trace data; it is used only as the authorization header for explicit publish and unshare actions. Existing tokens are preserved. On macOS and Linux, the directory is mode 0700 and the config file is mode 0600.

Redaction masks secret-looking keys and values, common credential formats, authorization headers, database URLs, PEM keys, values loaded from local .env* files, and configured extra values. Redaction is best-effort, and every share includes a visible report. Review sensitive traces before sharing.

Documentation

The Zod definitions in packages/schema are the source of truth for the trce: "0.1" format. Unknown native records degrade to other rather than crashing when harness formats drift.

Development

Requires Bun 1.3.12. Node.js 24 and npm 11 are also used by package smoke tests.

bun install --frozen-lockfile
bun run verify

See CONTRIBUTING.md for fixture, privacy, and pull-request requirements.

Community

  • Use GitHub Issues for sanitized bug reports and focused feature proposals.
  • Use SECURITY.md for private vulnerability reports. Never post raw traces, credentials, or device tokens publicly.
  • Participation is governed by the Code of Conduct.

Maintained by Tair Asim. Released under the MIT License.

About

Local-first recorder and share CLI for Claude Code and Codex sessions.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages