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