getprismo 0.1.44 → 0.1.45
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 +75 -1130
- package/docs/README.md +11 -0
- package/docs/manual.md +1203 -0
- package/lib/prismo-dev/agent.js +33 -0
- package/lib/prismo-dev/cli.js +52 -2
- package/lib/prismo-dev/enforce.js +29 -1
- package/lib/prismo-dev/help.js +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,1196 +4,141 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/getprismo)
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Agent control plane for AI coding.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
npx getprismo doctor
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
that's it. run it on any repo. no api keys, no login, no data leaves your machine. connect it once and it runs itself.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## the problem
|
|
18
|
-
|
|
19
|
-
ai coding agents (claude code, codex, cursor) burn tokens on things that don't help you ship. lockfiles get read into context. old logs get loaded. generated artifacts leak in. sessions balloon to millions of tokens because nothing tells the agent what to ignore.
|
|
20
|
-
|
|
21
|
-
most developers don't realize this is happening until the bill arrives or the agent starts looping.
|
|
22
|
-
|
|
23
|
-
prismodev gives you a control plane for it before, during, and after.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## the loop
|
|
28
|
-
|
|
29
|
-
prismodev covers the full AI coding session:
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
before you code npx getprismo doctor
|
|
33
|
-
while you code npx getprismo guard --watch
|
|
34
|
-
enforce at runtime npx getprismo enforce install
|
|
35
|
-
noisy commands npx getprismo shield -- npm test
|
|
36
|
-
targeted repairs npx getprismo repair auto
|
|
37
|
-
after you code npx getprismo receipt
|
|
38
|
-
postmortem npx getprismo replay
|
|
39
|
-
weekly receipt npx getprismo digest
|
|
40
|
-
workspace agent npx getprismo agent --watch
|
|
41
|
-
agent-native npx getprismo mcp
|
|
42
|
-
optional bridge npx getprismo bridge
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**doctor** diagnoses the repo, applies safe fixes, and shows the before/after score.
|
|
46
|
-
**repair** runs the targeted fix for one waste cause; `repair auto` lets the planner pick.
|
|
47
|
-
**enforce** turns the context firewall into actual runtime enforcement via Claude Code hooks.
|
|
48
|
-
**digest** prints the launch report: verified saved tokens/dollars first, live prevention clearly labeled as estimated, ready to post or paste into Slack.
|
|
49
|
-
**guard** runs live guardrails, context throttle, rescue prompts, context firewall, and dashboard-ready prevention events.
|
|
50
|
-
**watch** monitors context pressure live and is the lower-level diagnostic view behind guard.
|
|
51
|
-
**receipt** explains what repeated, what output dominated, what artifacts leaked, what likely influenced the run, and a heuristic context-efficiency score.
|
|
52
|
-
**replay** reconstructs why a session went sideways and prints a recovery prompt.
|
|
53
|
-
**shield** runs noisy commands without dumping full output back into the agent context.
|
|
54
|
-
**agent** connects Prismo Cloud to your local repo so dashboard actions can safely run on this machine.
|
|
55
|
-
**mcp** exposes PrismoDev as local tools so compatible agents can scan, search shield output, and request scoped context directly.
|
|
56
|
-
**bridge** explains the optional tighter control layer for teams that want Prismo closer to the agent execution path.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## new: the self-driving loop
|
|
61
|
-
|
|
62
|
-
connect once and prismodev operates itself:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
npx getprismo connect --token <your prismo api key>
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
from that point, on every machine running the connector:
|
|
69
|
-
|
|
70
|
-
1. **detect** — session telemetry syncs continuously; waste is attributed to one of five causes: repeated file reads, tool-output floods, generated artifacts, context loops, long-session buildup.
|
|
71
|
-
2. **decide** — a local planner scores causes against thresholds, respects cooldowns, and won't re-repair a cause until enough new sessions arrived to judge the last attempt. the backend auto-queues repairs the same way — no dashboard clicks.
|
|
72
|
-
3. **repair** — each cause has a dedicated executor (not doctor-for-everything): ignore rules + hot-file maps, shield staging, firewall policies, tightened guard budgets, scoped context packs with restart routines.
|
|
73
|
-
4. **verify** — after a repair, the waste rate for that cause is measured in your *later* sessions (14-day baseline, real before/after math). verdicts: `improved`, `no-change`, `regressed`.
|
|
74
|
-
5. **adapt** — `improved` stays mild. `no-change`/`regressed` escalates to an aggressive tier (context firewall + tighter budgets). a cause that fails both tiers is held for your review instead of being retried forever — the one moment a human is genuinely needed, surfaced loudly.
|
|
75
|
-
|
|
76
|
-
savings are reported in **dollars, verified** — converted with a model-aware blended rate weighted across your actual sessions — on the dashboard and via `prismo digest`.
|
|
77
|
-
|
|
78
|
-
and it learns across the fleet: anonymized repair verdicts (counts only, no repo/org identifiers) aggregate into priors, so when the fleet already knows mild repairs rarely fix a cause, your first repair starts at the tier that works. your own verdicts always outrank the fleet's.
|
|
79
|
-
|
|
80
|
-
run one planner cycle by hand to see it think:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
npx getprismo repair auto --dry-run
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## new: runtime enforcement
|
|
89
|
-
|
|
90
|
-
advisory guardrails only help if the agent reads them. for claude code, prismodev can enforce them:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
npx getprismo enforce install
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
this wires a `PreToolUse` hook (with a backup of `.claude/settings.json`) that:
|
|
97
|
-
|
|
98
|
-
- **denies reads into blocked context** — `node_modules/`, build output, logs, lockfiles — with a reason pointing the agent at the compact `.prismo/` context packs instead
|
|
99
|
-
- **denies the fourth attempt of an identical command** in one session, suggesting one shielded run instead of an expensive retry loop
|
|
100
|
-
|
|
101
|
-
```text
|
|
102
|
-
permissionDecision: deny
|
|
103
|
-
reason: Prismo context firewall: "logs/huge.log" is blocked context (rule: logs/**).
|
|
104
|
-
Use the .prismo/ context packs instead, or run `npx getprismo shield -- <command>`
|
|
105
|
-
if you need its contents summarized.
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
enforcement fails open — malformed events or missing policy files allow the call, so it can never break a working agent. `enforce uninstall` removes only the prismo hook. other agents keep following the advisory `.prismo` files.
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## new: optional bridge mode
|
|
113
|
-
|
|
114
|
-
the background connector is the default. it observes local sessions, syncs safe aggregate telemetry, applies queued repairs, verifies the next sessions, and shows live events in the dashboard. it does not sit in front of every agent action.
|
|
115
|
-
|
|
116
|
-
bridge mode is optional context for teams that want Prismo closer to the agent execution path, especially for live loop stopping:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
npx getprismo bridge
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
- **Claude Code**: hard-block capable today through `npx getprismo enforce install`, which adds a `PreToolUse` hook that can deny blocked-context reads and repeated command loops before they run.
|
|
123
|
-
- **Codex**: visible and repairable through local session logs, guardrails, shield, and MCP. universal hard-blocking needs Codex to run through a wrapper/bridge or expose a pre-tool hook.
|
|
124
|
-
- **Cursor**: visible and repairable through local telemetry and staged repairs. universal hard-blocking needs Cursor to run through a wrapper/bridge or expose a pre-tool hook.
|
|
125
|
-
|
|
126
|
-
that is why Prismo is not described as a proxy by default. connector mode is safer and simpler; bridge mode is the opt-in path when stronger live interception matters more than staying fully out of the agent execution path.
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## what prismodev catches
|
|
131
|
-
|
|
132
|
-
- missing `.claudeignore` / `.cursorignore` (the biggest single fix for most repos)
|
|
133
|
-
- lockfiles entering context (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`)
|
|
134
|
-
- generated artifacts leaking in (`__pycache__`, `dist/`, `coverage/`, `.next/`)
|
|
135
|
-
- operational source-stream dumps leaking in (`events/`, `source-streams/`, inbox/calendar/GitHub JSONL exports)
|
|
136
|
-
- oversized instruction files (`CLAUDE.md` or `AGENTS.md` over 500 tokens)
|
|
137
|
-
- tool output dominating sessions (repeated reads, large command output)
|
|
138
|
-
- long-running sessions with stale context accumulation
|
|
139
|
-
- repeated file reads (same file loaded 100+ times in one session)
|
|
140
|
-
- repeated commands (agent running the same command in a loop)
|
|
141
|
-
- high context risk sessions that should have been split at task boundaries
|
|
142
|
-
- session-derived ignore candidates from actual Claude/Codex logs (`logs/debug.log`, `dist/app.js`, `package-lock.json`, source-stream dumps)
|
|
143
|
-
|
|
144
|
-
---
|
|
145
|
-
|
|
146
|
-
## real output: doctor
|
|
147
|
-
|
|
148
|
-
run `npx getprismo doctor` on any repo. here's what it looks like on a real project:
|
|
149
|
-
|
|
150
|
-
```
|
|
151
|
-
PrismoDev Doctor
|
|
152
|
-
|
|
153
|
-
Before: 79/100 - Medium risk - 5 token leaks
|
|
154
|
-
After: 91/100 - Low risk - 3 token leaks (+12)
|
|
155
|
-
Local usage: 976k tokens across 3 recent session(s)
|
|
156
|
-
Estimated exposed context reduction: 100%
|
|
157
|
-
Payoff: repo is 12 points cleaner for AI coding sessions
|
|
158
|
-
|
|
159
|
-
Fixed:
|
|
160
|
-
- Created .claudeignore
|
|
161
|
-
- Created .cursorignore
|
|
162
|
-
- Generated prismo-dev-report.md
|
|
163
|
-
- Generated .prismo/architecture-summary.md
|
|
164
|
-
- Generated .prismo/recommended-CLAUDE.boilerplate.md
|
|
165
|
-
- Generated .prismo/recommended-AGENTS.boilerplate.md
|
|
166
|
-
- Generated .prismo/recommended-.claudeignore
|
|
167
|
-
- Generated .prismo/recommended-.cursorignore
|
|
168
|
-
- Generated .prismo/recommended-.gitignore-additions
|
|
169
|
-
- Generated .prismo/backend-summary.md
|
|
170
|
-
- Generated .prismo/frontend-summary.md
|
|
171
|
-
|
|
172
|
-
Still Risky:
|
|
173
|
-
- Tool output/context contributed about 319k tokens
|
|
174
|
-
- 1 recent session reached high context risk
|
|
175
|
-
|
|
176
|
-
Recommended starting context:
|
|
177
|
-
.prismo/frontend-context.md
|
|
178
|
-
|
|
179
|
-
Next:
|
|
180
|
-
1. npx getprismo context frontend
|
|
181
|
-
2. npx getprismo watch --once
|
|
182
|
-
3. npx getprismo cc
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
doctor went from 79 to 91 in one run. the repo now has proper ignore files, compact context packs, and a clear starting point for the next coding session.
|
|
186
|
-
|
|
187
|
-
`scan --usage` and `doctor` can also turn real session leaks into concrete ignore suggestions. if local Claude/Codex logs show `logs/debug.log`, `dist/app.js`, `package-lock.json`, source-stream dumps, or other noisy files repeatedly entering context, prismodev adds conservative `.claudeignore` / `.cursorignore` candidate rules instead of only reporting the problem.
|
|
188
|
-
|
|
189
|
-
when you want PrismoDev to apply those ignore suggestions directly, use `npx getprismo doctor --apply-suggestions`. it appends only missing rules, writes `.claudeignore.prismo-backup` / `.cursorignore.prismo-backup` first, and still does not touch `CLAUDE.md`, `AGENTS.md`, `.gitignore`, or source code.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## real output: watch
|
|
194
|
-
|
|
195
|
-
run `npx getprismo watch` during a coding session. it monitors context pressure in real time:
|
|
196
|
-
|
|
197
|
-
```
|
|
198
|
-
Prismo Watch
|
|
199
|
-
|
|
200
|
-
Context Pressure: HIGH
|
|
201
|
-
Session Size: 707k tokens (exact-local-log)
|
|
202
|
-
Recent Growth: +0 tokens
|
|
203
|
-
Tool Output: 237k tokens
|
|
204
|
-
Turns: 102 | Tool calls: 774
|
|
205
|
-
Model: gpt-5.5
|
|
206
|
-
|
|
207
|
-
Warnings
|
|
208
|
-
- Context risk is high; consider starting a fresh session.
|
|
209
|
-
- Tool/output tokens are dominating this session.
|
|
210
|
-
- lib/prismo-dev-scan.js appears repeatedly in context (286x).
|
|
211
|
-
- node bin/prismo.js appears repeatedly in context (85x).
|
|
212
|
-
- lockfiles likely entered active context (60 mentions).
|
|
213
|
-
|
|
214
|
-
Do This Now
|
|
215
|
-
Cause: tool-output-flood (high confidence)
|
|
216
|
-
Tool/output tokens are dominating this session (237k tokens).
|
|
217
|
-
1. Stop loading full logs or broad command output.
|
|
218
|
-
2. Rerun failing commands with tight filters or short ranges.
|
|
219
|
-
3. Ask the agent to summarize current errors before reading more files.
|
|
220
|
-
Rescue: npx getprismo watch --rescue
|
|
221
|
-
|
|
222
|
-
Signals
|
|
223
|
-
- Repeated file: lib/prismo-dev-scan.js (286x)
|
|
224
|
-
- Repeated file: node bin/prismo.js (85x)
|
|
225
|
-
- Generated artifacts: lockfiles (60 mentions)
|
|
226
|
-
- Generated artifacts: __pycache__ (47 mentions)
|
|
227
|
-
|
|
228
|
-
Suggested Action
|
|
229
|
-
Run: npx getprismo doctor
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
watch caught lockfiles entering context, a file being read 286 times, and tool output dominating the session. without this, you'd never know.
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
|
-
## new: optimizer fit
|
|
237
|
-
|
|
238
|
-
not every token optimizer solves the same bottleneck. before stacking compression proxies, repo packers, code indexes, and MCP tools, run:
|
|
239
|
-
|
|
240
|
-
```bash
|
|
241
|
-
npx getprismo scan --optimizer-fit
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
PrismoDev scores your actual repo/session signals and recommends the right path:
|
|
245
|
-
|
|
246
|
-
```text
|
|
247
|
-
Prismo Optimizer Fit
|
|
248
|
-
|
|
249
|
-
Primary bottleneck: Generated artifacts / ignore cleanup: HIGH
|
|
250
|
-
|
|
251
|
-
Bottlenecks
|
|
252
|
-
- Generated artifacts / ignore cleanup: High
|
|
253
|
-
.claudeignore is missing
|
|
254
|
-
- Oversized command/tool output: Medium
|
|
255
|
-
237k tool/output tokens found in local sessions
|
|
256
|
-
- Repeated source exploration: Low
|
|
257
|
-
Repo/source exploration does not look like the main bottleneck
|
|
258
|
-
|
|
259
|
-
Recommended Stack
|
|
260
|
-
1. Apply safe ignore/context fixes first.
|
|
261
|
-
Run: npx getprismo doctor --apply-suggestions --dry-run
|
|
262
|
-
Category: ignore cleanup (.claudeignore, .cursorignore)
|
|
263
|
-
2. Sandbox noisy command output before adding more code-indexing tools.
|
|
264
|
-
Run: npx getprismo shield -- <noisy command>
|
|
265
|
-
Category: output sandboxing (Prismo shield, context-mode, RTK, tokf, distill)
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
This makes PrismoDev the measure-first layer: it tells you whether you need ignore cleanup, output sandboxing, code indexing, repo packing, instruction trimming, session splitting, or MCP/tool hygiene.
|
|
269
|
-
|
|
270
|
-
For the short version:
|
|
271
|
-
|
|
272
|
-
```bash
|
|
273
|
-
npx getprismo scan --report-card
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
That prints the simplest decision:
|
|
277
|
-
|
|
278
|
-
```text
|
|
279
|
-
PrismoDev Report Card
|
|
280
|
-
|
|
281
|
-
Biggest waste: Generated artifacts / ignore cleanup: High
|
|
282
|
-
Start with: npx getprismo doctor --apply-suggestions --dry-run
|
|
283
|
-
Then: npx getprismo shield -- <noisy command>
|
|
284
|
-
Code index needed: not yet
|
|
285
|
-
Round-trip risk: Low
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
To benchmark a noisy command:
|
|
289
|
-
|
|
290
|
-
```bash
|
|
291
|
-
npx getprismo benchmark -- npm test
|
|
292
|
-
npx getprismo benchmark session
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
`benchmark -- <command>` measures raw command output tokens versus the compact shield summary. `benchmark session` summarizes recent local Claude/Codex sessions, including round-trip context signals like tool calls, repeated commands, repeated source reads, and MCP/tool surface.
|
|
296
|
-
|
|
297
|
-
---
|
|
298
|
-
|
|
299
|
-
## new: context shield
|
|
300
|
-
|
|
301
|
-
if you know a command may dump huge output, run it through prismo:
|
|
302
|
-
|
|
303
|
-
```bash
|
|
304
|
-
npx getprismo shield -- npm test
|
|
305
|
-
npx getprismo shield -- pytest -q
|
|
306
|
-
npx getprismo shield -- npm run build
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
shield executes the command locally, stores full stdout/stderr under `.prismo/shield/runs/`, indexes the output in `.prismo/shield/shield.sqlite` using SQLite FTS5 when available, and prints only a compact summary plus useful error lines.
|
|
310
|
-
|
|
311
|
-
this is the lightweight context-sandbox layer: the full output stays on disk until you explicitly inspect it, instead of being pasted into the model context and re-sent every turn.
|
|
312
|
-
|
|
313
|
-
example:
|
|
314
|
-
|
|
315
|
-
```text
|
|
316
|
-
Prismo Shield
|
|
317
|
-
|
|
318
|
-
Command: npm test
|
|
319
|
-
Exit: 1
|
|
320
|
-
Captured: 186 KB (~46,500 tokens kept out of chat)
|
|
321
|
-
|
|
322
|
-
Full Output Stored:
|
|
323
|
-
- .prismo/shield/runs/2026-05-20T.../stdout.txt
|
|
324
|
-
- .prismo/shield/runs/2026-05-20T.../stderr.txt
|
|
325
|
-
- .prismo/shield/shield.sqlite
|
|
326
|
-
|
|
327
|
-
Summary Returned To Context:
|
|
328
|
-
- ERROR: auth.test.ts expected 200 received 401
|
|
329
|
-
- FAIL src/auth/session.test.ts
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
search previous shield output without reloading whole logs:
|
|
333
|
-
|
|
334
|
-
```bash
|
|
335
|
-
npx getprismo shield last
|
|
336
|
-
npx getprismo shield search "auth expected 200"
|
|
337
|
-
npx getprismo shield search "AUTH_FAILURE" --json
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
when `watch` detects tool-output floods or repeated command loops, it now recommends this flow directly:
|
|
341
|
-
|
|
342
|
-
```text
|
|
343
|
-
Shield Plan
|
|
344
|
-
Run: npx getprismo shield -- <noisy command>
|
|
345
|
-
Then: npx getprismo shield search "<error text>"
|
|
346
|
-
MCP: prismo_shield_run -> prismo_shield_search
|
|
347
|
-
```
|
|
348
|
-
|
|
349
|
-
this is intentionally not magic interception yet. it is a safe local-first primitive you can tell agents to use for noisy commands.
|
|
350
|
-
|
|
351
|
-
---
|
|
352
|
-
|
|
353
|
-
## workspace agent
|
|
354
|
-
|
|
355
|
-
Prismo Cloud can guide the work from the dashboard, but your repo still lives on your machine. `agent` is the local bridge.
|
|
356
|
-
|
|
357
|
-
```bash
|
|
358
|
-
npx getprismo connect --token <your Prismo API key>
|
|
359
|
-
npx getprismo agent --watch
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
After that, the Prismo workspace can queue safe actions like `doctor`, `sync`, `guard`, `context`, `optimize`, and allowlisted `shield` commands. The local agent claims those actions, executes them in the selected repo, and reports the status back to Prismo Cloud.
|
|
363
|
-
|
|
364
|
-
This keeps the product flow simple:
|
|
365
|
-
|
|
366
|
-
```text
|
|
367
|
-
dashboard recommends fix -> local agent runs safe command -> dashboard refreshes with the result
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
`agent` does not upload prompts, source code, file contents, stdout, stderr, or full command logs. It uploads action status and safe aggregate metrics. Cloud actions are intentionally limited; arbitrary shell commands and shell metacharacters are rejected.
|
|
371
|
-
|
|
372
|
-
For CI-style polling or debugging, run one pass:
|
|
373
|
-
|
|
374
|
-
```bash
|
|
375
|
-
npx getprismo agent --once
|
|
376
|
-
npx getprismo agent --once --json
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
---
|
|
380
|
-
|
|
381
|
-
## new: live guardrails mode
|
|
382
|
-
|
|
383
|
-
the easiest proactive mode is guard:
|
|
384
|
-
|
|
385
|
-
```bash
|
|
386
|
-
npx getprismo connect --token <your Prismo API key>
|
|
387
|
-
npx getprismo guard --watch
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
`guard` packages the local prevention loop: live guardrails, context throttling, context firewall updates, guard event history, and dashboard-ready prevention events. it never uploads prompts, source code, file contents, stdout, stderr, or full command logs.
|
|
391
|
-
|
|
392
|
-
run it once for a snapshot:
|
|
393
|
-
|
|
394
|
-
```bash
|
|
395
|
-
npx getprismo guard
|
|
396
|
-
npx getprismo guard --json
|
|
397
|
-
npx getprismo guard --no-sync
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
the lower-level watch mode is:
|
|
401
|
-
|
|
402
|
-
```bash
|
|
403
|
-
npx getprismo watch --auto
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
`--auto` turns on live guardrails, live context throttling, event logging, and a default 600k session budget. it writes:
|
|
407
|
-
|
|
408
|
-
```text
|
|
409
|
-
.prismo/live-guardrails.md
|
|
410
|
-
.prismo/live-context-throttle.md
|
|
411
|
-
.prismo/live-rescue-prompt.md
|
|
412
|
-
.prismo/watch-events.jsonl
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
if you want prismodev to keep updating instructions while the session runs, use:
|
|
416
|
-
|
|
417
|
-
```bash
|
|
418
|
-
npx getprismo watch --guardrails
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
this writes and continuously updates:
|
|
422
|
-
|
|
423
|
-
```text
|
|
424
|
-
.prismo/live-guardrails.md
|
|
425
|
-
.prismo/live-rescue-prompt.md
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
the idea is simple: tell your coding agent once at the start of the session:
|
|
429
|
-
|
|
430
|
-
```text
|
|
431
|
-
follow .prismo/live-guardrails.md during this session.
|
|
432
|
-
```
|
|
433
|
-
|
|
434
|
-
then keep `watch --guardrails` running. when prismodev detects tool-output floods, artifact leaks, repeated reads, loops, or context spikes, it updates the guardrails file with the current issue and the exact behavior the agent should follow next.
|
|
435
|
-
|
|
436
|
-
example guardrails:
|
|
437
|
-
|
|
438
|
-
```md
|
|
439
|
-
# Prismo Live Guardrails
|
|
440
|
-
|
|
441
|
-
Context pressure: High
|
|
442
|
-
Current issue: tool-output-flood
|
|
443
|
-
Confidence: high
|
|
444
|
-
|
|
445
|
-
## Effective Immediately
|
|
446
|
-
|
|
447
|
-
- Stop loading full logs or broad command output.
|
|
448
|
-
- Rerun failing commands with tight filters or short ranges.
|
|
449
|
-
- Ask the agent to summarize current errors before reading more files.
|
|
450
|
-
- Do not read generated artifacts, lockfiles, caches, build output, coverage, or logs unless explicitly required.
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
this does not secretly control claude code or codex internals. it gives the agent a live-updating instruction file to follow, which is the safest local-first way to reduce token waste without requiring an IDE extension or agent plugin.
|
|
454
|
-
|
|
455
|
-
---
|
|
456
|
-
|
|
457
|
-
## new: live rescue mode
|
|
458
|
-
|
|
459
|
-
when `watch` detects a session going sideways, run:
|
|
460
|
-
|
|
461
|
-
```bash
|
|
462
|
-
npx getprismo watch --rescue
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
it prints a paste-ready rescue prompt for the current ai coding session:
|
|
466
|
-
|
|
467
|
-
```text
|
|
468
|
-
Prismo Rescue Prompt
|
|
469
|
-
|
|
470
|
-
Paste this into the current AI coding session:
|
|
471
|
-
|
|
472
|
-
We are in a high-context AI coding session. Stop broad exploration and recover state before doing more work.
|
|
473
|
-
|
|
474
|
-
Current Prismo signal: tool-output-flood (high confidence).
|
|
475
|
-
Summary: Tool/output tokens are dominating this session (264k tokens).
|
|
476
|
-
Context pressure: High. Session size: 1.11M tokens. Tool output: 264k tokens.
|
|
477
|
-
|
|
478
|
-
Do this now:
|
|
479
|
-
1. Stop loading full logs or broad command output.
|
|
480
|
-
2. Rerun failing commands with tight filters or short ranges.
|
|
481
|
-
3. Ask the agent to summarize current errors before reading more files.
|
|
482
|
-
|
|
483
|
-
Before reading or editing anything else, summarize:
|
|
484
|
-
- files changed so far
|
|
485
|
-
- exact failing command or error
|
|
486
|
-
- current hypothesis
|
|
487
|
-
- next smallest file/test to inspect
|
|
488
|
-
|
|
489
|
-
Do not re-read these files unless they changed.
|
|
490
|
-
Do not read generated/noisy artifacts unless explicitly required.
|
|
491
|
-
```
|
|
492
|
-
|
|
493
|
-
`watch --rescue --json` includes the same prompt as `rescuePrompt`, plus the structured live action:
|
|
494
|
-
|
|
495
|
-
```json
|
|
496
|
-
{
|
|
497
|
-
"live": {
|
|
498
|
-
"contextPressure": "High",
|
|
499
|
-
"liveAction": {
|
|
500
|
-
"cause": "tool-output-flood",
|
|
501
|
-
"confidence": "high",
|
|
502
|
-
"summary": "Tool/output tokens are dominating this session.",
|
|
503
|
-
"rescueAvailable": true
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
```
|
|
508
|
-
|
|
509
|
-
live action causes include:
|
|
510
|
-
|
|
511
|
-
- `tool-output-flood`
|
|
512
|
-
- `artifact-leak`
|
|
513
|
-
- `possible-loop`
|
|
514
|
-
- `repeated-file-read`
|
|
515
|
-
- `context-spike`
|
|
516
|
-
- `high-context-pressure`
|
|
517
|
-
|
|
518
|
-
this is the proactive part of prismodev: it does not just tell you something is expensive. it tells you what to do **right now** while the session is still recoverable.
|
|
519
|
-
|
|
520
|
-
use `--guardrails` when you want files to update automatically during the session. use `--rescue` when you want a one-shot prompt to paste immediately.
|
|
521
|
-
|
|
522
|
-
---
|
|
523
|
-
|
|
524
|
-
## new: live context throttle
|
|
525
|
-
|
|
526
|
-
if you want prismodev to enforce a session budget while you work, run:
|
|
9
|
+
Prismo watches local Codex, Claude Code, and Cursor sessions, finds wasted agent context, applies safe interventions, and verifies whether those interventions actually saved tokens and dollars in later sessions.
|
|
527
10
|
|
|
528
11
|
```bash
|
|
529
|
-
npx getprismo
|
|
530
|
-
```
|
|
531
|
-
|
|
532
|
-
this writes:
|
|
533
|
-
|
|
534
|
-
```text
|
|
535
|
-
.prismo/live-context-throttle.md
|
|
536
|
-
```
|
|
537
|
-
|
|
538
|
-
when the active session gets near or crosses the budget, watch turns that into a live action:
|
|
539
|
-
|
|
540
|
-
```text
|
|
541
|
-
Cause: token-budget-exceeded
|
|
542
|
-
Stop broad exploration.
|
|
543
|
-
Summarize current state before more file reads.
|
|
544
|
-
Start a fresh scoped session at the next task boundary.
|
|
12
|
+
npx getprismo protect
|
|
545
13
|
```
|
|
546
14
|
|
|
547
|
-
|
|
15
|
+
That one command turns on the useful stack for a repo:
|
|
548
16
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
17
|
+
- safe ignore rules and compact context packs
|
|
18
|
+
- Claude Code runtime enforcement when hooks are available
|
|
19
|
+
- loop and context-waste protection
|
|
20
|
+
- connector-driven repair and verification when connected to Prismo Cloud
|
|
552
21
|
|
|
553
|
-
|
|
22
|
+
## Why
|
|
554
23
|
|
|
555
|
-
|
|
24
|
+
AI coding agents waste real money and time on context that does not help them ship:
|
|
556
25
|
|
|
557
|
-
|
|
26
|
+
- full test/build logs entering chat
|
|
27
|
+
- lockfiles, build output, coverage, and caches getting read
|
|
28
|
+
- the same files being opened again and again
|
|
29
|
+
- retry loops that keep running the same failing command
|
|
30
|
+
- long sessions carrying stale context across tasks
|
|
558
31
|
|
|
559
|
-
|
|
560
|
-
npx getprismo watch --auto --no-events
|
|
561
|
-
```
|
|
32
|
+
Prismo turns those patterns into controls, then measures the result.
|
|
562
33
|
|
|
563
|
-
|
|
34
|
+
## What Gets Measured
|
|
564
35
|
|
|
565
|
-
|
|
36
|
+
The launch report is built around proof, not vibes:
|
|
566
37
|
|
|
567
|
-
|
|
38
|
+
- **Verified saved**: tokens and dollars saved after later sessions prove waste dropped
|
|
39
|
+
- **Live prevented**: estimated tokens blocked before they entered context
|
|
40
|
+
- **Proactivity**: live detections, interventions, and loop stops while coding
|
|
41
|
+
- **Still measuring**: interventions waiting for enough later sessions to verify impact
|
|
42
|
+
- **Top cause**: the waste pattern causing the most damage
|
|
568
43
|
|
|
569
44
|
```bash
|
|
570
|
-
npx getprismo
|
|
45
|
+
npx getprismo digest
|
|
571
46
|
```
|
|
572
47
|
|
|
573
|
-
|
|
48
|
+
Example output:
|
|
574
49
|
|
|
575
50
|
```text
|
|
576
|
-
.
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
.
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
example:
|
|
585
|
-
|
|
586
|
-
```text
|
|
587
|
-
Allowed first:
|
|
588
|
-
- .prismo/architecture-summary.md
|
|
589
|
-
- .prismo/backend-summary.md
|
|
590
|
-
- backend/app/*/auth/*
|
|
591
|
-
|
|
592
|
-
Blocked unless justified:
|
|
593
|
-
- node_modules/**
|
|
594
|
-
- .next/**
|
|
595
|
-
- dist/**
|
|
596
|
-
- coverage/**
|
|
597
|
-
- package-lock.json
|
|
598
|
-
```
|
|
599
|
-
|
|
600
|
-
`watch --auto` also updates `.prismo/context-firewall.md` when it detects live waste, so the active session gets a tighter context policy as pressure rises.
|
|
601
|
-
|
|
602
|
-
---
|
|
603
|
-
|
|
604
|
-
## real output: cc timeline
|
|
605
|
-
|
|
606
|
-
run `npx getprismo cc timeline` after a session to understand what happened:
|
|
607
|
-
|
|
608
|
-
```
|
|
609
|
-
Prismo Claude Code Cost
|
|
610
|
-
|
|
611
|
-
Session: 7689982e-42a3-44fb-9734-2588e5e01145
|
|
612
|
-
Model: claude-opus-4-6
|
|
613
|
-
|
|
614
|
-
Timeline
|
|
615
|
-
05:24 PM Generated artifact likely entered context package-lock.json (2x)
|
|
616
|
-
05:24 PM Generated artifact likely entered context logs/debug-output.json (1x)
|
|
617
|
-
05:24 PM Repeated file/path context CLAUDE.md (8x)
|
|
618
|
-
05:24 PM Repeated file/path context AGENTS.md (8x)
|
|
619
|
-
05:24 PM Repeated file/path context node bin/prismo.js (6x)
|
|
620
|
-
|
|
621
|
-
Suggested Action
|
|
622
|
-
Run npx getprismo optimize, then start from .prismo/architecture-summary.md.
|
|
623
|
-
```
|
|
624
|
-
|
|
625
|
-
timeline shows exactly what leaked, what repeated, and what to do differently next time.
|
|
626
|
-
|
|
627
|
-
to turn a postmortem into a safer next-session policy, run:
|
|
628
|
-
|
|
629
|
-
```bash
|
|
630
|
-
npx getprismo cc timeline --firewall --task auth-bug
|
|
51
|
+
Prismo controlled 21 AI coding session(s) over 7 day(s).
|
|
52
|
+
Verified saved: ~0 tokens / $0.00.
|
|
53
|
+
Live prevented: ~0 tokens / $0.00 estimated.
|
|
54
|
+
Proactivity: 2 live control event(s), 65 intervention(s) or loop stop(s).
|
|
55
|
+
Interventions: 65 completed, 0 verified improved, 3 still measuring.
|
|
56
|
+
Context observed: 620,000 tokens; pre-control opportunity: ~286,000 tokens.
|
|
57
|
+
Top cause: Tool-output floods (~286,000 tokens).
|
|
631
58
|
```
|
|
632
59
|
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
---
|
|
636
|
-
|
|
637
|
-
## how doctor improves a repo
|
|
638
|
-
|
|
639
|
-
doctor does four things in sequence:
|
|
640
|
-
|
|
641
|
-
1. **scans** the repo and reads local codex/claude code session logs
|
|
642
|
-
2. **applies safe fixes** — creates `.claudeignore`, `.cursorignore`, generates recommendation templates
|
|
643
|
-
3. **generates context packs** — compact `.prismo/` files that give agents focused context instead of reading everything
|
|
644
|
-
4. **re-scans** and shows the before/after score
|
|
645
|
-
|
|
646
|
-
what doctor creates:
|
|
647
|
-
|
|
648
|
-
```
|
|
649
|
-
.claudeignore blocks waste from claude code
|
|
650
|
-
.cursorignore blocks waste from cursor
|
|
651
|
-
.prismo/architecture-summary.md compact project overview for agents
|
|
652
|
-
.prismo/backend-summary.md backend-specific context
|
|
653
|
-
.prismo/frontend-summary.md frontend-specific context
|
|
654
|
-
.prismo/recommended-CLAUDE.boilerplate.md CLAUDE.md boilerplate reference; do not overwrite curated files
|
|
655
|
-
.prismo/recommended-AGENTS.boilerplate.md AGENTS.md boilerplate reference; do not overwrite curated files
|
|
656
|
-
.prismo/recommended-.claudeignore full recommended ignore list
|
|
657
|
-
.prismo/recommended-.cursorignore full recommended ignore list
|
|
658
|
-
.prismo/recommended-.gitignore-additions things your gitignore might be missing
|
|
659
|
-
prismo-dev-report.md full diagnostic report
|
|
660
|
-
```
|
|
661
|
-
|
|
662
|
-
if an existing `.claudeignore` or `.cursorignore` already covers prismo's recommendations, doctor skips the suggested ignore file instead of creating redundant noise. the default recommendations include common project state, local db, export, credential, and token patterns such as `*_state.json`, `*_tokens.json`, `*_export.json`, `*.sqlite`, `models/`, and `state-backups/`.
|
|
663
|
-
|
|
664
|
-
backend and frontend summaries include load-bearing candidates ranked by import references, text-reference signals, recent git touches when available, and file size, not just directory listings.
|
|
665
|
-
|
|
666
|
-
prismo also flags source-stream dumps separately from normal build artifacts. large inbox/calendar/github/event payload files are treated as operational noise because they often get summarized once, written near the repo, and then accidentally re-read by later coding sessions.
|
|
667
|
-
|
|
668
|
-
what doctor never touches:
|
|
669
|
-
|
|
670
|
-
- your real `CLAUDE.md`
|
|
671
|
-
- your real `AGENTS.md`
|
|
672
|
-
- your `.gitignore`
|
|
673
|
-
- any source code
|
|
674
|
-
- any config files
|
|
675
|
-
|
|
676
|
-
it only creates new files and recommendations. you decide what to apply.
|
|
677
|
-
|
|
678
|
-
---
|
|
679
|
-
|
|
680
|
-
## cursor session tracking
|
|
681
|
-
|
|
682
|
-
prismodev now reads cursor's local sqlite databases directly. cursor stores data differently from claude code and codex, no jsonl session logs, but it has its own tracking databases with unique data.
|
|
683
|
-
|
|
684
|
-
```bash
|
|
685
|
-
npx getprismo cursor # summary of all cursor sessions
|
|
686
|
-
npx getprismo cursor list # list composer sessions with modes and models
|
|
687
|
-
npx getprismo cursor authorship # ai vs human code authorship from scored commits
|
|
688
|
-
npx getprismo cursor timeline # timeline of ai activity across commits and files
|
|
689
|
-
npx getprismo cursor files # ai-generated and ai-deleted file tracking
|
|
690
|
-
npx getprismo cursor --json # machine-readable output
|
|
691
|
-
```
|
|
692
|
-
|
|
693
|
-
cursor tracks something claude code and codex can't: per-commit ai authorship. every commit is scored with how many lines came from composer (agent), tab completions, and human typing. prismodev surfaces this as an authorship percentage.
|
|
694
|
-
|
|
695
|
-
```
|
|
696
|
-
AI Authorship (from Cursor scored commits)
|
|
697
|
-
|
|
698
|
-
Commits analyzed: 47
|
|
699
|
-
Total lines added: 3812
|
|
700
|
-
|
|
701
|
-
Composer (agent): 2104 lines
|
|
702
|
-
Tab completions: 891 lines
|
|
703
|
-
Human: 817 lines
|
|
704
|
-
--------------------------------------------------
|
|
705
|
-
AI authorship: 78%
|
|
706
|
-
```
|
|
707
|
-
|
|
708
|
-
prismodev also tracks ai-generated files cursor is watching, files cursor deleted, conversation summaries, and model usage distribution across sessions.
|
|
709
|
-
|
|
710
|
-
what cursor can't do vs claude code: cursor doesn't expose per-message token counts, exact api costs, or full conversation transcripts in its local data. that means live context pressure, loop detection, exact cost breakdowns, cache savings analysis, and shield don't apply the same way. this is a cursor limitation. prismodev gets about 60-65% feature parity with cursor compared to claude code/codex.
|
|
711
|
-
|
|
712
|
-
what cursor gives you that the others don't: ai authorship percentages per commit, tab vs composer vs human line counts, conversation summaries with tldr, and ai-generated file tracking with churn detection.
|
|
713
|
-
|
|
714
|
-
the `prismo_cursor_sessions` mcp tool exposes all of this to compatible agents.
|
|
715
|
-
|
|
716
|
-
`scan` and `doctor` now detect cursor's tracking database automatically and flag ai-generated files still present in the repo.
|
|
717
|
-
|
|
718
|
-
---
|
|
719
|
-
|
|
720
|
-
## run receipts and incident replay
|
|
721
|
-
|
|
722
|
-
`receipt` turns recent local sessions into a plain-English run receipt:
|
|
60
|
+
## Core Commands
|
|
723
61
|
|
|
724
62
|
```bash
|
|
725
|
-
npx getprismo
|
|
726
|
-
npx getprismo
|
|
63
|
+
npx getprismo doctor # diagnose and apply safe repo fixes
|
|
64
|
+
npx getprismo protect # one-command protection for this repo
|
|
65
|
+
npx getprismo shield -- npm test # keep noisy command output out of agent context
|
|
66
|
+
npx getprismo enforce install # Claude Code runtime context/loop enforcement
|
|
67
|
+
npx getprismo agent --watch # run the local repair/verification agent
|
|
68
|
+
npx getprismo digest # launch report with verified savings
|
|
727
69
|
```
|
|
728
70
|
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
`replay` is the postmortem view:
|
|
732
|
-
|
|
733
|
-
```bash
|
|
734
|
-
npx getprismo replay
|
|
735
|
-
```
|
|
71
|
+
Full command docs: [docs/manual.md](docs/manual.md).
|
|
736
72
|
|
|
737
|
-
|
|
73
|
+
## Cloud Connector
|
|
738
74
|
|
|
739
|
-
|
|
75
|
+
Local-only mode works without login:
|
|
740
76
|
|
|
741
77
|
```bash
|
|
742
|
-
npx getprismo timeline --last 20
|
|
743
|
-
```
|
|
744
|
-
|
|
745
|
-
it surfaces recurring waste patterns such as the same lockfile leaking into many sessions, the same source file being repeatedly reread, or several sessions crossing high context pressure.
|
|
746
|
-
|
|
747
|
-
`instructions audit` looks at persistent rules:
|
|
748
|
-
|
|
749
|
-
```bash
|
|
750
|
-
npx getprismo instructions audit
|
|
751
|
-
npx getprismo instructions ablate --dry-run
|
|
752
|
-
npx getprismo instructions apply --dry-run
|
|
753
|
-
```
|
|
754
|
-
|
|
755
|
-
it scores rules in `CLAUDE.md`, `AGENTS.md`, `.codex/AGENTS.md`, `.codex/instructions.md`, and `.openai/instructions.md`, then separates observable violations, partial compliance, duplicated rules, trim candidates, and influence-unknown rules. `instructions ablate --dry-run` creates a conservative ablation plan with candidates, sample-count guidance, rollback notes, and variance warnings; it does not edit files. `instructions apply` safely removes exact duplicate instruction lines only, writes backups first, and leaves uncertain rules as recommendations.
|
|
756
|
-
|
|
757
|
-
`boundaries` checks parallel-agent isolation:
|
|
758
|
-
|
|
759
|
-
```bash
|
|
760
|
-
npx getprismo boundaries
|
|
761
|
-
```
|
|
762
|
-
|
|
763
|
-
it reports whether visible local agents are overlapping on the same files, leaking the same artifacts, or running noisy sessions that should move into shield or separate worktrees.
|
|
764
|
-
|
|
765
|
-
---
|
|
766
|
-
|
|
767
|
-
## how watch catches waste live
|
|
768
|
-
|
|
769
|
-
watch reads local session logs from codex, claude code, and cursor. it detects:
|
|
770
|
-
|
|
771
|
-
| signal | what it means |
|
|
772
|
-
|--------|--------------|
|
|
773
|
-
| context pressure HIGH | session is consuming too many tokens |
|
|
774
|
-
| repeated file 286x | agent keeps re-reading the same file |
|
|
775
|
-
| lockfiles entered context | `package-lock.json` got loaded (pure waste) |
|
|
776
|
-
| tool output dominating | agent output is larger than actual code context |
|
|
777
|
-
| loop suspicion | agent may be stuck in a command loop |
|
|
778
|
-
| recent growth +380k | context just spiked by 380k tokens |
|
|
779
|
-
|
|
780
|
-
watch tells you the single most useful action to take right now. usually: start a fresh session, or switch to a scoped context pack.
|
|
781
|
-
|
|
782
|
-
if you run multiple agents in the same repo, use:
|
|
783
|
-
|
|
784
|
-
```bash
|
|
785
|
-
npx getprismo watch --agents
|
|
786
|
-
```
|
|
787
|
-
|
|
788
|
-
multi-agent watch shows every visible local Codex/Claude Code session for the repo, ranks each agent by context pressure, and flags coordination risks like two agents repeatedly loading the same file, shared artifact leaks, multiple high-pressure sessions, or agents that should move noisy commands into `shield`.
|
|
789
|
-
|
|
790
|
-
the same multi-agent coordination signal is included in `usage --json`, `scan --usage --json`, doctor output, and the generated markdown report whenever multiple local sessions are visible for the repo.
|
|
791
|
-
|
|
792
|
-
`watch --rescue` prints a paste-ready prompt for the active coding session. use it when the agent is looping, reading too many files, or flooding context with logs:
|
|
793
|
-
|
|
794
|
-
```bash
|
|
795
|
-
npx getprismo watch --rescue
|
|
796
|
-
```
|
|
797
|
-
|
|
798
|
-
the rescue prompt tells the agent to stop broad exploration, summarize changed files and current failures, avoid noisy artifacts, and continue from the next smallest useful file/test.
|
|
799
|
-
|
|
800
|
-
watch is tuned for large repos:
|
|
801
|
-
|
|
802
|
-
- ignores absolute paths outside the target repo
|
|
803
|
-
- keeps generated artifacts out of repeated-source-file actions
|
|
804
|
-
- groups lockfiles, `__pycache__`, `node_modules`, and hashed build assets separately
|
|
805
|
-
- only treats repeated non-generated files as actionable when they exist inside the target repo
|
|
806
|
-
|
|
807
|
-
this keeps large-repo output focused on real source context instead of path noise from old logs or unrelated projects.
|
|
808
|
-
|
|
809
|
-
---
|
|
810
|
-
|
|
811
|
-
## quick start
|
|
812
|
-
|
|
813
|
-
```bash
|
|
814
|
-
# see what prismodev does without touching anything
|
|
815
|
-
npx getprismo demo
|
|
816
|
-
|
|
817
|
-
# simple plain-english check
|
|
818
|
-
npx getprismo scan --simple
|
|
819
|
-
|
|
820
|
-
# the full workflow
|
|
821
78
|
npx getprismo doctor
|
|
822
|
-
npx getprismo
|
|
823
|
-
npx getprismo receipt
|
|
824
|
-
npx getprismo replay
|
|
79
|
+
npx getprismo protect
|
|
825
80
|
```
|
|
826
81
|
|
|
827
|
-
|
|
82
|
+
Connect when you want the dashboard, repair queue, live control feed, verified savings, and fleet learning:
|
|
828
83
|
|
|
829
84
|
```bash
|
|
830
|
-
|
|
831
|
-
npx getprismo
|
|
832
|
-
```
|
|
833
|
-
|
|
834
|
-
no install needed. npx runs it directly.
|
|
835
|
-
|
|
836
|
-
---
|
|
837
|
-
|
|
838
|
-
## all commands
|
|
839
|
-
|
|
840
|
-
| command | what it does |
|
|
841
|
-
|---------|-------------|
|
|
842
|
-
| `doctor` | diagnose, fix, optimize, show before/after |
|
|
843
|
-
| `repair <cause\|auto>` | targeted repair for one waste cause; auto = planner picks with cooldowns and verdict feedback |
|
|
844
|
-
| `enforce` | runtime enforcement of the context firewall via claude code hooks |
|
|
845
|
-
| `digest` | verified-savings summary for the week, in dollars, ready for slack |
|
|
846
|
-
| `watch` | live session monitoring with warnings |
|
|
847
|
-
| `cc` | claude code cost breakdown |
|
|
848
|
-
| `cc timeline` | session reconstruction with events |
|
|
849
|
-
| `cursor` | cursor session tracking and ai authorship |
|
|
850
|
-
| `receipt` | run receipt for reads, repeats, output, artifacts, context efficiency, likely influence, and next-run scope |
|
|
851
|
-
| `replay` | incident replay with root cause and recovery prompt |
|
|
852
|
-
| `timeline` | recurring context-waste patterns across recent sessions |
|
|
853
|
-
| `instructions audit` | instruction ROI audit for CLAUDE.md / AGENTS.md violations, partial compliance, duplicates, and influence-unknown rules |
|
|
854
|
-
| `instructions ablate --dry-run` | conservative ablation plan for instruction candidates without editing files |
|
|
855
|
-
| `instructions apply` | safely dedupe exact duplicate instruction lines with backups |
|
|
856
|
-
| `boundaries` | multi-agent boundary check for shared files/artifacts and worktree overlap |
|
|
857
|
-
| `scan --usage` | full repo scan with local usage data |
|
|
858
|
-
| `scan --optimizer-fit` | recommend which token-optimization path fits your repo/session |
|
|
859
|
-
| `scan --report-card` | shortest decision-layer summary |
|
|
860
|
-
| `benchmark` | measure command-output reduction or recent session round-trip context |
|
|
861
|
-
| `scan --simple` | plain-english summary |
|
|
862
|
-
| `scan --fix` | create safe fix files |
|
|
863
|
-
| `scan --ci` | fail CI when token-risk gates fail |
|
|
864
|
-
| `optimize` | generate `.prismo/` context packs |
|
|
865
|
-
| `context` | print paste-ready prompt for agents |
|
|
866
|
-
| `shield` | run noisy commands while keeping full output out of chat |
|
|
867
|
-
| `agent` | claim and execute safe Prismo Cloud workspace actions locally |
|
|
868
|
-
| `mcp` | expose PrismoDev tools over local MCP stdio |
|
|
869
|
-
| `bridge` | explain optional bridge mode and live interception levels for Claude Code, Codex, and Cursor |
|
|
870
|
-
| `setup` | detect tools, logs, proxy readiness |
|
|
871
|
-
| `usage` | show raw session token usage |
|
|
872
|
-
| `init` | add npm scripts and .prismo/README.md |
|
|
873
|
-
| `demo` | sample output without reading your repo |
|
|
874
|
-
|
|
875
|
-
---
|
|
876
|
-
|
|
877
|
-
## doctor modes
|
|
878
|
-
|
|
879
|
-
```bash
|
|
880
|
-
npx getprismo doctor # full run
|
|
881
|
-
npx getprismo firewall auth-bug # generate scoped context firewall
|
|
882
|
-
npx getprismo doctor --dry-run # preview without writing files
|
|
883
|
-
npx getprismo doctor --apply-ignores-only # only create ignore files
|
|
884
|
-
npx getprismo doctor --apply-suggestions # append missing ignore suggestions with backups
|
|
885
|
-
npx getprismo doctor --apply-suggestions --dry-run # preview the exact ignore-rule diff
|
|
886
|
-
npx getprismo doctor --no-context-packs # skip .prismo/ generation
|
|
887
|
-
npx getprismo doctor frontend # scope to frontend
|
|
888
|
-
npx getprismo doctor --json # machine-readable output
|
|
889
|
-
```
|
|
890
|
-
|
|
891
|
-
---
|
|
892
|
-
|
|
893
|
-
## watch modes
|
|
894
|
-
|
|
895
|
-
```bash
|
|
896
|
-
npx getprismo guard # proactive local guard snapshot
|
|
897
|
-
npx getprismo guard --watch # keep guardrails active and sync prevention events
|
|
898
|
-
npx getprismo guard --no-sync # keep all guard events local
|
|
899
|
-
npx getprismo guard --dry-run # preview guard actions without writing state
|
|
900
|
-
npx getprismo guard --json # dashboard-ready guard payload
|
|
901
|
-
```
|
|
902
|
-
|
|
903
|
-
```bash
|
|
904
|
-
npx getprismo watch # live refresh
|
|
905
|
-
npx getprismo watch --once # single snapshot
|
|
906
|
-
npx getprismo watch --agents # multi-agent coordination view
|
|
907
|
-
npx getprismo watch --agents --json # machine-readable multi-agent state
|
|
908
|
-
npx getprismo watch --once --report # write .prismo/watch-report.md
|
|
909
|
-
npx getprismo watch --once --json # machine-readable
|
|
910
|
-
npx getprismo watch --auto # guardrails + throttle + 600k budget
|
|
911
|
-
npx getprismo watch --auto --no-events # live protection without event history
|
|
912
|
-
npx getprismo watch --guardrails # update .prismo/live-guardrails.md continuously
|
|
913
|
-
npx getprismo watch --guardrails --json # include guardrailsPath and rescuePath
|
|
914
|
-
npx getprismo watch --throttle --budget 600k # enforce a live context budget
|
|
915
|
-
npx getprismo watch --events # append changed warnings to .prismo/watch-events.jsonl
|
|
916
|
-
npx getprismo watch --rescue # paste-ready live-session rescue prompt
|
|
917
|
-
npx getprismo watch --rescue --json # include rescuePrompt in JSON
|
|
918
|
-
npx getprismo watch --once --redact-paths # hide local paths
|
|
919
|
-
npx getprismo watch codex # only codex sessions
|
|
920
|
-
npx getprismo watch claude # only claude code sessions
|
|
921
|
-
npx getprismo watch cursor # only cursor sessions
|
|
922
|
-
```
|
|
923
|
-
|
|
924
|
-
### shield mode
|
|
925
|
-
|
|
926
|
-
```bash
|
|
927
|
-
npx getprismo shield -- npm test
|
|
928
|
-
npx getprismo shield -- pytest -q
|
|
929
|
-
npx getprismo shield --json -- npm run build
|
|
930
|
-
npx getprismo shield last
|
|
931
|
-
npx getprismo shield search "auth failure"
|
|
932
|
-
```
|
|
933
|
-
|
|
934
|
-
### workspace agent mode
|
|
935
|
-
|
|
936
|
-
```bash
|
|
937
|
-
npx getprismo agent # claim queued workspace actions once
|
|
938
|
-
npx getprismo agent --watch # keep polling Prismo Cloud for safe actions
|
|
939
|
-
npx getprismo agent --interval 15 # poll every 15 seconds
|
|
940
|
-
npx getprismo agent --limit 3 # claim up to 3 actions per poll
|
|
941
|
-
npx getprismo agent --json # machine-readable action result
|
|
942
|
-
npx getprismo agent /path/to/repo # run actions against a specific repo
|
|
85
|
+
npx getprismo connect --token <your Prismo API key>
|
|
86
|
+
npx getprismo connector install
|
|
943
87
|
```
|
|
944
88
|
|
|
945
|
-
|
|
89
|
+
The connector syncs aggregate session telemetry, claims safe repairs, publishes live control events, and verifies impact against future sessions.
|
|
946
90
|
|
|
947
|
-
|
|
948
|
-
npx getprismo mcp
|
|
949
|
-
npx getprismo mcp /path/to/repo
|
|
950
|
-
```
|
|
91
|
+
## Privacy
|
|
951
92
|
|
|
952
|
-
|
|
93
|
+
PrismoDev does **not** upload raw prompts, source code, stdout, stderr, or full command logs.
|
|
953
94
|
|
|
954
|
-
|
|
955
|
-
- `prismo_doctor_dry_run`
|
|
956
|
-
- `prismo_watch_snapshot`
|
|
957
|
-
- `prismo_multi_agent_watch`
|
|
958
|
-
- `prismo_shield_run`
|
|
959
|
-
- `prismo_shield_search`
|
|
960
|
-
- `prismo_shield_last`
|
|
961
|
-
- `prismo_context_pack`
|
|
962
|
-
- `prismo_firewall`
|
|
963
|
-
- `prismo_cc_timeline`
|
|
964
|
-
- `prismo_cursor_sessions`
|
|
965
|
-
- `prismo_receipt`
|
|
966
|
-
- `prismo_instructions_audit`
|
|
967
|
-
- `prismo_instructions_ablate`
|
|
968
|
-
- `prismo_timeline`
|
|
969
|
-
- `prismo_replay`
|
|
970
|
-
- `prismo_boundaries`
|
|
95
|
+
It syncs metadata needed for the control plane:
|
|
971
96
|
|
|
972
|
-
|
|
97
|
+
- repo identity and branch
|
|
98
|
+
- tool name and session id
|
|
99
|
+
- token totals and risk scores
|
|
100
|
+
- top waste cause
|
|
101
|
+
- intervention status
|
|
102
|
+
- verified saved tokens/dollars
|
|
973
103
|
|
|
974
|
-
|
|
104
|
+
Detailed telemetry docs: [docs/privacy-telemetry.md](docs/privacy-telemetry.md).
|
|
975
105
|
|
|
976
|
-
|
|
977
|
-
{
|
|
978
|
-
"mcpServers": {
|
|
979
|
-
"prismodev": {
|
|
980
|
-
"command": "npx",
|
|
981
|
-
"args": ["-y", "getprismo", "mcp", "/path/to/your/repo"]
|
|
982
|
-
}
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
```
|
|
986
|
-
|
|
987
|
-
For local development from this repo:
|
|
106
|
+
## Runtime Enforcement
|
|
988
107
|
|
|
989
|
-
|
|
990
|
-
{
|
|
991
|
-
"mcpServers": {
|
|
992
|
-
"prismodev": {
|
|
993
|
-
"command": "node",
|
|
994
|
-
"args": ["/path/to/prismodev/bin/prismo.js", "mcp", "/path/to/your/repo"]
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
```
|
|
999
|
-
|
|
1000
|
-
---
|
|
1001
|
-
|
|
1002
|
-
## cc modes
|
|
108
|
+
Claude Code can be hard-blocked through hooks:
|
|
1003
109
|
|
|
1004
110
|
```bash
|
|
1005
|
-
npx getprismo
|
|
1006
|
-
npx getprismo cc timeline # event timeline for latest session
|
|
1007
|
-
npx getprismo cc timeline --firewall --task auth-bug # suggest next-session firewall rules
|
|
1008
|
-
npx getprismo cc list # list recent sessions
|
|
1009
|
-
npx getprismo cc last 5 # last 5 sessions
|
|
1010
|
-
npx getprismo cc all # everything
|
|
1011
|
-
npx getprismo cc timeline --json # machine-readable timeline
|
|
1012
|
-
```
|
|
1013
|
-
|
|
1014
|
-
---
|
|
1015
|
-
|
|
1016
|
-
## ci integration
|
|
1017
|
-
|
|
1018
|
-
```bash
|
|
1019
|
-
npx getprismo scan --ci --no-report
|
|
1020
|
-
```
|
|
1021
|
-
|
|
1022
|
-
exits non-zero when:
|
|
1023
|
-
- score is below threshold
|
|
1024
|
-
- risk is too high
|
|
1025
|
-
- ai ignore files are missing
|
|
1026
|
-
- generated artifacts are exposed
|
|
1027
|
-
- large files are exposed
|
|
1028
|
-
|
|
1029
|
-
add to your ci:
|
|
1030
|
-
|
|
1031
|
-
```json
|
|
1032
|
-
{
|
|
1033
|
-
"scripts": {
|
|
1034
|
-
"ai:ci": "prismo scan --ci --no-report"
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
111
|
+
npx getprismo enforce install
|
|
1037
112
|
```
|
|
1038
113
|
|
|
1039
|
-
|
|
114
|
+
This can deny blocked-context reads and repeated command loops before they spend tokens. Codex and Cursor are visible and repairable through logs, MCP, shield, and guardrails; universal hard-blocking for those agents requires wrapper or deeper pre-tool hooks.
|
|
1040
115
|
|
|
1041
|
-
##
|
|
116
|
+
## Beta Test Loop
|
|
1042
117
|
|
|
1043
|
-
|
|
118
|
+
For the proof week:
|
|
1044
119
|
|
|
1045
120
|
```bash
|
|
1046
|
-
npx getprismo
|
|
1047
|
-
npx getprismo
|
|
1048
|
-
npx getprismo
|
|
1049
|
-
npx getprismo context frontend # prints a paste-ready prompt
|
|
1050
|
-
npx getprismo context backend
|
|
1051
|
-
```
|
|
1052
|
-
|
|
1053
|
-
use these as the starting point for coding sessions instead of letting agents explore the whole repo.
|
|
1054
|
-
|
|
1055
|
-
---
|
|
1056
|
-
|
|
1057
|
-
## tracking modes
|
|
1058
|
-
|
|
1059
|
-
```
|
|
1060
|
-
local scan heuristic repo/context risk, no keys needed
|
|
1061
|
-
local logs exact when codex/claude session logs expose token fields
|
|
1062
|
-
prismo proxy exact usage/cost when traffic routes through prismo base url
|
|
121
|
+
npx getprismo protect
|
|
122
|
+
npx getprismo connector status
|
|
123
|
+
npx getprismo digest
|
|
1063
124
|
```
|
|
1064
125
|
|
|
1065
|
-
|
|
1066
|
-
- codex: `~/.codex/sessions/**/*.jsonl`
|
|
1067
|
-
- claude code: `~/.claude/projects/**/*.jsonl`
|
|
1068
|
-
- cursor: `~/.cursor/ai-tracking/ai-code-tracking.db` and `~/Library/Application Support/Cursor/User/globalStorage/state.vscdb`
|
|
126
|
+
Then code normally. Do not optimize for the demo. Let Prismo observe real sessions, intervene where it can, and verify the savings later.
|
|
1069
127
|
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
---
|
|
1073
|
-
|
|
1074
|
-
## what gets generated
|
|
1075
|
-
|
|
1076
|
-
```
|
|
1077
|
-
.prismo/
|
|
1078
|
-
├── architecture-summary.md
|
|
1079
|
-
├── backend-summary.md
|
|
1080
|
-
├── frontend-summary.md
|
|
1081
|
-
├── frontend-context.md
|
|
1082
|
-
├── backend-context.md
|
|
1083
|
-
├── recommended-CLAUDE.boilerplate.md
|
|
1084
|
-
├── recommended-AGENTS.boilerplate.md
|
|
1085
|
-
├── recommended-.claudeignore
|
|
1086
|
-
├── recommended-.cursorignore
|
|
1087
|
-
├── recommended-.gitignore-additions
|
|
1088
|
-
├── optimize-report.md
|
|
1089
|
-
└── watch-report.md (when using --report)
|
|
1090
|
-
```
|
|
1091
|
-
|
|
1092
|
-
all recommendation files. nothing is overwritten. you decide what to use.
|
|
1093
|
-
|
|
1094
|
-
---
|
|
1095
|
-
|
|
1096
|
-
## init (npm project setup)
|
|
128
|
+
At the end:
|
|
1097
129
|
|
|
1098
130
|
```bash
|
|
1099
|
-
npx getprismo
|
|
1100
|
-
```
|
|
1101
|
-
|
|
1102
|
-
adds to your `package.json`:
|
|
1103
|
-
|
|
1104
|
-
```json
|
|
1105
|
-
{
|
|
1106
|
-
"scripts": {
|
|
1107
|
-
"ai:doctor": "prismo doctor",
|
|
1108
|
-
"ai:watch": "prismo watch",
|
|
1109
|
-
"ai:context": "prismo context",
|
|
1110
|
-
"ai:scan": "prismo scan --usage"
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
|
-
```
|
|
1114
|
-
|
|
1115
|
-
then your team can run `npm run ai:doctor` without remembering the full command.
|
|
1116
|
-
|
|
1117
|
-
---
|
|
1118
|
-
|
|
1119
|
-
## philosophy
|
|
1120
|
-
|
|
1121
|
-
- local first. nothing leaves your machine.
|
|
1122
|
-
- safe by default. doctor never overwrites your real config files.
|
|
1123
|
-
- exact when possible. reads real session logs when agents expose them.
|
|
1124
|
-
- honest about limits. uses "likely" and "estimate" language when visibility is limited.
|
|
1125
|
-
- one suggested action. every output ends with the single best thing to do next.
|
|
1126
|
-
|
|
1127
|
-
---
|
|
1128
|
-
|
|
1129
|
-
## works with
|
|
1130
|
-
|
|
1131
|
-
- claude code (subscription and api modes)
|
|
1132
|
-
- openai codex
|
|
1133
|
-
- cursor
|
|
1134
|
-
- any tool that respects `.claudeignore` or `.cursorignore`
|
|
1135
|
-
- any repo (node, python, go, rust, vue, svelte, astro, monorepos, whatever)
|
|
1136
|
-
|
|
1137
|
-
---
|
|
1138
|
-
|
|
1139
|
-
## internal layout
|
|
1140
|
-
|
|
1141
|
-
```
|
|
1142
|
-
lib/prismo-dev-scan.js cli entry and command dispatch
|
|
1143
|
-
lib/prismo-dev/constants.js shared defaults, pricing, patterns
|
|
1144
|
-
lib/prismo-dev/context-optimize.js context packs, scoped prompts
|
|
1145
|
-
lib/prismo-dev/boundaries.js multi-agent boundary and worktree overlap checks
|
|
1146
|
-
lib/prismo-dev/doctor.js doctor/dev/init orchestration
|
|
1147
|
-
lib/prismo-dev/fixes.js safe ignore/template generation
|
|
1148
|
-
lib/prismo-dev/instructions.js instruction ROI, partial-compliance, and ablation planning
|
|
1149
|
-
lib/prismo-dev/mcp.js local MCP server and Prismo tool bindings
|
|
1150
|
-
lib/prismo-dev/receipt.js run receipts for reads, output, artifacts, and next scope
|
|
1151
|
-
lib/prismo-dev/report.js terminal, markdown, ci reports
|
|
1152
|
-
lib/prismo-dev/repair-executors.js cause-specific repair executors with mild/aggressive tiers
|
|
1153
|
-
lib/prismo-dev/repair-planner.js autonomous planner: cause scoring, cooldowns, local verdicts, escalation
|
|
1154
|
-
lib/prismo-dev/enforce.js claude code PreToolUse hook enforcement and settings wiring
|
|
1155
|
-
lib/prismo-dev/replay.js incident replay and recovery prompts
|
|
1156
|
-
lib/prismo-dev/scan.js repo scanning, scoring, readiness
|
|
1157
|
-
lib/prismo-dev/scan-path-utils.js scan ignore/path helper logic
|
|
1158
|
-
lib/prismo-dev/shield.js local command shield and searchable output index
|
|
1159
|
-
lib/prismo-dev/timeline.js recurring multi-session waste patterns
|
|
1160
|
-
lib/prismo-dev/usage-cost.js Claude Code cost and timeline analysis
|
|
1161
|
-
lib/prismo-dev/usage-log-utils.js local session log parsing helpers
|
|
1162
|
-
lib/prismo-dev/cursor-sessions.js Cursor SQLite session and authorship tracking
|
|
1163
|
-
lib/prismo-dev/usage-sessions.js local Codex/Claude/Cursor session discovery
|
|
1164
|
-
lib/prismo-dev/usage-watch.js watch orchestration, JSON payloads, live files
|
|
1165
|
-
lib/prismo-dev/utils.js shared terminal/file/token helpers
|
|
1166
|
-
lib/prismo-dev/watch-live.js live context-pressure decisions
|
|
1167
|
-
lib/prismo-dev/watch-render.js watch terminal and guardrail renderers
|
|
131
|
+
npx getprismo digest --days 7
|
|
1168
132
|
```
|
|
1169
133
|
|
|
1170
|
-
|
|
134
|
+
Those lines are the launch post.
|
|
1171
135
|
|
|
1172
|
-
##
|
|
136
|
+
## Development
|
|
1173
137
|
|
|
1174
138
|
```bash
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
npx getprismo repair --help
|
|
1179
|
-
npx getprismo enforce --help
|
|
1180
|
-
npx getprismo bridge --help
|
|
1181
|
-
npx getprismo watch --help
|
|
1182
|
-
npx getprismo shield --help
|
|
1183
|
-
npx getprismo mcp --help
|
|
1184
|
-
npx getprismo mcp doctor
|
|
1185
|
-
npx getprismo cc --help
|
|
1186
|
-
npx getprismo cursor --help
|
|
1187
|
-
npx getprismo receipt --help
|
|
1188
|
-
npx getprismo replay --help
|
|
1189
|
-
npx getprismo timeline --help
|
|
1190
|
-
npx getprismo instructions --help
|
|
1191
|
-
npx getprismo boundaries --help
|
|
1192
|
-
npx getprismo scan --help
|
|
139
|
+
npm test
|
|
140
|
+
node bin/prismo.js protect --json
|
|
141
|
+
node bin/prismo.js digest --json
|
|
1193
142
|
```
|
|
1194
143
|
|
|
1195
|
-
More docs:
|
|
1196
|
-
|
|
1197
|
-
- [MCP setup and tools](docs/mcp.md)
|
|
1198
|
-
- [Live demo flow](docs/live-demo.md)
|
|
1199
|
-
- [Privacy & telemetry — exactly what leaves your machine](docs/privacy-telemetry.md)
|
|
144
|
+
More docs: [docs/README.md](docs/README.md).
|