| name | tracecc |
| description | Search and analyze past agent sessions using compiled trace bundles. Use when asked to recall previous conversations, find past sessions, search agent history, debug prior agent behavior, or answer "what did I say about X" / "when did we discuss Y" / "find the session where". Applies to "search traces", "past sessions", "trace search", "what happened last week", "show me recent errors". |
TraceCC - Agent Trace Search & Analysis
Search, render, and analyze compiled agent session traces via the tracecc CLI. Compiles raw JSONL session traces into an indexed SQLite bundle with structured search and multiple view projections.
Commands
Compile
Rebuild only when the bundle is stale or missing. Walks all configured trace roots from ~/.TraceCC/config.toml.
tracecc compile --bundle traces.tcc --redact default --json
Always use --redact default to strip API keys, tokens, and credentials.
To compile everything regardless of project scope:
tracecc compile --bundle all.tcc --redact default --all
Search
BM25 (ranked relevance) for natural-language queries:
tracecc search traces.tcc --query "scheduling API cron" --mode bm25 --limit 10
Regex (exact patterns) for function names, error messages, specific strings:
tracecc search traces.tcc --query "summarize_diff" --mode regex --limit 10
Default mode is regex. Use bm25 for vague queries.
Filters:
--roles user,assistant,tool_call,tool_result,tool_error - filter by message role
--since 2026-04-01 / --until 2026-04-11 - date range (YYYY-MM-DD)
--runtime codex - restrict to Codex sessions only
--project, --model - filter by metadata (use inspect --sessions to discover values)
--limit N - max results (default 20)
--format json - machine-readable output
Render
tracecc render traces.tcc --view ui --session latest
tracecc render traces.tcc --view full --session <session-id>
tracecc render traces.tcc --view adaptive --query "topic" --session all
Inspect
tracecc inspect traces.tcc --sessions
tracecc inspect traces.tcc --lines 71:72
Export
tracecc export traces.tcc --out exports/ --overwrite
tracecc export traces.tcc --split-sessions --out exports/ --overwrite
Workflows
"What did I say about X?"
- BM25 search with broad query, limit 10
- If noisy, add
--roles or --since filters
- Use session IDs from results to
render --view ui
- For exact text,
inspect --lines with the line range from search
"What errors have we been hitting?"
search --roles tool_error --mode bm25 --query "error" --limit 20
- Group by session ID
- Render UI view for sessions with interesting errors
"Show me recent sessions"
inspect --sessions for the full list
- For a date range:
search --since YYYY-MM-DD --until YYYY-MM-DD --roles user --query "." --mode regex
Bundle missing or stale
- Recompile:
tracecc compile --bundle traces.tcc --redact default --json
- Confirm session/event counts in output
- Proceed with the query
Rules
- Always use
--redact default when compiling
- Never expose raw bundle paths or internal IDs unless asked
- If search returns nothing, try alternate phrasings or broader filters before reporting "not found"
- The bundle is read-only after compile
- Recompile only when asked or when the bundle is clearly stale
- Line numbers in all output refer to canonical full-view coordinates