@raytrace-cli/cli 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,178 +2,441 @@
2
2
 
3
3
  **See what your coding agent actually did.**
4
4
 
5
- [ npm package ](https://www.npmjs.com/package/@raytrace-cli/cli) ·
6
- [ Quick start ](#quick-start) · [ Cloud sandboxes ](#cloud-sandboxes-preview) ·
7
- [ Editor (MCP) ](#use-from-your-editor-mcp) ·
8
- [ Local sandboxes ](#local-sandboxes) ·
9
- [ Privacy ](#privacy) · [ Report an issue ](https://github.com/Godcreatebugs/raytrace-cli/issues)
10
-
11
- Your agent finished the task. Which files did it read? What commands did it run?
12
- Where did the tokens and money go?
13
-
14
- RayTrace turns Claude Code and Codex sessions into a dashboard you can explore:
15
- prompts, answers, tool calls, cost, and captured context. Run your agent in a
16
- RayTrace cloud sandbox and review every session with your team.
5
+ [npm package](https://www.npmjs.com/package/@raytrace-cli/cli) ·
6
+ [Set up in your editor (MCP)](#set-up-in-your-editor-mcp) ·
7
+ [Local sandboxes](#local-sandboxes) ·
8
+ [Cloud sandboxes](#cloud-sandboxes) ·
9
+ [What you can do](#what-you-can-do-with-a-recorded-session) ·
10
+ [Commands](#commands) ·
11
+ [Report an issue](https://github.com/Godcreatebugs/raytrace-cli/issues)
12
+
13
+ Your agent finished the task. Which files did it read? What commands did it
14
+ run? Where did the tokens and money go?
15
+
16
+ RayTrace runs Claude Code or Codex in a **sandbox**, an isolated copy of your
17
+ project, and records everything that happens there: your prompts, the agent's
18
+ answers and tool calls, and every command that actually ran, with its exit code
19
+ and network connections. You explore it all in a dashboard.
17
20
 
18
21
  ![RayTrace tool-call timeline showing commands, reported results, cost, time, and token usage](https://raw.githubusercontent.com/Godcreatebugs/raytrace-cli/main/docs/images/tool-calls.jpg)
19
22
 
20
23
  *One real coding task: 50 model round trips, 58 tool calls, and a command-by-command record.*
21
24
 
22
- - **Follow the work.** Open a prompt and trace the steps that led to its answer.
23
- - **Inspect the evidence.** Expand tool calls to see commands and their reported output.
24
- - **Understand the cost.** See model, token usage, time, and cost when available.
25
- - **Explore the context.** Review earlier conversation and files brought into the task.
25
+ ## Pick how you want to use it
26
+
27
+ | | Where it runs | Account | Best for |
28
+ |---|---|---|---|
29
+ | **[From your editor (MCP)](#set-up-in-your-editor-mcp)** | local or cloud, you choose per sandbox | only for cloud | asking your agent "put this repo in a sandbox and open it" |
30
+ | **[Local sandbox](#local-sandboxes)** | a Linux VM on your machine | none | keeping your code on your machine; free and open source |
31
+ | **[Cloud sandbox](#cloud-sandboxes)** | RayTrace's servers | yes | sharing sessions with your team at [app.raytracer.si](https://app.raytracer.si) |
32
+
33
+ All three need **Node.js 22.13 or newer** (`node --version`) on macOS or Linux.
34
+ Windows is experimental.
26
35
 
27
- ## Quick start
36
+ ---
28
37
 
29
- You need **Node.js 22.13 or newer** (`node --version`). macOS and Linux are
30
- supported. To keep your project on your own machine instead, see
31
- [Local sandboxes](#local-sandboxes).
38
+ ## Set up in your editor (MCP)
39
+
40
+ `raytrace mcp` is an [MCP](https://modelcontextprotocol.io) server. Add it to
41
+ your editor once, and your agent can create, open, stop and destroy sandboxes
42
+ for you. There is nothing to install first: `npx` downloads the CLI on first use.
43
+
44
+ ### 1. Add the server
45
+
46
+ **Claude Code.** One command, then restart Claude Code. `--scope user` makes it
47
+ available in every project:
32
48
 
33
49
  ```sh
34
- npm install -g @raytrace-cli/cli
35
- raytrace auth login # opens your browser: sign in, or create your account
36
- cd your-project # any Git repository
37
- raytrace sandbox create # uploads it to a new cloud sandbox and prints its id
38
- raytrace connect <sandbox-id> # a terminal in the sandbox: run claude or codex there
50
+ claude mcp add --scope user raytrace -- npx -y @raytrace-cli/cli@latest mcp
39
51
  ```
40
52
 
41
- `auth login` prints a short code and opens the sign-in page. New here? Create
42
- your account on that page, approve the code, and come back to the terminal.
43
-
44
- Then open **[app.raytracer.si](https://app.raytracer.si)** to review the
45
- session with your team: prompts, tool calls, and the commands that actually
46
- ran. You can also create the sandbox there, by dropping a project folder on the
47
- Sandboxes page. RayTrace asks you for no API key. See
48
- [Cloud sandboxes](#cloud-sandboxes-preview) for what is uploaded and the limits.
49
-
50
- ## Cloud sandboxes (preview)
51
-
52
- A cloud sandbox is an isolated copy of your project on RayTrace's servers, with
53
- a terminal you open from your machine. Run Claude Code or Codex inside it: what
54
- the agent asked, the tool calls it made, and the commands that actually ran are
55
- recorded for your organization.
56
-
57
- The [quick start](#quick-start) has the commands. If you skip `raytrace auth
58
- login`, `raytrace sandbox create` and `raytrace connect` start the same sign-in
59
- first. With one sandbox, `raytrace connect` works without the id.
60
-
61
- At **[app.raytracer.si](https://app.raytracer.si)**, sign in with the same
62
- account to see your organization's prompts, sandboxes and tool calls. A sandbox
63
- created there shows the command to open it, `raytrace connect <sandbox-id>`.
64
- Sandboxes belong to the account that made them: `raytrace auth status` says
65
- which one the CLI is using.
66
-
67
- - **What is uploaded:** the files Git would track in the repository (including
68
- new files it does not ignore), without `.git`, dependencies such as
69
- `node_modules`, build output, `.env*` files, private keys (`.pem`, `.key`,
70
- `.p12`, `.pfx`) and common credential files (`.npmrc`, `.netrc`, `id_rsa`, …).
71
- Review your project for secrets inside other files before you upload.
72
- - **Limits:** a project may be up to 200 MiB and 20,000 files, each file up to
73
- 25 MiB (100 MiB once packed). A project over a limit is refused, with the
74
- files named, and nothing is uploaded; add them to `.gitignore`. You can have
75
- three sandboxes at a time.
76
- - **Signing in to your agent:** sign in to Claude Code inside the sandbox as
77
- you would on your machine. That sign-in stays in the sandbox until you
78
- destroy it.
79
- - **When you are done:** `raytrace sandbox stop` keeps the files;
80
- `raytrace sandbox destroy` deletes them and any sign-in made inside. The
81
- recorded sessions are kept for your organization.
82
-
83
- Cloud sandboxes are a preview and may change; please
84
- [report issues](https://github.com/Godcreatebugs/raytrace-cli/issues) you run into.
85
-
86
- ## Use from your editor (MCP)
87
-
88
- `raytrace mcp` is an [MCP](https://modelcontextprotocol.io) server, so the agent
89
- in VS Code, Cursor, Claude Code or any MCP client can create and manage cloud
90
- sandboxes for you: "put this project in a sandbox", "stop my sandbox",
91
- "destroy rtp-…". Nothing to install first; `npx` fetches the CLI.
92
-
93
- - **Claude Code:** `claude mcp add raytrace -- npx -y @raytrace-cli/cli mcp`
94
- - **VS Code** (`.vscode/mcp.json`):
95
- ```json
96
- { "servers": { "raytrace": { "command": "npx", "args": ["-y", "@raytrace-cli/cli", "mcp"] } } }
97
- ```
98
- - **Cursor** (`~/.cursor/mcp.json`) and most other clients:
99
- ```json
100
- { "mcpServers": { "raytrace": { "command": "npx", "args": ["-y", "@raytrace-cli/cli", "mcp"] } } }
101
- ```
102
-
103
- Tools: `login`, `create_sandbox`, `list_sandboxes`, `sandbox_status`,
104
- `start_sandbox`, `stop_sandbox`, `destroy_sandbox`. The first time, the agent
105
- calls `login` and shows you a code to approve in the browser; it is the same
106
- sign-in as `raytrace auth login`. `create_sandbox` uploads the Git project open
107
- in your editor, with the same rules and limits as `raytrace sandbox create`.
108
- `destroy_sandbox` deletes the sandbox's traces too unless the agent passes
109
- `keep_traces` (paid plans), as `raytrace sandbox destroy --yes` does. To work
110
- inside a sandbox, run `raytrace connect <id>` in a terminal. Local sandboxes
111
- stay terminal-only for now.
53
+ Check it with `claude mcp list`, which should show `raytrace` as connected.
54
+
55
+ **Cursor.** Add to `~/.cursor/mcp.json` (every project) or `.cursor/mcp.json` (one project):
56
+
57
+ ```json
58
+ {
59
+ "mcpServers": {
60
+ "raytrace": { "command": "npx", "args": ["-y", "@raytrace-cli/cli@latest", "mcp"] }
61
+ }
62
+ }
63
+ ```
64
+
65
+ **VS Code.** Add to `.vscode/mcp.json` in the project, or run **MCP: Open User
66
+ Configuration** from the command palette for every project:
67
+
68
+ ```json
69
+ {
70
+ "servers": {
71
+ "raytrace": { "command": "npx", "args": ["-y", "@raytrace-cli/cli@latest", "mcp"] }
72
+ }
73
+ }
74
+ ```
75
+
76
+ **Codex.** `codex mcp add raytrace -- npx -y @raytrace-cli/cli@latest mcp`
77
+
78
+ **Any other MCP client.** Run the command `npx` with the arguments
79
+ `-y @raytrace-cli/cli@latest mcp`, over stdio. Most clients use the same
80
+ `mcpServers` JSON as Cursor.
81
+
82
+ > Already have the CLI installed globally? You can use `raytrace mcp` as the
83
+ > command instead of `npx`.
84
+
85
+ ### 2. Ask for a sandbox
86
+
87
+ Open a Git project in your editor and ask your agent in plain words:
88
+
89
+ | You say | What happens |
90
+ |---|---|
91
+ | "Create a local sandbox and connect this repo" | a sandbox on your machine, then a terminal opens with Claude Code running in it |
92
+ | "Put this project in a cloud sandbox" | uploads the repo to RayTrace's cloud, then opens a terminal with Claude Code in it |
93
+ | "Open my sandbox with Codex" | a terminal connected to an existing sandbox, with Codex running in it |
94
+ | "List my sandboxes" / "Stop demo-box" / "Destroy it" | manages them; the agent asks you before it destroys anything |
95
+ | "Run `npm test` in the sandbox" | runs a command in a cloud sandbox and reports the result back in the chat |
96
+
97
+ **The first time:**
98
+
99
+ - **Cloud sandboxes** need a RayTrace sign-in. The agent shows you a short code
100
+ and opens a browser page. Approve it there (or create your account), and the
101
+ agent carries on. Local sandboxes need no account.
102
+ - **The first local sandbox** sets up a Linux VM, which takes a few minutes. If
103
+ [Lima](https://lima-vm.io) is missing, the agent asks before downloading it.
104
+ See [what you need](#what-you-need).
105
+ - **In each new sandbox**, Claude Code or Codex asks you to sign in to your
106
+ Anthropic or OpenAI account, as it would on your machine.
107
+ - **On macOS**, the first time a terminal is opened for you, macOS asks whether
108
+ your editor may control your terminal app. Allow it.
109
+
110
+ ### 3. Work in the sandbox
111
+
112
+ The terminal opens where you work: a new tmux window if you're in tmux, a new
113
+ iTerm window or WezTerm tab, otherwise a new Terminal window on macOS (VS Code's
114
+ built-in terminal can't be opened from outside), your desktop's terminal on
115
+ Linux, or Windows Terminal. If none can be opened, the agent gives you the
116
+ command to paste instead, such as `raytrace connect demo-box --claude`.
117
+
118
+ Inside, the agent runs **without approval prompts**. The sandbox is what keeps
119
+ it contained, so there's no need to approve every command, and everything it
120
+ does is recorded. See [Working in a sandbox](#working-in-a-sandbox).
121
+
122
+ ### MCP tools reference
123
+
124
+ | Tool | What it does |
125
+ |---|---|
126
+ | `login` | signs in to RayTrace (cloud only): shows a code to approve in the browser |
127
+ | `create_sandbox` | copies the open Git project into a new sandbox. `local: true` for one on your machine, `agent: "codex"` to open it with Codex, `connect: false` to skip opening a terminal |
128
+ | `connect_sandbox` | opens a terminal in an existing sandbox with Claude Code (default), Codex (`agent: "codex"`) or a plain shell (`agent: "none"`); starts it first if it's stopped |
129
+ | `list_sandboxes`, `sandbox_status` | your local and cloud sandboxes, and one sandbox's details or creation progress |
130
+ | `start_sandbox`, `stop_sandbox` | stopping keeps the files |
131
+ | `destroy_sandbox` | deletes a sandbox. Cloud: its traces go too, unless `keep_traces` (paid plans). Local: its logs are archived, unless `delete_logs` |
132
+ | `run_command`, `get_command_result`, `cancel_command` | run shell commands in a cloud sandbox from the chat: up to 4 at once, 120 s by default and at most 30 minutes, with the real exit code and output |
133
+
134
+ Local sandboxes are named by their name and cloud ones by their id (`rtp-…`).
135
+ Whatever a command prints is treated as data from your project, never as
136
+ instructions to the agent.
137
+
138
+ ---
112
139
 
113
140
  ## Local sandboxes
114
141
 
115
- Prefer to keep your project on your own machine? Run the same sandbox locally.
116
- It is open source and needs no RayTrace account.
142
+ Run the sandbox on your own machine. Your project is copied into it, and nothing
143
+ is uploaded. It is open source and needs no RayTrace account.
144
+
145
+ ### What you need
146
+
147
+ | | Requirement |
148
+ |---|---|
149
+ | **macOS 13.5 or later** | Nothing to install. RayTrace uses your [Lima](https://lima-vm.io) 2.0+ if you have it, or offers to download Lima into `~/.raytrace/lima` (no admin rights; checked against a pinned checksum) |
150
+ | **Older macOS** | QEMU too: `brew install qemu` |
151
+ | **Linux** | Lima, QEMU, and access to `/dev/kvm` (`sudo usermod -aG kvm $USER`, then log out and in) |
152
+ | **Windows** | experimental; RayTrace doesn't download Lima there |
153
+ | **Disk and memory** | the first setup downloads about 1 GB; the VM uses 4 GiB of memory while it runs |
154
+
155
+ `raytrace doctor` checks all of this and says how to fix anything missing.
156
+
157
+ ### Set it up
158
+
159
+ ```sh
160
+ npm install -g @raytrace-cli/cli
161
+
162
+ cd your-project # any Git repository
163
+ raytrace sandbox create --local # first time: sets up the VM, a few minutes
164
+ raytrace connect your-project --claude # a terminal in it, with Claude Code running
165
+ ```
166
+
167
+ - The sandbox is named after the folder. Use `--name my-box` to choose the name.
168
+ - Use `--codex` instead of `--claude` to start Codex, or leave both off for a
169
+ plain shell where you run `claude` or `codex` yourself.
170
+ - `connect` prints a link to the dashboard showing only this sandbox's prompts.
171
+ `raytrace open` opens the full dashboard.
172
+
173
+ Or skip the commands and ask your editor's agent:
174
+ [set up MCP](#set-up-in-your-editor-mcp), then say "create a local sandbox and
175
+ connect this repo".
176
+
177
+ ### Day to day
117
178
 
118
179
  ```sh
119
- cd your-project
120
- raytrace sandbox create --local --name my-box # first run sets up a Linux VM; a few minutes
121
- raytrace connect my-box # a terminal in it: run claude there
122
- raytrace sandbox destroy my-box # asks whether to delete its logs too
180
+ raytrace sandbox list --local # your local sandboxes
181
+ raytrace connect my-box --claude # back in; the sandbox keeps running when you leave
182
+ raytrace sandbox stop my-box # stop it; its files are kept
183
+ raytrace sandbox start my-box
184
+ raytrace sandbox destroy my-box # asks whether to delete its captured logs too
185
+ limactl stop raytrace # stop the whole VM to free its 4 GiB of memory
123
186
  ```
124
187
 
125
- - **How it runs:** a Linux VM made with [Lima](https://lima-vm.io), and inside
126
- it each sandbox in a Docker container under [gVisor](https://gvisor.dev),
127
- with no access to your machine's files or private networks. A copy of the
128
- project goes in, picked the same way as for a cloud sandbox; your own files
129
- are never changed. `--name` defaults to the repository folder's name.
130
- - **What is recorded:** the commands, file changes and network connections the
131
- sandbox makes, by a collector outside it that the agent cannot turn off,
132
- and its Claude Code sessions. All of it is in your local dashboard
133
- (`raytrace open`): **Sandboxes** lists each sandbox with its prompts, and
134
- **Sandbox evidence** shows, for one prompt, every command that actually ran,
135
- its exit code and what it reached on the network, each joined to the tool
136
- call that ran it. The raw collector feed is at `/raytace/viewer/` on the
137
- dashboard's address.
138
- Nothing leaves your machine.
139
- - **Changes:** the sandbox's Claude Code hook snapshots the project after
140
- every edit, so **Changes** shows what each prompt left different, file by
141
- file, with a patch to take home.
142
- - **Playground:** rerun a session from any step with part of it changed (a
143
- tool result, a file, the model, the message) and compare where it ends up,
144
- optionally with a check command such as `npm test` as pass or fail. Each
145
- rerun is a fork: a sandbox of its own in the VM, started from the snapshot
146
- just before that step, running Claude Code on the sign-in you made in the
147
- sandbox (so it uses your Claude account). The newest fork is kept, stopped,
148
- for a day; destroying a sandbox destroys its forks.
149
- - **Signing in to your agent:** run `claude` inside the sandbox and sign in.
150
- RayTrace passes no key in. The sign-in stays in the sandbox until you destroy it.
151
- - **Destroying it:** `raytrace sandbox destroy <name>` deletes the sandbox and
152
- asks whether to delete the logs captured in it as well. Yes deletes them
153
- everywhere, dashboard included, Playground forks too. No moves them to
154
- `~/.raytrace/archive/<name>-<time>/` (Claude Code transcripts, its forks'
155
- under `forks/`, and the recorded commands, files and connections as JSON
156
- lines), and its sessions stay in your dashboard. `--delete-logs` or `--keep-logs` answers without
157
- asking.
158
- - **What you need:** nothing to install on macOS 13.5 or later. RayTrace
159
- uses [Lima](https://lima-vm.io) for the VM: yours if you have Lima 2.0 or
160
- later, otherwise it offers to download Lima's own release into
161
- `~/.raytrace/lima` (no admin rights; checked against a pinned checksum).
162
- Docker, gVisor and the agents are installed inside the VM, not on your
163
- machine. On Linux, also QEMU and access to `/dev/kvm`. On macOS before
164
- 13.5, QEMU (`brew install qemu`). `raytrace doctor` shows what is missing,
165
- and `create --local` says so before it starts. First run downloads about
166
- 1 GB (Lima, Ubuntu, packages); the VM uses 4 GiB of memory while it runs.
167
- - **Platforms:** macOS and Linux. Windows is experimental: Lima's Windows
168
- support is itself experimental, and RayTrace does not download Lima there.
169
- - **The VM:** `limactl stop raytrace` frees its memory; `limactl delete
170
- raytrace` removes it.
171
-
172
- ## AI features, on your own key
173
-
174
- The dashboard records and shows everything above without any key. A few
175
- views can also ask a model to explain a run; locally they use **your own
176
- OpenRouter key**, and the calls are billed to your OpenRouter account.
188
+ When you destroy a sandbox, you're asked what to do with its logs:
189
+
190
+ - **Yes** deletes them everywhere, the dashboard and Playground forks included.
191
+ - **No** moves them to `~/.raytrace/archive/<name>-<time>/`: the agent
192
+ transcripts, the recorded commands, files and connections as JSON lines, and
193
+ any forks. Its sessions stay in your dashboard.
194
+
195
+ `--delete-logs` or `--keep-logs` answers without asking. To keep the logs in the
196
+ cloud, `raytrace upload logs --sandbox my-box` sends them to
197
+ [app.raytracer.si](https://app.raytracer.si) (needs a sign-in).
198
+
199
+ ### How it works
200
+
201
+ - **Isolation:** each sandbox is a Docker container under
202
+ [gVisor](https://gvisor.dev), inside a Linux VM made with
203
+ [Lima](https://lima-vm.io). It can't see your machine's files or private
204
+ networks. A copy of your project goes in (picked the same way as for
205
+ [cloud uploads](#what-is-uploaded)); your own files are never changed.
206
+ - **Resources:** each sandbox gets 2 GB of memory, 2 CPUs, 256 processes and a
207
+ 512 MB `/tmp`. All sandboxes share the VM's 30 GiB disk.
208
+ - **Recording:** a collector outside the sandbox, which the agent can't turn
209
+ off, records every command, file change and network connection. Claude Code's
210
+ prompts, answers and tool calls go to your local dashboard as well. Nothing
211
+ leaves your machine.
212
+ - **Changes:** the project is snapshotted after every edit, so **Changes** in
213
+ the dashboard shows what each prompt left different, with a patch to take home.
214
+ - **Playground:** rerun a session from any step with something changed (a tool
215
+ result, a file, the model or the message) and compare the outcomes,
216
+ optionally with a check such as `npm test`. Each rerun is a fork, a sandbox
217
+ of its own started from the snapshot just before that step.
218
+
219
+ ---
220
+
221
+ ## Cloud sandboxes
222
+
223
+ A cloud sandbox is the same isolated copy of your project, on RayTrace's
224
+ servers, with sessions recorded for your organization at
225
+ **[app.raytracer.si](https://app.raytracer.si)**. This is a preview.
226
+
227
+ ```sh
228
+ npm install -g @raytrace-cli/cli
229
+ raytrace auth login # opens your browser: sign in, or create your account
230
+ cd your-project # any Git repository
231
+ raytrace sandbox create # uploads it and prints the sandbox id
232
+ raytrace connect <sandbox-id> --claude # a terminal in it, with Claude Code running
233
+ ```
234
+
235
+ `auth login` prints a short code and opens the sign-in page; approve it there.
236
+ If you skip it, `sandbox create` and `connect` ask you to sign in first. With
237
+ one sandbox, `connect` needs no id. You can also create a sandbox in the web
238
+ dashboard by dropping a project folder on the **Sandboxes** page.
239
+
240
+ ### What is uploaded
241
+
242
+ The files Git would track (including new files it doesn't ignore), **without**
243
+ `.git`, dependencies such as `node_modules`, build output, `.env*` files, private
244
+ keys (`.pem`, `.key`, `.p12`, `.pfx`) and common credential files (`.npmrc`,
245
+ `.netrc`, `id_rsa`, …). Check for secrets inside other files before you upload.
246
+
247
+ ### Limits
248
+
249
+ - **Project size:** up to 200 MiB and 20,000 files, each file up to 25 MiB
250
+ (100 MiB once packed). A project over a limit is refused, with the files
251
+ named, and nothing is uploaded; add those files to `.gitignore`.
252
+ - **Sandboxes at a time:** Beta 1, Individual 5, Team & Enterprise 20.
253
+ Destroyed ones don't count.
254
+ - **Each sandbox:** 2 GB of memory, 2 CPUs, 256 processes, a 512 MB `/tmp`.
255
+
256
+ ### When you are done
257
+
258
+ `raytrace sandbox stop` keeps the files. `raytrace sandbox destroy` deletes them
259
+ and any sign-in made inside, along with the recorded traces. To keep the traces,
260
+ use `--keep-traces` (paid plans).
261
+
262
+ ---
263
+
264
+ ## Working in a sandbox
265
+
266
+ - **Claude Code and Codex are preinstalled** in every sandbox, local and cloud.
267
+ - **No approval prompts.** `--claude` starts Claude Code with
268
+ `--dangerously-skip-permissions`, and `--codex` starts Codex with
269
+ `--dangerously-bypass-approvals-and-sandbox`. The sandbox's own settings, which
270
+ the agent can't change, make this the default too, so typing `claude` or
271
+ `codex` yourself works the same way. The sandbox is what keeps the agent
272
+ contained, and every command is recorded.
273
+ - **Restricted files stay locked.** Files a project's owner restricts in the
274
+ dashboard (**Initial scan**) can't be changed by the agent, whatever it tries.
275
+ - **Signing in:** sign in to Claude Code or Codex inside the sandbox, as you
276
+ would on your machine. The sign-in stays in that sandbox until you destroy it.
277
+ - **Leaving:** exiting the agent drops you into the sandbox's shell, and exiting
278
+ that leaves the sandbox running. `raytrace connect` takes you back.
279
+
280
+ In local sandboxes, Codex's prompts don't reach the dashboard's **Prompts** page
281
+ yet. Its commands, file changes and network connections are recorded.
282
+
283
+ ---
284
+
285
+ ## What you can do with a recorded session
286
+
287
+ Cloud sessions are at [app.raytracer.si](https://app.raytracer.si), and
288
+ `raytrace open` opens the same pages for your local sandboxes. Every page is
289
+ about one prompt, and they link to each other, so you can go from "what did I
290
+ ask" to "what actually ran" to "what if it had gone differently" in a couple of
291
+ clicks. The screenshots below are from the cloud dashboard, with a session in
292
+ the `raytrace-demo-shop` sandbox.
293
+
294
+ ### Prompts: what you asked, and what came back
295
+
296
+ ![The Prompts page: an activity calendar and the list of prompts, each tagged with where it ran, the model, tool calls and cost](https://raw.githubusercontent.com/Godcreatebugs/raytrace-cli/main/docs/images/prompts.jpg)
297
+
298
+ Every prompt you gave the agent, newest first, with an activity calendar on
299
+ top. Each row shows where it ran (Mac, local sandbox or cloud sandbox), the
300
+ model, how many tool calls it took and what it cost. Open one to read the
301
+ answer and a short recap of the run.
302
+
303
+ ![An opened prompt with its recap: what happened, probably why, and what is worth checking, with links to Tool calls, Sandbox evidence and Context](https://raw.githubusercontent.com/Godcreatebugs/raytrace-cli/main/docs/images/prompt-recap.jpg)
304
+
305
+ - **Find a session again:** click a day in the calendar, or add
306
+ `?box=<sandbox id>` to see a single sandbox's prompts.
307
+ - **Spot the expensive ones:** the cost and tool-call count are on every row.
308
+
309
+ ### Tool calls: how the agent got there
310
+
311
+ <!-- screenshot: the one at the top of this README (docs/images/tool-calls.jpg) -->
312
+
313
+ The path from your prompt to the answer: one divider for each round trip to the
314
+ model, one row for each tool call it proposed, with the command and what the
315
+ agent says came back, plus tokens, time and cost at each step.
316
+
317
+ - **Follow its reasoning step by step,** and see where it went in circles.
318
+ - **See where the tokens went:** which steps were the expensive ones.
319
+
320
+ ### Sandbox evidence: what actually ran
321
+
322
+ ![Sandbox evidence: each process the sandbox saw run, with its exit code, duration and severity, and a plain-English description](https://raw.githubusercontent.com/Godcreatebugs/raytrace-cli/main/docs/images/sandbox-evidence.jpg)
323
+
324
+ What the agent *says* it ran is in Tool calls. This page is what the sandbox
325
+ itself saw, recorded from outside the agent where it can't be turned off or
326
+ edited. You get every process in time order, with its real exit code, the files
327
+ it read or changed, where it connected and what it installed. Each process is
328
+ tied to the tool call that started it, and anything no tool call accounts for
329
+ shows up too.
330
+
331
+ - **Check the agent's claims:** "tests pass" against the real exit code.
332
+ - **Catch side effects:** a script that phoned home, a package you didn't ask
333
+ for, a file outside the task that got changed.
334
+
335
+ ### Changes: what the prompt left different
336
+
337
+ <!-- screenshot: docs/images/changes.png -->
338
+
339
+ Every file the prompt changed, with its diff, first for the whole prompt and
340
+ then step by step, so you see which tool call made which change. Download it all
341
+ as one patch and apply it to your own checkout.
342
+
343
+ - **Review the agent's work like a pull request,** before you take it.
344
+ - **Take the result home:** the sandbox works on a copy, and the patch brings
345
+ the changes back to your machine.
346
+
347
+ ### Context: what the model could see
348
+
349
+ <!-- screenshot: docs/images/context.png -->
350
+
351
+ What was in the model's context when it answered, in three parts:
352
+
353
+ - what you said earlier in the conversation;
354
+ - what the model brought in itself: its earlier answers, and the files it read,
355
+ with how much of each actually fit;
356
+ - what the agent's harness adds to every request.
357
+
358
+ Use it to:
359
+
360
+ - **Understand a wrong answer:** was the right file never read, or cut off?
361
+ - **Test a hunch:** "Rerun without this" on any file opens the Playground with
362
+ that file removed.
363
+
364
+ ### Playground: rerun it differently, and compare
365
+
366
+ ![The Playground: pick a step, change the message, files, check command or model, and run forks](https://raw.githubusercontent.com/Godcreatebugs/raytrace-cli/main/docs/images/playground.jpg)
367
+
368
+ Pick any step of a session and rerun from there with something changed: an
369
+ earlier tool result removed or edited, a file in the project, the model, or the
370
+ time limit. Each rerun is a fork, a sandbox of its own started from a snapshot
371
+ taken just before that step, running in parallel with the others. Add a check
372
+ such as `npm test` and every fork is graded pass or fail. Run a change several
373
+ times and you get its pass rate, cost and steps, next to the same step rerun
374
+ unchanged.
375
+
376
+ - **Find out what actually mattered:** would it still have broken the build
377
+ without that misleading test output?
378
+ - **Compare models on your own task:** same step, same files, a different model.
379
+ - **Compare outcomes side by side:** each fork's answer, steps and files next to
380
+ the original's.
381
+
382
+ ### Story and Chain of thought: why it did what it did
383
+
384
+ ![Chain of thought: a recap of the run, the likely reason for each step with its share, and what is worth checking](https://raw.githubusercontent.com/Godcreatebugs/raytrace-cli/main/docs/images/chain-of-thought.jpg)
385
+
386
+ **Story** is the short version of a long run. It shows a timeline of only the
387
+ steps that mattered, the single most consequential command pulled out at the
388
+ top, and for each step what the agent could see, what it proposed, what really
389
+ happened and what that led to.
390
+
391
+ **Chain of thought** takes each tool call and lists its likely causes among what
392
+ the agent could see: your request, an earlier result, its own plan, or the
393
+ project's instructions.
394
+
395
+ Both are worked out from the recording alone, with nothing rerun. Some parts
396
+ use [your own key](#ai-features-on-your-own-key).
397
+
398
+ - **Explain a run to someone else** without replaying all 60 steps.
399
+ - **Trace a bad decision back** to the result or instruction that caused it.
400
+
401
+ ### Search: across everything the agents did
402
+
403
+ <!-- screenshot: docs/images/search.png -->
404
+
405
+ Search every recorded session at once, failures first. Type free text, or use
406
+ filters such as `outcome:failed tool:Bash exit:>=1 file:.env`, and summarise
407
+ with a pipe: `| stats count by tool`. With no query, it shows the most common
408
+ failures lately.
409
+
410
+ - **Find patterns:** which commands fail most, and which sessions touched
411
+ `.env`.
412
+
413
+ ### Initial scan: guard the files that matter
414
+
415
+ ![Initial scan: every file of the project grouped by risk level, with counts of watched and restricted files](https://raw.githubusercontent.com/Godcreatebugs/raytrace-cli/main/docs/images/initial-scan.jpg)
416
+
417
+ When a project goes into a sandbox, every file is rated from 1 to 5 for how
418
+ risky it is to change, with the reason. Secrets, migrations and deploy
419
+ configuration rate highest. You can move any file up or down, choose which
420
+ files to be alerted about, and **restrict** files so the agent can't change them
421
+ at all, whatever it tries. **Alerts** lists what the agent did to those files:
422
+ changes, refused edits, reads, and commands that named them.
423
+
424
+ - **Let the agent work freely** while keeping your migrations and CI config
425
+ off-limits.
426
+
427
+ ![Initial scan alerts: watched files such as config/payment-keys.js being read, each seen by the kernel, with the tool that did it](https://raw.githubusercontent.com/Godcreatebugs/raytrace-cli/main/docs/images/initial-scan-alerts.jpg)
428
+ - **Get told** when it touches what you care about.
429
+
430
+ ### Sandboxes: where it all ran
431
+
432
+ Every sandbox, grouped by the machine it runs on, with what was asked in each.
433
+ Destroyed sandboxes stay listed, because their evidence outlives them.
434
+
435
+ ### AI features, on your own key
436
+
437
+ Everything above works without any key. A few views can also ask a model to
438
+ explain a run, using **your own OpenRouter key**, billed to your OpenRouter
439
+ account:
177
440
 
178
441
  ```sh
179
442
  raytrace key openrouter # paste your key from https://openrouter.ai/keys (not echoed)
@@ -186,155 +449,125 @@ raytrace key # which keys are set
186
449
  | Chain of thought: the likely reasons for each tool call | Chain of thought | `qwen/qwen3-coder` |
187
450
  | Step summaries, and plain-English lines for commands no rule describes | Tool calls, Sandbox evidence | `openai/gpt-oss-120b` |
188
451
 
189
- - **Without a key** those parts say so and everything else works: Story's key
190
- moments, Chain of thought's unranked reasons and the rule-based command
191
- descriptions need no model.
192
- - **Cost:** each answer is kept, so opening the same prompt again costs
193
- nothing. Nothing is sent until you open a view that needs it.
194
- - **What is sent:** to OpenRouter, the parts of the recorded run the feature
195
- reads (the prompt, tool calls and their results, commands). Nothing goes to
196
- RayTrace.
452
+ - **No key?** Those parts say so, and everything else works.
453
+ - **Cost:** each answer is kept, so opening the same prompt again is free.
454
+ Nothing is sent until you open a view that needs it.
455
+ - **What's sent:** only to OpenRouter, the parts of the run the feature reads.
456
+ Nothing goes to RayTrace.
197
457
  - **Other models:** set `RAYTACE_OBSERVER_MODEL` (recap),
198
458
  `RAYTACE_ATTRIBUTION_MODEL` (Chain of thought) or `RAYTACE_SUMMARY_MODEL`
199
459
  (summaries) in `~/.raytrace/config.env`, then `raytrace stop && raytrace start`.
200
- - **Optional, Jev ranking:** `raytrace key typesafe` adds a
201
- [TypeSafe](https://typesafe.ai) key, which ranks Chain of thought's reasons
202
- and rates how severe each command was. Without it the reasons are listed
203
- unranked and severity comes from rules.
460
+ - **Optional:** `raytrace key typesafe` adds a [TypeSafe](https://typesafe.ai)
461
+ key, which ranks Chain of thought's reasons and rates how severe each command
462
+ was.
204
463
  - `raytrace key openrouter --remove` removes a key.
205
464
 
465
+ ---
466
+
206
467
  ## Commands
207
468
 
208
469
  | Command | What it does |
209
470
  |---|---|
210
- | `raytrace sandbox create` | upload this Git repository to a new cloud sandbox; `--name <name>` |
211
- | `raytrace connect [id]` | open a terminal in a sandbox, signing in first if needed (also `raytrace sandbox shell [id]`) |
212
- | `raytrace sandbox list` | your cloud sandboxes |
213
- | `raytrace sandbox start\|stop [id]` | start or stop a sandbox; stopping keeps its files |
214
- | `raytrace sandbox destroy [id]` | delete a sandbox; its recorded sessions are kept |
215
- | `raytrace auth login` | sign in to RayTrace; `status`, `logout` |
216
- | `raytrace mcp` | MCP server on stdio for your editor's agent; see [Use from your editor](#use-from-your-editor-mcp) |
217
- | `raytrace --code <code>` | beta invite: redeem a code RayTrace gave you (signed in first) for one $10-credit sandbox; codes are single-use, are deleted on redemption, and expire after 3 days, as does the credit |
218
- | `raytrace sandbox create --local [--name <name>]` | the same sandbox in a Linux VM on this machine; offers to download Lima if needed (`--yes` skips the question) |
219
- | `raytrace sandbox list --local` | your local sandboxes; their names work with `connect`, `start`, `stop` and `destroy` |
220
- | `raytrace sandbox destroy <name> [--delete-logs \| --keep-logs]` | delete a local sandbox; asks whether its captured logs go too, or move to `~/.raytrace/archive` |
221
- | `raytrace export <trace-id> [--format json\|markdown] [--output <file>]` | export a recorded trace to terminal or owner-only file without running the proxy |
222
- | `raytrace doctor` | what this machine has and lacks, local sandboxes included |
223
- | `raytrace key [openrouter\|typesafe] [--remove]` | your keys for the dashboard's AI features; asked for, never taken as an argument |
471
+ | `raytrace mcp` | the MCP server for your editor; see [Set up in your editor](#set-up-in-your-editor-mcp) |
472
+ | `raytrace sandbox create [--local] [--name <name>]` | copy this Git repository into a new sandbox, in the cloud or (`--local`) on this machine |
473
+ | `raytrace connect [id or name] [--claude \| --codex]` | open a terminal in a sandbox, optionally with an agent running in it |
474
+ | `raytrace sandbox list [--local]` | your sandboxes |
475
+ | `raytrace sandbox start\|stop <id or name>` | start or stop one; stopping keeps its files |
476
+ | `raytrace sandbox destroy <id or name>` | delete one. Cloud: `--keep-traces` (paid plans). Local: `--delete-logs` or `--keep-logs` |
477
+ | `raytrace open` | open the local dashboard |
478
+ | `raytrace auth login\|status\|logout` | your RayTrace sign-in, for cloud sandboxes |
479
+ | `raytrace upload logs [--sandbox <name>]` | send a local sandbox's recorded logs to the cloud dashboard; `raytrace upload status` shows your storage |
480
+ | `raytrace share <trace-id> [--fork]` | a time-limited link to one recorded prompt; `--list`, `--revoke <share-id>` |
481
+ | `raytrace export <trace-id> [--format json\|markdown] [--output <file>]` | export a recorded prompt to the terminal or a file, even with RayTrace stopped |
482
+ | `raytrace --code <code>` | redeem a beta invite code |
483
+ | `raytrace key [openrouter\|typesafe] [--remove]` | your keys for the dashboard's AI features |
484
+ | `raytrace doctor` | what this machine has and lacks |
485
+
486
+ `raytrace help` lists everything.
487
+
488
+ ---
224
489
 
225
490
  ## Beta invites
226
491
 
227
- If RayTrace gave you a beta code, sign in first, redeem it, then create your
228
- sandbox — in that order:
492
+ If RayTrace gave you a beta code, sign in, redeem it, then create your sandbox:
229
493
 
230
494
  ```sh
231
495
  raytrace auth login
232
- raytrace --code <code> # also: raytrace code <code>
496
+ raytrace --code <code>
233
497
  raytrace sandbox create
234
498
  ```
235
499
 
236
- Redeeming deletes the code on RayTrace's servers; it can never be used
237
- again, by anyone. Codes expire 3 days after they are issued, and the $10 of
238
- OpenRouter credit expires 3 days after you redeem it, so do not sit on
239
- either. Your account shows as **Beta** in the cloud dashboard until the
240
- credit ends, and the credited sandbox is tagged Beta there too. Connecting
241
- to a credited sandbox after its 3 days are up warns you that model calls
242
- will be refused; the sandbox itself still opens.
243
-
244
- Codes are minted only from the backend repo (`raytrace`:
245
- `python3 worker/gvisor/mint_beta_codes.py`, 10 at a time); this CLI never
246
- generates them.
247
-
248
- ## Exporting traces
249
-
250
- Export a recorded session directly from local evidence, even when RayTrace and the VM are stopped:
251
-
252
- ```sh
253
- # View trace in terminal as Markdown
254
- raytrace export <trace-id>
255
-
256
- # Export structured JSON
257
- raytrace export <trace-id> --format json
500
+ The code gives you one sandbox with $10 of model credit. Codes are single-use
501
+ and expire 3 days after they're issued, and the credit expires 3 days after you
502
+ redeem it. Your account and that sandbox show as **Beta** in the cloud dashboard
503
+ until then.
258
504
 
259
- # Save report to a file with owner-only (0600) permissions
260
- raytrace export <trace-id> --format markdown --output trace.md
261
- ```
505
+ ## Privacy
262
506
 
263
- Exported traces contain the full turn prompt, answer, tool calls, exit codes, and observed sandbox execution. Output files refuse to overwrite existing files to prevent accidental data loss.
507
+ - **Local sandboxes** keep everything on your machine, in `~/.raytrace`, readable
508
+ only by you. The local dashboard's API needs the token in
509
+ `~/.raytrace/api-token`, so other accounts on the machine can't read your
510
+ traces. `raytrace open` signs your browser in with a one-time link.
511
+ - **Cloud sandboxes** upload your project ([what is uploaded](#what-is-uploaded))
512
+ and record prompts, model requests and answers, tool calls and commands on
513
+ RayTrace's servers. Members of your organization can see them; other
514
+ organizations can't.
515
+ - **Your sign-in** is kept in the macOS Keychain or the Linux secret service (or a
516
+ file only you can read where neither exists). `raytrace auth logout` removes
517
+ it. Cloud commands ask you to sign in again after 2 days without cloud use.
264
518
 
265
- ## Privacy
519
+ ## Troubleshooting
266
520
 
267
- Local sandboxes keep everything on your machine. Cloud sandboxes run on
268
- RayTrace's servers.
269
-
270
- - `raytrace sandbox create` uploads your project (see
271
- [what is uploaded](#cloud-sandboxes-preview)) to RayTrace.
272
- - Inside a sandbox, the prompts, model requests and answers, tool calls and the
273
- commands that run are recorded on RayTrace's servers for your organization.
274
- Members of your organization can see them at app.raytracer.si; other
275
- organizations cannot.
276
- - `raytrace auth login` keeps your sign-in in the macOS Keychain or the Linux
277
- secret service (a file readable only by you where neither is available), and
278
- `raytrace auth logout` removes it. Cloud commands ask you to sign in again
279
- after 2 days with no cloud use (any cloud command resets that clock); the
280
- command then continues where it left off. Local recording never asks.
281
- - What RayTrace records locally stays in `~/.raytrace`, readable only by you.
282
- Its local API takes the token in `~/.raytrace/api-token`, so another account
283
- on the machine cannot read your traces or spend your OpenRouter key through
284
- it. `raytrace open` signs your browser in with a one-time link.
521
+ - **The MCP server doesn't show up in my editor:** restart the editor after
522
+ adding it. In Claude Code, `claude mcp list` shows whether it's connected.
523
+ Check that `node --version` is 22.13 or newer.
524
+ - **No terminal opened after "connect":** the agent's reply has the command to
525
+ paste, such as `raytrace connect my-box --claude`. On macOS, allow your editor
526
+ to control your terminal app in **System Settings → Privacy & Security →
527
+ Automation**.
528
+ - **The first local sandbox is taking long:** setting up the VM takes a few
529
+ minutes. Ask the agent for the sandbox status, or read
530
+ `~/.raytrace/logs/mcp-create-<name>-*.log`. The whole VM log is in
531
+ `~/.raytrace/logs/sandbox-vm.log`.
532
+ - **`sandbox create --local` says the machine isn't ready:** each line says
533
+ what's missing and how to fix it; `raytrace doctor` shows the same. Port 8798
534
+ in use usually means another Lima VM is running (`limactl list`).
535
+ - **A local sandbox's sessions don't show in the dashboard:** restart RayTrace
536
+ with `raytrace stop && raytrace start`.
537
+ - **The dashboard says this browser isn't signed in:** run `raytrace open`.
538
+ - **`Cannot reach RayTrace at https://api.raytracer.si`:** check your
539
+ connection. Networks that inspect HTTPS, such as some company Wi-Fi, can block
540
+ it.
541
+ - **A sandbox isn't found:** `raytrace auth status` shows which account you're
542
+ signed in as. Sandboxes belong to the account that made them.
285
543
 
286
544
  ## Uninstall
287
545
 
288
546
  ```sh
289
- raytrace sandbox destroy <sandbox-id> # any sandboxes you no longer need
547
+ raytrace sandbox destroy <id or name> # any sandboxes you no longer need
548
+ raytrace uninstall --purge # local sandboxes: deletes the VM and ~/.raytrace
290
549
  raytrace auth logout
291
550
  npm uninstall -g @raytrace-cli/cli
551
+ claude mcp remove raytrace -s user # if you added the MCP server to Claude Code
292
552
  ```
293
553
 
294
- Upgrading from 0.4 or earlier: the first start of the new version upgrades
295
- `~/.raytrace/evidence.db` in place (your recorded sessions are kept), and older
296
- versions cannot open it afterwards.
297
-
298
- With local sandboxes, run `raytrace uninstall --purge` before removing the
299
- package: it deletes the local sandbox VM and everything in `~/.raytrace`
300
- (recorded sessions, archived logs, and the Lima RayTrace downloaded). Without
301
- `--purge`, remove the VM yourself with `limactl delete --force raytrace`.
302
-
303
- If you set up local recording with an earlier version, run
304
- `raytrace uninstall` before removing the package so Claude Code is not left
305
- with a hook that points at a missing command.
306
-
307
- ## Troubleshooting
308
-
309
- - **`Cannot reach RayTrace at https://api.raytracer.si`:** check your
310
- connection. Networks that inspect HTTPS, such as some company Wi-Fi, can
311
- block it; try another network.
312
- - **Sign-in or sandbox creation fails:** run `raytrace auth status`, and
313
- `raytrace auth login` again if needed. Create the sandbox from inside a Git
314
- repository.
315
- - **A local sandbox's Claude Code sessions do not show in the dashboard:**
316
- RayTrace's proxy may be from before local sandboxes. Restart it:
317
- `raytrace stop && raytrace start`. `sandbox create --local` warns about this.
318
- - **The dashboard says this browser is not signed in:** run `raytrace open`.
319
- Each browser signs in once, for 30 days; a bookmark to the dashboard then
320
- keeps working.
321
- - **`sandbox create --local` says the machine is not ready:** each line names
322
- what is missing and how to fix it; `raytrace doctor` shows the same. Port
323
- 8798 in use usually means another Lima VM is running (`limactl list`).
324
- - **The VM fails to start or set up:** the last lines are shown; the whole
325
- log is in `~/.raytrace/logs/sandbox-vm.log`.
326
- - **`raytrace connect` asks for a sandbox id:** run `raytrace sandbox list` and
327
- pass the one you want. The id is optional only when you have one sandbox.
554
+ Without `--purge`, remove the VM yourself with `limactl delete --force raytrace`.
328
555
 
329
556
  ## Developing
330
557
 
331
558
  ```sh
332
559
  npm install
333
- npm run build # dashboard -> dist/dashboard
334
- npm run dashboard:dev # dashboard with hot reload, API from a running RayTrace
560
+ npm run build # dashboard -> dist/dashboard
561
+ npm run dashboard:dev # dashboard with hot reload, API from a running RayTrace
335
562
  npm run typecheck
563
+ npm test
336
564
  node bin/raytrace.mjs <command> # run the CLI from this folder
337
- npm pack # build the package as it would be published
565
+ ```
566
+
567
+ To use your checkout as the MCP server in Claude Code:
568
+
569
+ ```sh
570
+ claude mcp add --scope user raytrace -- node /path/to/raytrace-cli/bin/raytrace.mjs mcp
338
571
  ```
339
572
 
340
573
  To try it without touching your real setup, give it its own home and port: