Skip to content

Commit 12ed190

Browse files
anandgupta42claude
andauthored
refactor: rename Recap back to Trace for AI model comprehension (#443)
* refactor: rename `Recap` back to `Trace` across entire codebase AI models (Claude, GPT, etc.) struggle to understand "compare recaps" but natively understand "compare traces" — `trace` is standard observability terminology. This reverts the Tracer→Recap rename while keeping backward- compat aliases for both `Tracer` and `Recap`. **Source code (7 files):** - Class `Recap` → `Trace` in `tracing.ts` with backward-compat aliases - CLI command `recap` → `trace` with `recap` kept as hidden alias - TUI slash command `/recap` → `/trace` with `recap` kept as alias - Viewer branding: "Altimate Recap" → "Altimate Trace" - All variable/function names updated (`sessionRecaps` → `sessionTraces`, etc.) **Documentation (7 files):** - `docs/configure/recap.md` → `docs/configure/trace.md` - All doc references updated: CLI, TUI, CI/headless guides - Image directory `assets/images/recap/` → `assets/images/trace/` **Tests (12 files):** - All imports updated `Recap` → `Trace` - Variable shadowing fixed: `const trace: TraceFile` → `const traceFile` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: address PR review comments - Keep `traceViewerTracesDir` in sync on every URL request, not just on first server creation (app.tsx) - Reset per-session trace state (`sessionTraces`, `sessionUserMsgIds`) when restarting the event stream in worker.ts - Fix "traceFile" variable-style wording in test file comments to use natural language ("trace file", "trace viewer", "trace list") Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 91ebfe5 commit 12ed190

29 files changed

+954
-955
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3232

3333
### Added
3434

35-
- **Recap (renamed from Tracer)** — session recap with loop detection and enhanced viewer (#381)
35+
- **Trace (session recording)** — session trace with loop detection and enhanced viewer (#381)
3636
- **ESM bundling regression tests** — 9 e2e tests verifying Node can load `altimate-dbt` via symlink, wrapper, and direct invocation paths
3737

3838
### Testing

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ Manifest parsing, test generation, model scaffolding, incremental model detectio
131131
### Data Visualization
132132
Interactive charts and dashboards from SQL results. The data-viz skill generates publication-ready visualizations with automatic chart type selection based on your data.
133133
134-
### Local-First Recap
135-
Built-in observability for AI interactions — recap tool calls, token usage, and session activity locally. No external services required. View recaps with `altimate recap`. Features include loop detection, post-session summary, and shareable HTML exports.
134+
### Local-First Tracing
135+
Built-in observability for AI interactions — trace tool calls, token usage, and session activity locally. No external services required. View session recordings with `altimate trace`. Features include loop detection, post-session summary, and shareable HTML exports.
136136
137137
### AI Teammate Training
138138
Teach your AI teammate project-specific patterns, naming conventions, and best practices. The training system learns from examples and applies rules automatically across sessions.
File renamed without changes.
File renamed without changes.
Lines changed: 53 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
1-
# Recap
1+
# Trace
22

3-
Altimate Code captures detailed recaps of every session, including LLM generations, tool calls, token usage, cost, and timing, and saves them locally as JSON files. Recaps are invaluable for debugging agent behavior, optimizing cost, and understanding how the agent solves problems.
3+
Altimate Code captures detailed traces (session recordings) of every session, including LLM generations, tool calls, token usage, cost, and timing, and saves them locally as JSON files. Traces are invaluable for debugging agent behavior, optimizing cost, and understanding how the agent solves problems.
44

5-
Recap is **enabled by default** and requires no configuration. Recaps are stored locally and never leave your machine unless you configure a remote exporter.
5+
Tracing is **enabled by default** and requires no configuration. Traces are stored locally and never leave your machine unless you configure a remote exporter.
66

7-
![Recap Summary View](../assets/images/recap/summary-tab.png)
8-
9-
!!! note "Renamed from Tracer"
10-
The tracer feature has been renamed to **recap**. The `trace` command still works as a backward-compatible alias (`--no-trace` is the backward-compatible flag name). New features include loop detection, post-session summary, and shareable HTML exports.
7+
![Trace Summary View](../assets/images/trace/summary-tab.png)
118

129
## Quick Start
1310

1411
```bash
15-
# Run a prompt (recap is saved automatically)
12+
# Run a prompt (trace is saved automatically)
1613
altimate-code run "optimize my most expensive queries"
17-
#Recap saved: ~/.local/share/altimate-code/traces/abc123.json
14+
#Trace saved: ~/.local/share/altimate-code/traces/abc123.json
1815

19-
# List recent recaps
20-
altimate-code recap list
16+
# List recent traces
17+
altimate-code trace list
2118

22-
# View a recap in the browser
23-
altimate-code recap view abc123
19+
# View a trace in the browser
20+
altimate-code trace view abc123
2421
```
2522

2623
## What's Captured
2724

28-
Each recap records the full agent session:
25+
Each trace records the full agent session:
2926

3027
| Data | Description |
3128
|------|-------------|
@@ -41,7 +38,7 @@ Each recap records the full agent session:
4138

4239
### Data Engineering Attributes
4340

44-
When using SQL and dbt tools, recaps automatically capture domain-specific data:
41+
When using SQL and dbt tools, traces automatically capture domain-specific data:
4542

4643
| Category | Examples |
4744
|----------|----------|
@@ -51,7 +48,7 @@ When using SQL and dbt tools, recaps automatically capture domain-specific data:
5148
| **Data Quality** | Row counts, null percentages, freshness, anomaly detection |
5249
| **Cost Attribution** | LLM cost + warehouse compute cost + storage delta = total cost, per user/team/project |
5350

54-
These attributes are purely optional. Recaps are valid without them. They're populated automatically by tools that have access to warehouse metadata.
51+
These attributes are purely optional. Traces are valid without them. They're populated automatically by tools that have access to warehouse metadata.
5552

5653
## Configuration
5754

@@ -70,12 +67,12 @@ Add to your config file (`~/.config/altimate-code/altimate-code.json` or project
7067

7168
| Option | Type | Default | Description |
7269
|--------|------|---------|-------------|
73-
| `enabled` | `boolean` | `true` | Enable or disable recap |
74-
| `dir` | `string` | `~/.local/share/altimate-code/traces/` | Custom directory for recap files |
75-
| `maxFiles` | `number` | `100` | Max recap files to keep (oldest pruned automatically). Set to `0` for unlimited |
70+
| `enabled` | `boolean` | `true` | Enable or disable tracing |
71+
| `dir` | `string` | `~/.local/share/altimate-code/traces/` | Custom directory for trace files |
72+
| `maxFiles` | `number` | `100` | Max trace files to keep (oldest pruned automatically). Set to `0` for unlimited |
7673
| `exporters` | `array` | `[]` | Remote HTTP exporters (see below) |
7774

78-
### Disabling Recap
75+
### Disabling Tracing
7976

8077
```json
8178
{
@@ -91,15 +88,15 @@ Or per-run with the `--no-trace` flag:
9188
altimate-code run --no-trace "quick question"
9289
```
9390

94-
## Viewing Recaps
91+
## Viewing Traces
9592

96-
### List Recaps
93+
### List Traces
9794

9895
```bash
99-
altimate-code recap list
96+
altimate-code trace list
10097
```
10198

102-
Shows a table of recent recaps with session ID, timestamp, duration, tokens, cost, tool calls, and status.
99+
Shows a table of recent traces with session ID, timestamp, duration, tokens, cost, tool calls, and status.
103100

104101
```
105102
SESSION WHEN DURATION TOKENS COST TOOLS STATUS PROMPT
@@ -112,17 +109,17 @@ Options:
112109

113110
| Flag | Description |
114111
|------|-------------|
115-
| `-n`, `--limit` | Number of recaps to show (default: 20) |
112+
| `-n`, `--limit` | Number of traces to show (default: 20) |
116113

117-
### View a Recap
114+
### View a Trace
118115

119116
```bash
120-
altimate-code recap view <session-id>
117+
altimate-code trace view <session-id>
121118
```
122119

123-
Opens a local web server with an interactive recap viewer in your browser.
120+
Opens a local web server with an interactive trace viewer in your browser.
124121

125-
![Recap Full View](../assets/images/recap/summary-full.png)
122+
![Trace Full View](../assets/images/trace/summary-full.png)
126123

127124
The viewer has 5 tabs:
128125

@@ -148,35 +145,35 @@ Options:
148145
| `--port` | Port for the viewer server (default: random) |
149146
| `--live` | Auto-refresh every 2s for in-progress sessions |
150147

151-
Partial session ID matching is supported. For example, `altimate-code recap view abc` matches `abc123def456`.
148+
Partial session ID matching is supported. For example, `altimate-code trace view abc` matches `abc123def456`.
152149

153150
### Live Viewing (In-Progress Sessions)
154151

155-
Recaps are written incrementally. After every tool call and generation, a snapshot is flushed to disk. This means you can view a recap while the session is still running:
152+
Traces are written incrementally. After every tool call and generation, a snapshot is flushed to disk. This means you can view a trace while the session is still running:
156153

157154
```bash
158155
# In terminal 1: run a long task
159156
altimate-code run "refactor the entire pipeline"
160157

161-
# In terminal 2: watch the recap live
162-
altimate-code recap view <session-id> --live
158+
# In terminal 2: watch the trace live
159+
altimate-code trace view <session-id> --live
163160
```
164161

165162
The `--live` flag adds a green "LIVE" indicator and polls for updates every 2 seconds. The page auto-refreshes when new spans appear.
166163

167164
### From the TUI
168165

169-
Type `/recap` in the TUI to open a recap history dialog listing all recent sessions. Select any recap to open it in your browser with the interactive viewer. The current session appears at the top, and recaps are grouped by date with duration and timestamp info.
166+
Type `/trace` in the TUI to open a trace history dialog listing all recent sessions. Select any trace to open it in your browser with the interactive viewer. The current session appears at the top, and traces are grouped by date with duration and timestamp info.
170167

171168
The viewer launches in live mode automatically for in-progress sessions, so you can watch spans appear as the agent works.
172169

173-
### Sharing Recaps
170+
### Sharing Traces
174171

175-
The recap viewer includes a **Share** button that exports a self-contained HTML file. This file includes all session data and can be opened in any browser without a server — perfect for sharing with teammates, attaching to tickets, or archiving sessions.
172+
The trace viewer includes a **Share Trace** button that exports a self-contained HTML file. This file includes all session data and can be opened in any browser without a server — perfect for sharing with teammates, attaching to tickets, or archiving sessions.
176173

177174
## Remote Exporters
178175

179-
Recaps can be sent to remote backends via HTTP POST. Each exporter receives the full recap JSON on session completion.
176+
Traces can be sent to remote backends via HTTP POST. Each exporter receives the full trace JSON on session completion.
180177

181178
```json
182179
{
@@ -197,7 +194,7 @@ Recaps can be sent to remote backends via HTTP POST. Each exporter receives the
197194
| Field | Type | Description |
198195
|-------|------|-------------|
199196
| `name` | `string` | Identifier for this exporter (used in logs) |
200-
| `endpoint` | `string` | HTTP endpoint to POST recap JSON to |
197+
| `endpoint` | `string` | HTTP endpoint to POST trace JSON to |
201198
| `headers` | `object` | Custom headers (e.g., auth tokens) |
202199

203200
**How it works:**
@@ -208,9 +205,9 @@ Recaps can be sent to remote backends via HTTP POST. Each exporter receives the
208205
- Exporters have a 10-second timeout
209206
- All export operations are best-effort and never crash the CLI
210207

211-
## Recap File Format
208+
## Trace File Format
212209

213-
Recaps are stored as JSON files in the traces directory. The schema is versioned for forward compatibility.
210+
Traces are stored as JSON files in the traces directory. The schema is versioned for forward compatibility.
214211

215212
```json
216213
{
@@ -322,15 +319,15 @@ All domain-specific attributes use the `de.*` prefix and are stored in the `attr
322319

323320
## Crash Recovery
324321

325-
Recaps are designed to survive process crashes:
322+
Traces are designed to survive process crashes:
326323

327-
1. **Immediate snapshot.** A recap file is written as soon as the session starts, before any LLM interaction. Even if the process crashes immediately, a minimal recap file exists.
324+
1. **Immediate snapshot.** A trace file is written as soon as the session starts, before any LLM interaction. Even if the process crashes immediately, a minimal trace file exists.
328325

329-
2. **Incremental snapshots.** After every tool call and generation completion, the recap file is updated atomically (write to temp file, then rename). The file on disk always contains a valid, complete JSON document.
326+
2. **Incremental snapshots.** After every tool call and generation completion, the trace file is updated atomically (write to temp file, then rename). The file on disk always contains a valid, complete JSON document.
330327

331-
3. **Crash handlers.** The `run` command registers `SIGINT`/`SIGTERM`/`beforeExit` handlers that flush the recap synchronously with a `"crashed"` status.
328+
3. **Crash handlers.** The `run` command registers `SIGINT`/`SIGTERM`/`beforeExit` handlers that flush the trace synchronously with a `"crashed"` status.
332329

333-
4. **Status indicators.** Recap status tells you exactly what happened:
330+
4. **Status indicators.** Trace status tells you exactly what happened:
334331

335332
| Status | Meaning |
336333
|--------|---------|
@@ -339,31 +336,31 @@ Recaps are designed to survive process crashes:
339336
| `running` | Session is still in progress (visible in live mode) |
340337
| `crashed` | Process was interrupted before the session completed |
341338

342-
Crashed recaps contain all data up to the last successful snapshot. You can view them normally with `altimate-code recap view`.
339+
Crashed traces contain all data up to the last successful snapshot. You can view them normally with `altimate-code trace view`.
343340

344-
## Historical Recaps
341+
## Historical Traces
345342

346-
All recaps are stored in the traces directory and persist across sessions. Use `recap list` to browse history:
343+
All traces are stored in the traces directory and persist across sessions. Use `trace list` to browse history:
347344

348345
```bash
349-
# Show the last 50 recaps
350-
altimate-code recap list -n 50
346+
# Show the last 50 traces
347+
altimate-code trace list -n 50
351348

352-
# View any historical recap
353-
altimate-code recap view <session-id>
349+
# View any historical trace
350+
altimate-code trace view <session-id>
354351
```
355352

356-
Recaps are automatically pruned when `maxFiles` is exceeded (default: 100). The oldest recaps are removed first. Set `maxFiles: 0` for unlimited retention.
353+
Traces are automatically pruned when `maxFiles` is exceeded (default: 100). The oldest traces are removed first. Set `maxFiles: 0` for unlimited retention.
357354

358355
## Privacy
359356

360-
Recaps are stored **locally only** by default. They contain:
357+
Traces are stored **locally only** by default. They contain:
361358

362359
- The prompt you sent
363360
- Tool inputs and outputs (SQL queries, file contents, command results)
364361
- Model responses
365362

366-
If you configure remote exporters, recap data is sent to those endpoints. No recap data is included in the anonymous telemetry described in [Telemetry](../reference/telemetry.md).
363+
If you configure remote exporters, trace data is sent to those endpoints. No trace data is included in the anonymous telemetry described in [Telemetry](../reference/telemetry.md).
367364

368365
!!! warning "Sensitive Data"
369-
Recaps may contain SQL queries, file paths, and command outputs from your session. If you share recap files or configure remote exporters, be aware that this data will be included.
366+
Traces may contain SQL queries, file paths, and command outputs from your session. If you share trace files or configure remote exporters, be aware that this data will be included.

docs/docs/data-engineering/guides/ci-headless.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,16 @@ fi
137137

138138
---
139139

140-
## Recap in Headless Mode
140+
## Traces in Headless Mode
141141

142-
Recap works in headless mode. View recaps after the run:
142+
Tracing works in headless mode. View traces (session recordings) after the run:
143143

144144
```bash
145-
altimate recap list
146-
altimate recap view <session-id>
145+
altimate trace list
146+
altimate trace view <session-id>
147147
```
148148

149-
See [Recap](../../configure/recap.md) for the full recap reference.
149+
See [Trace](../../configure/trace.md) for the full trace reference.
150150

151151
---
152152

docs/docs/usage/ci-headless.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,16 @@ fi
137137

138138
---
139139

140-
## Recap in Headless Mode
140+
## Traces in Headless Mode
141141

142-
Recap works in headless mode. View recaps after the run:
142+
Tracing works in headless mode. View traces (session recordings) after the run:
143143

144144
```bash
145-
altimate recap list
146-
altimate recap view <session-id>
145+
altimate trace list
146+
altimate trace view <session-id>
147147
```
148148

149-
See [Recap](../configure/recap.md) for the full recap reference.
149+
See [Trace](../configure/trace.md) for the full trace reference.
150150

151151
---
152152

docs/docs/usage/cli.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ altimate --agent analyst
3333
| `export` | Export session data |
3434
| `import` | Import session data |
3535
| `session` | Session management |
36-
| `recap` | List and view session recaps (formerly `trace`) |
36+
| `trace` | List and view session traces (recordings of agent sessions) |
3737
| `github` | GitHub integration |
3838
| `pr` | Pull request tools |
3939
| `upgrade` | Upgrade to latest version |
@@ -149,22 +149,20 @@ altimate run --model anthropic/claude-sonnet-4-6 "optimize my warehouse"
149149
# Print logs for debugging
150150
altimate --print-logs --log-level DEBUG run "test query"
151151

152-
# Disable recap for a single run (--no-trace is the backward-compatible flag name)
152+
# Disable tracing for a single run
153153
altimate run --no-trace "quick question"
154154
```
155155

156156
For CI pipelines and headless automation, see [CI & Automation](ci-headless.md).
157157

158-
## Recap
158+
## Trace
159159

160-
Every `run` command automatically saves a recap file with the full session details, including generations, tool calls, tokens, cost, and timing. See [Recap](../configure/recap.md) for configuration options.
160+
Every `run` command automatically saves a trace file (a recording of the agent session) with the full session details, including generations, tool calls, tokens, cost, and timing. See [Trace](../configure/trace.md) for configuration options.
161161

162162
```bash
163-
# List recent recaps
164-
altimate recap list
163+
# List recent traces
164+
altimate trace list
165165

166-
# View a recap in the browser
167-
altimate recap view <session-id>
166+
# View a trace in the browser
167+
altimate trace view <session-id>
168168
```
169-
170-
> **Note:** The `trace` command still works as a backward-compatible alias for `recap`.

docs/docs/usage/tui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The TUI has three main areas:
2020
|--------|--------|---------|
2121
| `@` | Reference a file | `@src/models/user.sql explain this model` |
2222
| `!` | Run a shell command | `!dbt run --select my_model` |
23-
| `/` | Slash command | `/discover`, `/connect`, `/review`, `/models`, `/theme`, `/recap` |
23+
| `/` | Slash command | `/discover`, `/connect`, `/review`, `/models`, `/theme`, `/trace` |
2424

2525
## Leader Key
2626

docs/mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ nav:
9797
- Custom Tools: configure/tools/custom.md
9898
- Skills: configure/skills.md
9999
- Commands: configure/commands.md
100-
- Recap: configure/recap.md
100+
- Trace: configure/trace.md
101101
- Interfaces:
102102
- TUI: usage/tui.md
103103
- CLI: usage/cli.md

0 commit comments

Comments
 (0)