@raytrace-cli/cli 0.11.1 → 0.13.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
@@ -1,149 +1,117 @@
1
- # RayTrace
2
-
3
- **See what your coding agent actually did.**
4
-
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.
20
-
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)
22
-
23
- *One real coding task: 50 model round trips, 58 tool calls, and a command-by-command record.*
24
-
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
- or none at all from pip: `pip install raytrace-cli` (or `uv tool install raytrace-cli`)
35
- installs the same CLI with its own Node.js. Where this page says
36
- `npx -y @raytrace-cli/cli@latest`, use `uvx --from raytrace-cli raytrace` instead.
37
- Windows is experimental.
1
+ <p align="center">
2
+ <a href="https://www.raytracer.si/">
3
+ <img src="docs/images/logo-wordmark-white.svg" alt="RayTrace — Prompts, Tool calls, Sandbox evidence" width="560">
4
+ </a>
5
+ </p>
6
+
7
+ <h1 align="center">Eye of Sauron</h1>
8
+
9
+ <p align="center">
10
+ See what your coding agents did, rather than what they said they did.
11
+ </p>
12
+
13
+ <p align="center">
14
+ <img src="docs/images/watching-eye.gif" alt="The agent said it only read the file. The sandbox saw it wrote to ~/.bashrc, twice." width="560">
15
+ </p>
16
+
17
+ <p align="center">
18
+ <a href="https://app.raytracer.si/demo">Try the interactive demo — no install needed</a>
19
+ </p>
20
+
21
+ <p align="center">
22
+ <a href="https://www.raytracer.si/">Website</a> ·
23
+ <a href="https://www.npmjs.com/package/@raytrace-cli/cli">npm</a> ·
24
+ <a href="https://pypi.org/project/raytrace-cli/">PyPI</a> ·
25
+ <a href="docs/mcp.md">MCP</a> ·
26
+ <a href="CONTRIBUTING.md">Contributing</a> ·
27
+ <a href="https://github.com/Godcreatebugs/raytrace-cli/issues">Report an issue</a>
28
+ </p>
29
+
30
+ <p align="center">
31
+ <a href="https://www.npmjs.com/package/@raytrace-cli/cli"><img src="https://img.shields.io/npm/v/@raytrace-cli/cli?style=flat-square" alt="npm" /></a>
32
+ <a href="https://pypi.org/project/raytrace-cli/"><img src="https://img.shields.io/pypi/v/raytrace-cli?style=flat-square" alt="PyPI" /></a>
33
+ <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT license" /></a>
34
+ <a href="https://www.raytracer.si/"><img src="https://img.shields.io/badge/website-raytracer.si-111315?style=flat-square" alt="raytracer.si" /></a>
35
+ </p>
36
+
37
+ ## Why sandboxing matters
38
+
39
+ A coding agent doesn't just suggest edits. It runs commands, installs packages,
40
+ reads and writes files, and opens network connections — often with permission
41
+ to do all of that on your machine.
42
+
43
+ What it tells you afterwards is a claim. "Tests passed" is what the agent
44
+ reported. That report can miss a command that phoned home, a package you didn't
45
+ ask for, a file outside the task, or a test whose real exit code was not zero.
46
+ And if the agent is running on your laptop, it can reach everything else there:
47
+ secrets, private networks, and files that were never part of the work.
48
+
49
+ Sandboxing is how you change both of those problems. The agent works in an
50
+ isolated copy of the project, where it cannot see your machine. And the record
51
+ of what happened is taken from outside that sandbox, so the agent cannot turn
52
+ it off or edit it.
53
+
54
+ <video src="docs/videos/why-sandboxing.mp4" controls width="800" title="Why we built RayTrace">
55
+ <a href="docs/videos/why-sandboxing.mp4">Why we built RayTrace (1 min 47 sec)</a>
56
+ </video>
57
+
58
+ *Why we built RayTrace — the gap between what an agent reports and what actually ran.*
59
+
60
+ ## How RayTrace sandboxes
61
+
62
+ RayTrace runs Claude Code or Codex in that isolated copy, records what actually
63
+ happened, and shows it in a dashboard.
64
+
65
+ Each local sandbox is a Docker container under [gVisor](https://gvisor.dev),
66
+ inside a Linux VM made with [Lima](https://lima-vm.io). It can't see your
67
+ machine's files or private networks. A collector outside the sandbox — which
68
+ the agent can't turn off — records every command, its real exit code, the files
69
+ it read or changed, and where it connected. Your own files are never changed.
70
+ Nothing is uploaded.
71
+
72
+ The dashboard has two layers. **Tool calls** are what the agent reported.
73
+ **Sandbox evidence** is what the machine saw. If those disagree, you can see
74
+ it, and take the file diffs home as a patch.
75
+
76
+ Local sandboxes are free, MIT licensed, and need no [RayTrace](https://www.raytracer.si/)
77
+ account. Cloud sandboxes are optional, for teams that want a shared dashboard
78
+ at [app.raytracer.si](https://app.raytracer.si).
38
79
 
39
80
  ---
40
81
 
41
- ## Set up in your editor (MCP)
42
-
43
- `raytrace mcp` is an [MCP](https://modelcontextprotocol.io) server. Add it to
44
- your editor once, and your agent can create, open, stop and destroy sandboxes
45
- for you. There is nothing to install first: `npx` downloads the CLI on first use.
82
+ ## Create a local sandbox
46
83
 
47
- ### 1. Add the server
48
-
49
- **Claude Code.** One command, then restart Claude Code. `--scope user` makes it
50
- available in every project:
84
+ Install the CLI from [npm](https://www.npmjs.com/package/@raytrace-cli/cli) or
85
+ [PyPI](https://pypi.org/project/raytrace-cli/), then create a sandbox in any
86
+ Git repository. Nothing is uploaded.
51
87
 
52
88
  ```sh
53
- claude mcp add --scope user raytrace -- npx -y @raytrace-cli/cli@latest mcp
54
- ```
55
-
56
- Check it with `claude mcp list`, which should show `raytrace` as connected.
57
-
58
- **Cursor.** Add to `~/.cursor/mcp.json` (every project) or `.cursor/mcp.json` (one project):
59
-
60
- ```json
61
- {
62
- "mcpServers": {
63
- "raytrace": { "command": "npx", "args": ["-y", "@raytrace-cli/cli@latest", "mcp"] }
64
- }
65
- }
66
- ```
67
-
68
- **VS Code.** Add to `.vscode/mcp.json` in the project, or run **MCP: Open User
69
- Configuration** from the command palette for every project:
89
+ npm install -g @raytrace-cli/cli
90
+ # or: pip install raytrace-cli
91
+ # or: uv tool install raytrace-cli
70
92
 
71
- ```json
72
- {
73
- "servers": {
74
- "raytrace": { "command": "npx", "args": ["-y", "@raytrace-cli/cli@latest", "mcp"] }
75
- }
76
- }
93
+ cd your-project # any Git repository
94
+ raytrace sandbox create --local # first time: sets up the VM, a few minutes
95
+ raytrace connect your-project --claude # a terminal in it, with Claude Code running
96
+ # open the local dashboard at http://127.0.0.1:8797
77
97
  ```
78
98
 
79
- **Codex.** `codex mcp add raytrace -- npx -y @raytrace-cli/cli@latest mcp`
80
-
81
- **Any other MCP client.** Run the command `npx` with the arguments
82
- `-y @raytrace-cli/cli@latest mcp`, over stdio. Most clients use the same
83
- `mcpServers` JSON as Cursor.
84
-
85
- > Already have the CLI installed globally? You can use `raytrace mcp` as the
86
- > command instead of `npx`.
87
-
88
- ### 2. Ask for a sandbox
89
-
90
- Open a Git project in your editor and ask your agent in plain words:
91
-
92
- | You say | What happens |
93
- |---|---|
94
- | "Create a local sandbox and connect this repo" | a sandbox on your machine, then a terminal opens with Claude Code running in it |
95
- | "Put this project in a cloud sandbox" | uploads the repo to RayTrace's cloud, then opens a terminal with Claude Code in it |
96
- | "Open my sandbox with Codex" | a terminal connected to an existing sandbox, with Codex running in it |
97
- | "List my sandboxes" / "Stop demo-box" / "Destroy it" | manages them; the agent asks you before it destroys anything |
98
- | "Run `npm test` in the sandbox" | runs a command in a cloud sandbox and reports the result back in the chat |
99
-
100
- **The first time:**
101
-
102
- - **Cloud sandboxes** need a RayTrace sign-in. The agent shows you a short code
103
- and opens a browser page. Approve it there (or create your account), and the
104
- agent carries on. Local sandboxes need no account.
105
- - **The first local sandbox** sets up a Linux VM, which takes a few minutes. If
106
- [Lima](https://lima-vm.io) is missing, the agent asks before downloading it.
107
- See [what you need](#what-you-need).
108
- - **In each new sandbox**, Claude Code or Codex asks you to sign in to your
109
- Anthropic or OpenAI account, as it would on your machine.
110
- - **On macOS**, the first time a terminal is opened for you, macOS asks whether
111
- your editor may control your terminal app. Allow it.
112
-
113
- ### 3. Work in the sandbox
114
-
115
- The terminal opens where you work: a new tmux window if you're in tmux, a new
116
- iTerm window or WezTerm tab, otherwise a new Terminal window on macOS (VS Code's
117
- built-in terminal can't be opened from outside), your desktop's terminal on
118
- Linux, or Windows Terminal. If none can be opened, the agent gives you the
119
- command to paste instead, such as `raytrace connect demo-box --claude`.
120
-
121
- Inside, the agent runs **without approval prompts**. The sandbox is what keeps
122
- it contained, so there's no need to approve every command, and everything it
123
- does is recorded. See [Working in a sandbox](#working-in-a-sandbox).
124
-
125
- ### MCP tools reference
126
-
127
- | Tool | What it does |
128
- |---|---|
129
- | `login` | signs in to RayTrace (cloud only): shows a code to approve in the browser |
130
- | `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 |
131
- | `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 |
132
- | `list_sandboxes`, `sandbox_status` | your local and cloud sandboxes, and one sandbox's details or creation progress |
133
- | `start_sandbox`, `stop_sandbox` | stopping keeps the files |
134
- | `destroy_sandbox` | deletes a sandbox. Cloud: its traces go too, unless `keep_traces` (paid plans). Local: its logs are archived, unless `delete_logs` |
135
- | `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 |
136
-
137
- Local sandboxes are named by their name and cloud ones by their id (`rtp-…`).
138
- Whatever a command prints is treated as data from your project, never as
139
- instructions to the agent.
140
-
141
- ---
99
+ - The sandbox is named after the folder. Use `--name my-box` to choose the name.
100
+ - Use `--codex` instead of `--claude` to start Codex, or leave both off for a
101
+ plain shell where you run `claude` or `codex` yourself.
102
+ - `connect` prints a link to the dashboard showing only this sandbox's prompts.
103
+ The full local dashboard is at `http://127.0.0.1:8797` — open that in your
104
+ browser. If you set `RAYTACE_PORT` in `~/.raytrace/config.env`, the
105
+ dashboard is on that port instead.
142
106
 
143
- ## Local sandboxes
107
+ The npm package needs **Node.js 22.13 or newer** (`node --version`) on macOS or
108
+ Linux. The PyPI package installs the same CLI with its own Node.js, so you
109
+ don't need Node on the machine. Windows is experimental. Where this page says
110
+ `npx -y @raytrace-cli/cli@latest`, use `uvx --from raytrace-cli raytrace`
111
+ instead.
144
112
 
145
- Run the sandbox on your own machine. Your project is copied into it, and nothing
146
- is uploaded. It is open source and needs no RayTrace account.
113
+ Or skip the commands and ask your editor's agent: [set up MCP](docs/mcp.md),
114
+ then say "create a local sandbox and connect this repo".
147
115
 
148
116
  ### What you need
149
117
 
@@ -152,31 +120,11 @@ is uploaded. It is open source and needs no RayTrace account.
152
120
  | **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) |
153
121
  | **Older macOS** | QEMU too: `brew install qemu` |
154
122
  | **Linux** | Lima, QEMU, and access to `/dev/kvm` (`sudo usermod -aG kvm $USER`, then log out and in) |
155
- | **Windows** | experimental; RayTrace doesn't download Lima there |
123
+ | **Windows** | experimental; RayTrace doesn't download Lima there, so local sandboxes need WSL2 — see [docs/windows.md](docs/windows.md) for what works and the WSL2 and cloud paths |
156
124
  | **Disk and memory** | the first setup downloads about 1 GB; the VM uses 4 GiB of memory while it runs |
157
125
 
158
126
  `raytrace doctor` checks all of this and says how to fix anything missing.
159
127
 
160
- ### Set it up
161
-
162
- ```sh
163
- npm install -g @raytrace-cli/cli
164
-
165
- cd your-project # any Git repository
166
- raytrace sandbox create --local # first time: sets up the VM, a few minutes
167
- raytrace connect your-project --claude # a terminal in it, with Claude Code running
168
- ```
169
-
170
- - The sandbox is named after the folder. Use `--name my-box` to choose the name.
171
- - Use `--codex` instead of `--claude` to start Codex, or leave both off for a
172
- plain shell where you run `claude` or `codex` yourself.
173
- - `connect` prints a link to the dashboard showing only this sandbox's prompts.
174
- `raytrace open` opens the full dashboard.
175
-
176
- Or skip the commands and ask your editor's agent:
177
- [set up MCP](#set-up-in-your-editor-mcp), then say "create a local sandbox and
178
- connect this repo".
179
-
180
128
  ### Day to day
181
129
 
182
130
  ```sh
@@ -205,7 +153,7 @@ cloud, `raytrace upload logs --sandbox my-box` sends them to
205
153
  [gVisor](https://gvisor.dev), inside a Linux VM made with
206
154
  [Lima](https://lima-vm.io). It can't see your machine's files or private
207
155
  networks. A copy of your project goes in (picked the same way as for
208
- [cloud uploads](#what-is-uploaded)); your own files are never changed.
156
+ [cloud uploads](docs/cloud.md#what-is-uploaded)); your own files are never changed.
209
157
  - **Resources:** each sandbox gets 2 GB of memory, 2 CPUs, 256 processes and a
210
158
  512 MB `/tmp`. All sandboxes share the VM's 30 GiB disk.
211
159
  - **Recording:** a collector outside the sandbox, which the agent can't turn
@@ -219,299 +167,185 @@ cloud, `raytrace upload logs --sandbox my-box` sends them to
219
167
  optionally with a check such as `npm test`. Each rerun is a fork, a sandbox
220
168
  of its own started from the snapshot just before that step.
221
169
 
222
- ---
223
-
224
- ## Cloud sandboxes
225
-
226
- A cloud sandbox is the same isolated copy of your project, on RayTrace's
227
- servers, with sessions recorded for your organization at
228
- **[app.raytracer.si](https://app.raytracer.si)**. This is a preview.
229
-
230
- ```sh
231
- npm install -g @raytrace-cli/cli
232
- raytrace auth login # opens your browser: sign in, or create your account
233
- cd your-project # any Git repository
234
- raytrace sandbox create # uploads it and prints the sandbox id
235
- raytrace connect <sandbox-id> --claude # a terminal in it, with Claude Code running
236
- ```
237
-
238
- `auth login` prints a short code and opens the sign-in page; approve it there.
239
- If you skip it, `sandbox create` and `connect` ask you to sign in first. With
240
- one sandbox, `connect` needs no id. You can also create a sandbox in the web
241
- dashboard by dropping a project folder on the **Sandboxes** page.
242
-
243
- ### What is uploaded
244
-
245
- The files Git would track (including new files it doesn't ignore), **without**
246
- `.git`, dependencies such as `node_modules`, build output, `.env*` files, private
247
- keys (`.pem`, `.key`, `.p12`, `.pfx`) and common credential files (`.npmrc`,
248
- `.netrc`, `id_rsa`, …). Check for secrets inside other files before you upload.
249
-
250
- ### Limits
251
-
252
- - **Project size:** up to 200 MiB and 20,000 files, each file up to 25 MiB
253
- (100 MiB once packed). A project over a limit is refused, with the files
254
- named, and nothing is uploaded; add those files to `.gitignore`.
255
- - **Sandboxes at a time:** Beta 1, Individual 5, Team & Enterprise 20.
256
- Destroyed ones don't count.
257
- - **Each sandbox:** 2 GB of memory, 2 CPUs, 256 processes, a 512 MB `/tmp`.
258
-
259
- ### When you are done
170
+ ### Inside the sandbox
260
171
 
261
- `raytrace sandbox stop` keeps the files. `raytrace sandbox destroy` deletes them
262
- and any sign-in made inside, along with the recorded traces. To keep the traces,
263
- use `--keep-traces` (paid plans).
172
+ Claude Code and Codex are preinstalled. `--claude` starts Claude Code with
173
+ `--dangerously-skip-permissions`, and `--codex` starts Codex with
174
+ `--dangerously-bypass-approvals-and-sandbox`. The sandbox's own settings, which
175
+ the agent can't change, make this the default too, so typing `claude` or
176
+ `codex` yourself works the same way. The sandbox is what keeps the agent
177
+ contained, and every command is recorded.
264
178
 
265
- ---
179
+ Files a project's owner restricts in the dashboard (**Initial scan**) can't be
180
+ changed by the agent, whatever it tries. Sign in to Claude Code or Codex inside
181
+ the sandbox, as you would on your machine; the sign-in stays until you destroy
182
+ it. Exiting the agent drops you into the sandbox's shell, and exiting that
183
+ leaves the sandbox running. `raytrace connect` takes you back.
266
184
 
267
- ## Working in a sandbox
268
-
269
- - **Claude Code and Codex are preinstalled** in every sandbox, local and cloud.
270
- - **No approval prompts.** `--claude` starts Claude Code with
271
- `--dangerously-skip-permissions`, and `--codex` starts Codex with
272
- `--dangerously-bypass-approvals-and-sandbox`. The sandbox's own settings, which
273
- the agent can't change, make this the default too, so typing `claude` or
274
- `codex` yourself works the same way. The sandbox is what keeps the agent
275
- contained, and every command is recorded.
276
- - **Restricted files stay locked.** Files a project's owner restricts in the
277
- dashboard (**Initial scan**) can't be changed by the agent, whatever it tries.
278
- - **Signing in:** sign in to Claude Code or Codex inside the sandbox, as you
279
- would on your machine. The sign-in stays in that sandbox until you destroy it.
280
- - **Leaving:** exiting the agent drops you into the sandbox's shell, and exiting
281
- that leaves the sandbox running. `raytrace connect` takes you back.
282
-
283
- In local sandboxes, Codex's prompts don't reach the dashboard's **Prompts** page
284
- yet. Its commands, file changes and network connections are recorded.
185
+ In local sandboxes, Codex's prompts don't reach the dashboard's **Prompts**
186
+ page yet. Its commands, file changes and network connections are recorded.
285
187
 
286
188
  ---
287
189
 
288
- ## What you can do with a recorded session
289
-
290
- Cloud sessions are at [app.raytracer.si](https://app.raytracer.si), and
291
- `raytrace open` opens the same pages for your local sandboxes. Every page is
292
- about one prompt, and they link to each other, so you can go from "what did I
293
- ask" to "what actually ran" to "what if it had gone differently" in a couple of
294
- clicks. The screenshots below are from the cloud dashboard, with a session in
295
- the `raytrace-demo-shop` sandbox.
296
-
297
- ### Prompts: what you asked, and what came back
298
-
299
- ![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)
300
-
301
- Every prompt you gave the agent, newest first, with an activity calendar on
302
- top. Each row shows where it ran (Mac, local sandbox or cloud sandbox), the
303
- model, how many tool calls it took and what it cost. Open one to read the
304
- answer and a short recap of the run.
190
+ ## What a recorded session shows
305
191
 
306
- ![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)
192
+ Cloud sessions are at [app.raytracer.si](https://app.raytracer.si). The local
193
+ dashboard is at `http://127.0.0.1:8797` — open that in your browser. Every
194
+ page is about one prompt, and they link to each other.
307
195
 
308
- - **Find a session again:** click a day in the calendar, or add
309
- `?box=<sandbox id>` to see a single sandbox's prompts.
310
- - **Spot the expensive ones:** the cost and tool-call count are on every row.
196
+ The dashboard has two layers. **Tool calls** are what the agent reported: the
197
+ path from your prompt to the answer, with the command, what the agent says came
198
+ back, and tokens, time and cost at each step. **Sandbox evidence** is what the
199
+ machine saw, recorded from outside the agent where it can't be turned off or
200
+ edited: every process, its real exit code, the files it read or changed, and
201
+ where it connected.
311
202
 
312
- ### Tool calls: how the agent got there
313
-
314
- <!-- screenshot: the one at the top of this README (docs/images/tool-calls.jpg) -->
315
-
316
- The path from your prompt to the answer: one divider for each round trip to the
317
- model, one row for each tool call it proposed, with the command and what the
318
- agent says came back, plus tokens, time and cost at each step.
319
-
320
- - **Follow its reasoning step by step,** and see where it went in circles.
321
- - **See where the tokens went:** which steps were the expensive ones.
322
-
323
- ### Sandbox evidence: what actually ran
203
+ | Feature | What it does |
204
+ |---|---|
205
+ | **Prompts** | Every prompt you gave the agent, newest first, with where it ran (your machine, a local sandbox or a cloud sandbox), the model, how many tool calls it took and what it cost. Open one to read the answer and a short recap of the run. |
206
+ | **Tool calls** | The path from your prompt to the answer: one divider for each round trip to the model, one row for each tool call it proposed, with the command and what the agent says came back, plus tokens, time and cost at each step. |
207
+ | **Sandbox evidence** | What the sandbox itself saw, recorded from outside the agent. Every process in time order, with its real exit code, the files it read or changed, and where it connected — including anything no tool call accounts for. Use it to check "tests pass" against the real exit code, and to catch a script that phoned home or a package you didn't ask for. |
208
+ | **Changes** | Every file the prompt changed, with its diff, first for the whole prompt and then step by step. Download it all as one patch and apply it to your own checkout. The sandbox works on a copy; the patch is how you take the work home. |
209
+ | **Context** | What was in the model's context when it answered: what you said earlier, what the model brought in itself (earlier answers, and the files it read, with how much of each actually fit), and what the agent's harness adds to every request. Use it to see whether a wrong answer came from a file that was never read, or was cut off. |
210
+ | **Playground** | Pick any step and rerun from there with something changed: a tool result, a file, the model, the message, or a time limit. Each rerun is a fork, a sandbox of its own started from the snapshot just before that step. Add a check such as `npm test` and every fork is graded pass or fail, so you can compare models or outcomes side by side. |
211
+ | **Story** | The short version of a long run: a timeline of only the steps that mattered, the single most consequential command pulled out at the top, and for each step what the agent could see, what it proposed, what really happened and what that led to. Worked out from the recording alone, nothing is rerun. |
212
+ | **Chain of thought** | For each tool call, the likely causes among what the agent could see — your request, an earlier result, its own plan, or the project's instructions — each with a probability from [Jev](#limitations). Also worked out from the recording alone. |
213
+ | **Search** | Search every recorded session at once, failures first. Type free text, or use filters such as `outcome:failed tool:Bash exit:>=1 file:.env`, and summarise with a pipe, such as `stats count by tool`. With no query, it shows the most common failures lately. |
214
+ | **Initial scan** | When a project goes into a sandbox, every file is rated from 1 to 5 for how risky it is to change, with the reason. You can move any file up or down, choose which files to be alerted about, and **restrict** files so the agent can't change them at all. **Alerts** lists what the agent did to those files: changes, refused edits, reads, and commands that named them. |
215
+ | **Sandboxes** | Every sandbox, grouped by the machine it runs on, with what was asked in each. Destroyed sandboxes stay listed, because their evidence outlives them. |
324
216
 
325
217
  ![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)
326
218
 
327
- What the agent *says* it ran is in Tool calls. This page is what the sandbox
328
- itself saw, recorded from outside the agent where it can't be turned off or
329
- edited. You get every process in time order, with its real exit code, the files
330
- it read or changed, where it connected and what it installed. Each process is
331
- tied to the tool call that started it, and anything no tool call accounts for
332
- shows up too.
333
-
334
- - **Check the agent's claims:** "tests pass" against the real exit code.
335
- - **Catch side effects:** a script that phoned home, a package you didn't ask
336
- for, a file outside the task that got changed.
337
-
338
- ### Changes: what the prompt left different
339
-
340
- <!-- screenshot: docs/images/changes.png -->
341
-
342
- Every file the prompt changed, with its diff, first for the whole prompt and
343
- then step by step, so you see which tool call made which change. Download it all
344
- as one patch and apply it to your own checkout.
345
-
346
- - **Review the agent's work like a pull request,** before you take it.
347
- - **Take the result home:** the sandbox works on a copy, and the patch brings
348
- the changes back to your machine.
349
-
350
- ### Context: what the model could see
351
-
352
- <!-- screenshot: docs/images/context.png -->
353
-
354
- What was in the model's context when it answered, in three parts:
355
-
356
- - what you said earlier in the conversation;
357
- - what the model brought in itself: its earlier answers, and the files it read,
358
- with how much of each actually fit;
359
- - what the agent's harness adds to every request.
360
-
361
- Use it to:
362
-
363
- - **Understand a wrong answer:** was the right file never read, or cut off?
364
- - **Test a hunch:** "Rerun without this" on any file opens the Playground with
365
- that file removed.
366
-
367
- ### Playground: rerun it differently, and compare
368
-
369
219
  ![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)
370
220
 
371
- Pick any step of a session and rerun from there with something changed: an
372
- earlier tool result removed or edited, a file in the project, the model, or the
373
- time limit. Each rerun is a fork, a sandbox of its own started from a snapshot
374
- taken just before that step, running in parallel with the others. Add a check
375
- such as `npm test` and every fork is graded pass or fail. Run a change several
376
- times and you get its pass rate, cost and steps, next to the same step rerun
377
- unchanged.
221
+ ![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)
378
222
 
379
- - **Find out what actually mattered:** would it still have broken the build
380
- without that misleading test output?
381
- - **Compare models on your own task:** same step, same files, a different model.
382
- - **Compare outcomes side by side:** each fork's answer, steps and files next to
383
- the original's.
223
+ Chain of thought's probabilities, command severity ratings, and the
224
+ plain-English explanations of what each command did, need models you configure
225
+ yourself. See [Limitations](#limitations). Without those keys, the recorded
226
+ evidence and the rest of the dashboard still work.
384
227
 
385
- ### Story and Chain of thought: why it did what it did
228
+ `raytrace report <trace-id>` turns a run into a short pull-request comment:
229
+ commands with their exit codes, files changed, and cost. See
230
+ [Report a run on a pull request](docs/dashboard.md#report-a-run-on-a-pull-request).
386
231
 
387
- ![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)
232
+ The fuller guide to every page, including optional AI recaps on your own
233
+ OpenRouter key, is in [docs/dashboard.md](docs/dashboard.md).
388
234
 
389
- **Story** is the short version of a long run. It shows a timeline of only the
390
- steps that mattered, the single most consequential command pulled out at the
391
- top, and for each step what the agent could see, what it proposed, what really
392
- happened and what that led to.
235
+ ---
393
236
 
394
- **Chain of thought** takes each tool call and lists its likely causes among what
395
- the agent could see: your request, an earlier result, its own plan, or the
396
- project's instructions.
237
+ ## Cloud sandboxes
397
238
 
398
- Both are worked out from the recording alone, with nothing rerun. Some parts
399
- use [your own key](#ai-features-on-your-own-key).
239
+ A cloud sandbox is the same isolated copy of your project, on RayTrace's
240
+ servers, with sessions recorded for your organization at
241
+ **[app.raytracer.si](https://app.raytracer.si)**. This is a preview.
400
242
 
401
- - **Explain a run to someone else** without replaying all 60 steps.
402
- - **Trace a bad decision back** to the result or instruction that caused it.
243
+ ```sh
244
+ npm install -g @raytrace-cli/cli
245
+ # or: pip install raytrace-cli
246
+ raytrace auth login # opens your browser: sign in, or create your account
247
+ cd your-project # any Git repository
248
+ raytrace sandbox create # uploads it and prints the sandbox id
249
+ raytrace connect <sandbox-id> --claude # a terminal in it, with Claude Code running
250
+ ```
403
251
 
404
- ### Search: across everything the agents did
252
+ `auth login` prints a short code and opens the sign-in page; approve it there.
253
+ If you skip it, `sandbox create` and `connect` ask you to sign in first. With
254
+ one sandbox, `connect` needs no id. You can also create a sandbox in the web
255
+ dashboard by dropping a project folder on the **Sandboxes** page.
405
256
 
406
- <!-- screenshot: docs/images/search.png -->
257
+ The upload is the files Git would track (including new files it doesn't ignore),
258
+ **without** `.git`, dependencies such as `node_modules`, build output, `.env*`
259
+ files, private keys and common credential files. Check for secrets inside other
260
+ files before you upload.
407
261
 
408
- Search every recorded session at once, failures first. Type free text, or use
409
- filters such as `outcome:failed tool:Bash exit:>=1 file:.env`, and summarise
410
- with a pipe: `| stats count by tool`. With no query, it shows the most common
411
- failures lately.
262
+ Limits, beta invites, and what happens when you destroy a cloud sandbox are in
263
+ [docs/cloud.md](docs/cloud.md).
412
264
 
413
- - **Find patterns:** which commands fail most, and which sessions touched
414
- `.env`.
265
+ ---
266
+
267
+ ## Set up in your editor (MCP)
415
268
 
416
- ### Initial scan: guard the files that matter
269
+ `raytrace mcp` is an [MCP](https://modelcontextprotocol.io) server. Add it to
270
+ your editor once, and your agent can create, open, stop and destroy sandboxes
271
+ for you. Setup for Claude Code, Cursor, VS Code and Codex, what to say to your
272
+ agent, and the tools the server exposes, are in [docs/mcp.md](docs/mcp.md).
417
273
 
418
- ![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)
274
+ ---
419
275
 
420
- When a project goes into a sandbox, every file is rated from 1 to 5 for how
421
- risky it is to change, with the reason. Secrets, migrations and deploy
422
- configuration rate highest. You can move any file up or down, choose which
423
- files to be alerted about, and **restrict** files so the agent can't change them
424
- at all, whatever it tries. **Alerts** lists what the agent did to those files:
425
- changes, refused edits, reads, and commands that named them.
276
+ ## Contributing
426
277
 
427
- - **Let the agent work freely** while keeping your migrations and CI config
428
- off-limits.
278
+ The project is MIT licensed and still early. Useful places to help right now:
429
279
 
430
- ![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)
431
- - **Get told** when it touches what you care about.
280
+ - Windows is experimental (Lima isn't downloaded there yet)
281
+ - Codex prompts don't appear on the Prompts page yet (commands and file/network
282
+ evidence already do)
283
+ - First-run setup of the local VM, and docs for new contributors
432
284
 
433
- ### Sandboxes: where it all ran
285
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for how to set up a checkout, run the
286
+ tests, and open a pull request. [Issues](https://github.com/Godcreatebugs/raytrace-cli/issues)
287
+ are the place to start — look for `good first issue` and `help wanted`.
434
288
 
435
- Every sandbox, grouped by the machine it runs on, with what was asked in each.
436
- Destroyed sandboxes stay listed, because their evidence outlives them.
289
+ ## Limitations
437
290
 
438
- ### AI features, on your own key
291
+ The recording itself — every command, its real exit code, file changes and
292
+ network connections — works with no extra keys. To get the **full experience**
293
+ of the dashboard (probabilities on Chain of thought, severity ratings, step
294
+ summaries and plain-English command explanations), you need to configure two
295
+ models on your own keys.
439
296
 
440
- Everything above works without any key. A few views can also ask a model to
441
- explain a run, using **your own OpenRouter key**, billed to your OpenRouter
442
- account:
297
+ **[Jev](https://typesafe.ai/blog/introducing-system-one-models-and-jev)** is
298
+ [TypeSafe](https://typesafe.ai)'s decision model. It does not write prose: it
299
+ assigns calibrated probabilities. Configure it with:
443
300
 
444
301
  ```sh
445
- raytrace key openrouter # paste your key from https://openrouter.ai/keys (not echoed)
446
- raytrace key # which keys are set
302
+ raytrace key typesafe
447
303
  ```
448
304
 
449
- | Feature | Where | Model (default) |
450
- |---|---|---|
451
- | Run recap: what the agent did and why, in a few lines | Story, Chain of thought | `anthropic/claude-sonnet-5.5` |
452
- | Chain of thought: the likely reasons for each tool call | Chain of thought | `qwen/qwen3-coder` |
453
- | Step summaries, and plain-English lines for commands no rule describes | Tool calls, Sandbox evidence | `openai/gpt-oss-120b` |
454
-
455
- - **No key?** Those parts say so, and everything else works.
456
- - **Cost:** each answer is kept, so opening the same prompt again is free.
457
- Nothing is sent until you open a view that needs it.
458
- - **What's sent:** only to OpenRouter, the parts of the run the feature reads.
459
- Nothing goes to RayTrace.
460
- - **Other models:** set `RAYTACE_OBSERVER_MODEL` (recap),
461
- `RAYTACE_ATTRIBUTION_MODEL` (Chain of thought) or `RAYTACE_SUMMARY_MODEL`
462
- (summaries) in `~/.raytrace/config.env`, then `raytrace stop && raytrace start`.
463
- - **Optional:** `raytrace key typesafe` adds a [TypeSafe](https://typesafe.ai)
464
- key, which ranks Chain of thought's reasons and rates how severe each command
465
- was.
466
- - `raytrace key openrouter --remove` removes a key.
467
-
468
- ---
305
+ Jev ranks the likely causes of each tool call in **Chain of thought** — your
306
+ request, an earlier result, the agent's own plan, or the project's instructions
307
+ — and gives each a probability. It also rates how severe each command was. The
308
+ default model is `jev-latest`. Without this key, those causes are listed but
309
+ unranked: no probability is shown that was not measured, and severity comes
310
+ only from rules on the command text.
469
311
 
470
- ## Commands
312
+ **A lower model** summarizes text and explains what each command did: step
313
+ summaries on Tool calls, and plain-English lines on Sandbox evidence for
314
+ commands no rule already describes. That is `openai/gpt-oss-120b` by default,
315
+ called through your own [OpenRouter](https://openrouter.ai/keys) key:
471
316
 
472
- | Command | What it does |
473
- |---|---|
474
- | `raytrace mcp` | the MCP server for your editor; see [Set up in your editor](#set-up-in-your-editor-mcp) |
475
- | `raytrace sandbox create [--local] [--name <name>]` | copy this Git repository into a new sandbox, in the cloud or (`--local`) on this machine |
476
- | `raytrace connect [id or name] [--claude \| --codex]` | open a terminal in a sandbox, optionally with an agent running in it |
477
- | `raytrace sandbox list [--local]` | your sandboxes |
478
- | `raytrace sandbox start\|stop <id or name>` | start or stop one; stopping keeps its files |
479
- | `raytrace sandbox destroy <id or name>` | delete one. Cloud: `--keep-traces` (paid plans). Local: `--delete-logs` or `--keep-logs` |
480
- | `raytrace open` | open the local dashboard |
481
- | `raytrace auth login\|status\|logout` | your RayTrace sign-in, for cloud sandboxes |
482
- | `raytrace upload logs [--sandbox <name>]` | send a local sandbox's recorded logs to the cloud dashboard; `raytrace upload status` shows your storage |
483
- | `raytrace share <trace-id> [--fork]` | a time-limited link to one recorded prompt; `--list`, `--revoke <share-id>` |
484
- | `raytrace export <trace-id> [--format json\|markdown] [--output <file>]` | export a recorded prompt to the terminal or a file, even with RayTrace stopped |
485
- | `raytrace --code <code>` | redeem a beta invite code |
486
- | `raytrace key [openrouter\|typesafe] [--remove]` | your keys for the dashboard's AI features |
487
- | `raytrace doctor` | what this machine has and lacks |
488
-
489
- `raytrace help` lists everything.
317
+ ```sh
318
+ raytrace key openrouter
319
+ ```
490
320
 
491
- ---
321
+ The same OpenRouter key also runs Chain of thought's cause proposals
322
+ (`qwen/qwen3-coder`) and the run recap (`anthropic/claude-sonnet-5.5`). Those
323
+ recaps are a reading of the run, not a measurement, and they are not allowed to
324
+ state a percentage. Calls are billed to your TypeSafe and OpenRouter accounts.
325
+ Nothing is sent until you open a view that needs it, and answers are kept, so
326
+ opening the same prompt again is free. What's sent goes to TypeSafe or
327
+ OpenRouter, not to RayTrace. `raytrace key` shows which keys are set;
328
+ `raytrace key openrouter --remove` (or `typesafe`) removes one.
492
329
 
493
- ## Beta invites
330
+ You can pick different models in `~/.raytrace/config.env`:
331
+ `RAYTACE_OBSERVER_MODEL` (recap), `RAYTACE_ATTRIBUTION_MODEL` (Chain of thought
332
+ proposals), `RAYTACE_SUMMARY_MODEL` (summaries), or `RAYTACE_TYPESAFE_MODEL`
333
+ (Jev). Then `raytrace stop && raytrace start`.
494
334
 
495
- If RayTrace gave you a beta code, sign in, redeem it, then create your sandbox:
335
+ Other known limits:
496
336
 
497
- ```sh
498
- raytrace auth login
499
- raytrace --code <code>
500
- raytrace sandbox create
501
- ```
502
-
503
- The code gives you one sandbox with $10 of model credit. Codes are single-use
504
- and expire 3 days after they're issued, and the credit expires 3 days after you
505
- redeem it. Your account and that sandbox show as **Beta** in the cloud dashboard
506
- until then.
337
+ - **Windows** is experimental; RayTrace doesn't download Lima there.
338
+ - In local sandboxes, **Codex** prompts don't reach the Prompts page yet.
339
+ Commands, file changes and network connections are already recorded.
340
+ - **Cloud sandboxes** are a preview.
507
341
 
508
342
  ## Privacy
509
343
 
510
344
  - **Local sandboxes** keep everything on your machine, in `~/.raytrace`, readable
511
345
  only by you. The local dashboard's API needs the token in
512
346
  `~/.raytrace/api-token`, so other accounts on the machine can't read your
513
- traces. `raytrace open` signs your browser in with a one-time link.
514
- - **Cloud sandboxes** upload your project ([what is uploaded](#what-is-uploaded))
347
+ traces. Opening the dashboard signs your browser in with a one-time link.
348
+ - **Cloud sandboxes** upload your project ([what is uploaded](docs/cloud.md#what-is-uploaded))
515
349
  and record prompts, model requests and answers, tool calls and commands on
516
350
  RayTrace's servers. Members of your organization can see them; other
517
351
  organizations can't.
@@ -519,80 +353,14 @@ until then.
519
353
  file only you can read where neither exists). `raytrace auth logout` removes
520
354
  it. Cloud commands ask you to sign in again after 2 days without cloud use.
521
355
 
522
- ## Troubleshooting
523
-
524
- - **The MCP server doesn't show up in my editor:** restart the editor after
525
- adding it. In Claude Code, `claude mcp list` shows whether it's connected.
526
- Check that `node --version` is 22.13 or newer.
527
- - **No terminal opened after "connect":** the agent's reply has the command to
528
- paste, such as `raytrace connect my-box --claude`. On macOS, allow your editor
529
- to control your terminal app in **System Settings → Privacy & Security →
530
- Automation**.
531
- - **The first local sandbox is taking long:** setting up the VM takes a few
532
- minutes. Ask the agent for the sandbox status, or read
533
- `~/.raytrace/logs/mcp-create-<name>-*.log`. The whole VM log is in
534
- `~/.raytrace/logs/sandbox-vm.log`.
535
- - **`sandbox create --local` says the machine isn't ready:** each line says
536
- what's missing and how to fix it; `raytrace doctor` shows the same. Port 8798
537
- in use usually means another Lima VM is running (`limactl list`).
538
- - **A local sandbox's sessions don't show in the dashboard:** restart RayTrace
539
- with `raytrace stop && raytrace start`.
540
- - **The dashboard says this browser isn't signed in:** run `raytrace open`.
541
- - **`Cannot reach RayTrace at https://api.raytracer.si`:** check your
542
- connection. Networks that inspect HTTPS, such as some company Wi-Fi, can block
543
- it.
544
- - **A sandbox isn't found:** `raytrace auth status` shows which account you're
545
- signed in as. Sandboxes belong to the account that made them.
546
-
547
- ## Uninstall
548
-
549
- ```sh
550
- raytrace sandbox destroy <id or name> # any sandboxes you no longer need
551
- raytrace uninstall --purge # local sandboxes: deletes the VM and ~/.raytrace
552
- raytrace auth logout
553
- npm uninstall -g @raytrace-cli/cli # or: pip uninstall raytrace-cli
554
- claude mcp remove raytrace -s user # if you added the MCP server to Claude Code
555
- ```
556
-
557
- Without `--purge`, remove the VM yourself with `limactl delete --force raytrace`.
558
-
559
- ## Developing
560
-
561
- ```sh
562
- npm install
563
- npm run build # dashboard -> dist/dashboard
564
- npm run dashboard:dev # dashboard with hot reload, API from a running RayTrace
565
- npm run typecheck
566
- npm test
567
- node bin/raytrace.mjs <command> # run the CLI from this folder
568
- ```
569
-
570
- To use your checkout as the MCP server in Claude Code:
571
-
572
- ```sh
573
- claude mcp add --scope user raytrace -- node /path/to/raytrace-cli/bin/raytrace.mjs mcp
574
- ```
575
-
576
- To try it without touching your real setup, give it its own home and port:
577
-
578
- ```sh
579
- mkdir -p /tmp/rt && echo RAYTACE_PORT=18797 > /tmp/rt/config.env
580
- RAYTRACE_HOME=/tmp/rt node bin/raytrace.mjs setup --no-claude-code
581
- ```
582
-
583
- ### Publishing to pip
584
-
585
- The pip package is the npm package plus an official Node.js build, one wheel per
586
- platform. After `npm publish`, build the same version's wheels and upload them:
587
-
588
- ```sh
589
- python3 python/build_wheels.py # all six platforms, into python/dist/
590
- twine upload python/dist/*.whl
591
- ```
356
+ ## Command reference, troubleshooting, uninstall
592
357
 
593
- The *pip wheels* workflow builds the same wheels on every `v*` tag and installs
594
- them on Linux, macOS and Windows (x64 and ARM); its `wheels` artifact can be
595
- uploaded instead. The Node.js version is `NODE_VERSION` in `python/build_wheels.py`.
358
+ - [Command reference](docs/commands.md)
359
+ - [Troubleshooting and uninstall](docs/troubleshooting.md)
360
+ - [Set up in your editor (MCP)](docs/mcp.md)
361
+ - [Dashboard](docs/dashboard.md)
362
+ - [Cloud sandboxes](docs/cloud.md)
363
+ - [Contributing](CONTRIBUTING.md)
596
364
 
597
365
  ## License
598
366