getprismo 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,156 +1,682 @@
1
- # PrismoDev
1
+ # prismodev
2
2
 
3
- PrismoDev finds and monitors token waste in local AI coding workflows, while Prismo core tracks exact API usage through the proxy.
3
+ local ai coding cost control. one command to diagnose token waste, fix it, and prove the improvement.
4
4
 
5
5
  ```bash
6
- npx getprismo scan --usage
7
- npx getprismo setup
8
- npx getprismo watch
6
+ npx getprismo doctor
9
7
  ```
10
8
 
11
- ## What It Does
9
+ that's it. run it on any repo. no api keys, no login, no data leaves your machine.
12
10
 
13
- - Scans your repo for token-waste risks before a coding-agent session.
14
- - Reads local Codex and Claude Code logs when available to show real session usage.
15
- - Generates compact `.prismo/` context files for Claude Code, Codex, Cursor, and similar tools.
16
- - Recommends safer `.claudeignore`, `CLAUDE.md`, and `AGENTS.md` patterns.
17
- - Works offline and does not connect to OpenAI, Anthropic, Cursor, or billing accounts.
11
+ ---
18
12
 
19
- ## Tracking Modes
13
+ ## the problem
14
+
15
+ 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.
16
+
17
+ most developers don't realize this is happening until the bill arrives or the agent starts looping.
18
+
19
+ prismodev catches it before, during, and after.
20
+
21
+ ---
22
+
23
+ ## the loop
24
+
25
+ prismodev is three commands that cover an entire coding session:
26
+
27
+ ```
28
+ before you code npx getprismo doctor
29
+ while you code npx getprismo watch
30
+ after you code npx getprismo cc timeline
31
+ ```
32
+
33
+ **doctor** diagnoses the repo, applies safe fixes, and shows the before/after score.
34
+ **watch** monitors context pressure live and warns when things go wrong.
35
+ **cc timeline** reconstructs what happened in the session so you learn from it.
36
+
37
+ ---
38
+
39
+ ## what prismodev catches
40
+
41
+ - missing `.claudeignore` / `.cursorignore` (the biggest single fix for most repos)
42
+ - lockfiles entering context (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`)
43
+ - generated artifacts leaking in (`__pycache__`, `dist/`, `coverage/`, `.next/`)
44
+ - oversized instruction files (`CLAUDE.md` or `AGENTS.md` over 500 tokens)
45
+ - tool output dominating sessions (repeated reads, large command output)
46
+ - long-running sessions with stale context accumulation
47
+ - repeated file reads (same file loaded 100+ times in one session)
48
+ - repeated commands (agent running the same command in a loop)
49
+ - high context risk sessions that should have been split at task boundaries
50
+
51
+ ---
52
+
53
+ ## real output: doctor
54
+
55
+ run `npx getprismo doctor` on any repo. here's what it looks like on a real project:
56
+
57
+ ```
58
+ PrismoDev Doctor
59
+
60
+ Before: 79/100 - Medium risk - 5 token leaks
61
+ After: 91/100 - Low risk - 3 token leaks (+12)
62
+ Local usage: 976k tokens across 3 recent session(s)
63
+ Estimated exposed context reduction: 100%
64
+ Payoff: repo is 12 points cleaner for AI coding sessions
65
+
66
+ Fixed:
67
+ - Created .claudeignore
68
+ - Created .cursorignore
69
+ - Generated prismo-dev-report.md
70
+ - Generated .prismo/architecture-summary.md
71
+ - Generated .prismo/recommended-CLAUDE.md
72
+ - Generated .prismo/recommended-AGENTS.md
73
+ - Generated .prismo/recommended-.claudeignore
74
+ - Generated .prismo/recommended-.cursorignore
75
+ - Generated .prismo/recommended-.gitignore-additions
76
+ - Generated .prismo/backend-summary.md
77
+ - Generated .prismo/frontend-summary.md
78
+
79
+ Still Risky:
80
+ - Tool output/context contributed about 319k tokens
81
+ - 1 recent session reached high context risk
82
+
83
+ Recommended starting context:
84
+ .prismo/frontend-context.md
85
+
86
+ Next:
87
+ 1. npx getprismo context frontend
88
+ 2. npx getprismo watch --once
89
+ 3. npx getprismo cc
90
+ ```
91
+
92
+ 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.
93
+
94
+ ---
95
+
96
+ ## real output: watch
97
+
98
+ run `npx getprismo watch` during a coding session. it monitors context pressure in real time:
99
+
100
+ ```
101
+ Prismo Watch
102
+
103
+ Context Pressure: HIGH
104
+ Session Size: 707k tokens (exact-local-log)
105
+ Recent Growth: +0 tokens
106
+ Tool Output: 237k tokens
107
+ Turns: 102 | Tool calls: 774
108
+ Model: gpt-5.5
109
+
110
+ Warnings
111
+ - Context risk is high; consider starting a fresh session.
112
+ - Tool/output tokens are dominating this session.
113
+ - lib/prismo-dev-scan.js appears repeatedly in context (286x).
114
+ - node bin/prismo.js appears repeatedly in context (85x).
115
+ - lockfiles likely entered active context (60 mentions).
116
+
117
+ Do This Now
118
+ Cause: tool-output-flood (high confidence)
119
+ Tool/output tokens are dominating this session (237k tokens).
120
+ 1. Stop loading full logs or broad command output.
121
+ 2. Rerun failing commands with tight filters or short ranges.
122
+ 3. Ask the agent to summarize current errors before reading more files.
123
+ Rescue: npx getprismo watch --rescue
124
+
125
+ Signals
126
+ - Repeated file: lib/prismo-dev-scan.js (286x)
127
+ - Repeated file: node bin/prismo.js (85x)
128
+ - Generated artifacts: lockfiles (60 mentions)
129
+ - Generated artifacts: __pycache__ (47 mentions)
130
+
131
+ Suggested Action
132
+ Run: npx getprismo doctor
133
+ ```
134
+
135
+ watch caught lockfiles entering context, a file being read 286 times, and tool output dominating the session. without this, you'd never know.
136
+
137
+ ---
138
+
139
+ ## new: live guardrails mode
140
+
141
+ the easiest proactive mode is:
142
+
143
+ ```bash
144
+ npx getprismo watch --auto
145
+ ```
146
+
147
+ `--auto` turns on live guardrails, live context throttling, event logging, and a default 600k session budget. it writes:
148
+
149
+ ```text
150
+ .prismo/live-guardrails.md
151
+ .prismo/live-context-throttle.md
152
+ .prismo/live-rescue-prompt.md
153
+ .prismo/watch-events.jsonl
154
+ ```
155
+
156
+ if you want prismodev to keep updating instructions while the session runs, use:
157
+
158
+ ```bash
159
+ npx getprismo watch --guardrails
160
+ ```
161
+
162
+ this writes and continuously updates:
163
+
164
+ ```text
165
+ .prismo/live-guardrails.md
166
+ .prismo/live-rescue-prompt.md
167
+ ```
168
+
169
+ the idea is simple: tell your coding agent once at the start of the session:
20
170
 
21
171
  ```text
22
- Local scan: no API keys, heuristic repo/context risk
23
- Local logs: exact when Codex/Claude logs expose token fields
24
- Prismo proxy: exact usage/cost when traffic uses Prismo base URL
172
+ follow .prismo/live-guardrails.md during this session.
173
+ ```
174
+
175
+ 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.
176
+
177
+ example guardrails:
178
+
179
+ ```md
180
+ # Prismo Live Guardrails
181
+
182
+ Context pressure: High
183
+ Current issue: tool-output-flood
184
+ Confidence: high
185
+
186
+ ## Effective Immediately
187
+
188
+ - Stop loading full logs or broad command output.
189
+ - Rerun failing commands with tight filters or short ranges.
190
+ - Ask the agent to summarize current errors before reading more files.
191
+ - Do not read generated artifacts, lockfiles, caches, build output, coverage, or logs unless explicitly required.
25
192
  ```
26
193
 
27
- PrismoDev does not claim exact billing for hidden subscription coding-agent sessions. When provider traffic does not flow through Prismo, local usage is based on available session logs and deterministic estimates.
194
+ 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.
195
+
196
+ ---
28
197
 
29
- ## Quick Start
198
+ ## new: live rescue mode
199
+
200
+ when `watch` detects a session going sideways, run:
30
201
 
31
202
  ```bash
32
- npx getprismo scan --usage
33
- npx getprismo setup
34
- npx getprismo watch --once
203
+ npx getprismo watch --rescue
204
+ ```
205
+
206
+ it prints a paste-ready rescue prompt for the current ai coding session:
207
+
208
+ ```text
209
+ Prismo Rescue Prompt
210
+
211
+ Paste this into the current AI coding session:
212
+
213
+ We are in a high-context AI coding session. Stop broad exploration and recover state before doing more work.
214
+
215
+ Current Prismo signal: tool-output-flood (high confidence).
216
+ Summary: Tool/output tokens are dominating this session (264k tokens).
217
+ Context pressure: High. Session size: 1.11M tokens. Tool output: 264k tokens.
218
+
219
+ Do this now:
220
+ 1. Stop loading full logs or broad command output.
221
+ 2. Rerun failing commands with tight filters or short ranges.
222
+ 3. Ask the agent to summarize current errors before reading more files.
223
+
224
+ Before reading or editing anything else, summarize:
225
+ - files changed so far
226
+ - exact failing command or error
227
+ - current hypothesis
228
+ - next smallest file/test to inspect
229
+
230
+ Do not re-read these files unless they changed.
231
+ Do not read generated/noisy artifacts unless explicitly required.
232
+ ```
233
+
234
+ `watch --rescue --json` includes the same prompt as `rescuePrompt`, plus the structured live action:
235
+
236
+ ```json
237
+ {
238
+ "live": {
239
+ "contextPressure": "High",
240
+ "liveAction": {
241
+ "cause": "tool-output-flood",
242
+ "confidence": "high",
243
+ "summary": "Tool/output tokens are dominating this session.",
244
+ "rescueAvailable": true
245
+ }
246
+ }
247
+ }
35
248
  ```
36
249
 
37
- Use this flow to see value immediately:
250
+ live action causes include:
38
251
 
39
- 1. `scan --usage` finds repo/context risks and reads local Codex/Claude Code usage logs when available.
40
- 2. `setup` shows which tracking modes are possible, including Prismo proxy readiness.
41
- 3. `watch --once` shows the current live local session view with warnings and next action.
252
+ - `tool-output-flood`
253
+ - `artifact-leak`
254
+ - `possible-loop`
255
+ - `repeated-file-read`
256
+ - `context-spike`
257
+ - `high-context-pressure`
42
258
 
43
- Testing PrismoDev with other developers? Use the [PrismoDev user testing playbook](docs/prismodev-user-testing.md).
259
+ 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.
44
260
 
45
- For a guided scan + context generation flow, run:
261
+ use `--guardrails` when you want files to update automatically during the session. use `--rescue` when you want a one-shot prompt to paste immediately.
262
+
263
+ ---
264
+
265
+ ## new: live context throttle
266
+
267
+ if you want prismodev to enforce a session budget while you work, run:
268
+
269
+ ```bash
270
+ npx getprismo watch --throttle --budget 600k
271
+ ```
272
+
273
+ this writes:
274
+
275
+ ```text
276
+ .prismo/live-context-throttle.md
277
+ ```
278
+
279
+ when the active session gets near or crosses the budget, watch turns that into a live action:
280
+
281
+ ```text
282
+ Cause: token-budget-exceeded
283
+ Stop broad exploration.
284
+ Summarize current state before more file reads.
285
+ Start a fresh scoped session at the next task boundary.
286
+ ```
287
+
288
+ use it with guardrails for the most proactive setup:
46
289
 
47
290
  ```bash
48
- npx getprismo dev
291
+ npx getprismo watch --auto
49
292
  ```
50
293
 
51
- ## Common Commands
294
+ that gives the agent a live instruction file, a rescue prompt, and a stricter context throttle file that updates as the session changes.
295
+
296
+ `watch --auto` also appends changed live warnings to `.prismo/watch-events.jsonl`, so expensive-session events can be reused later in postmortems.
297
+
298
+ Use `--no-events` when you want live protection without writing session event history:
52
299
 
53
300
  ```bash
54
- npx getprismo scan --usage
55
- npx getprismo setup
56
- npx getprismo watch
57
- npx getprismo scan --fix
58
- npx getprismo optimize
59
- npx getprismo context frontend
60
- npx getprismo usage codex
61
- npx getprismo usage claude
301
+ npx getprismo watch --auto --no-events
62
302
  ```
63
303
 
64
- ## Example Output
304
+ ---
305
+
306
+ ## new: context firewall
307
+
308
+ generate a scoped context policy before a task:
309
+
310
+ ```bash
311
+ npx getprismo firewall auth-bug
312
+ ```
313
+
314
+ this writes:
315
+
316
+ ```text
317
+ .prismo/context-firewall.md
318
+ .prismo/allowed-context.txt
319
+ .prismo/blocked-context.txt
320
+ .prismo/firewall-prompt.md
321
+ ```
322
+
323
+ 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.
324
+
325
+ example:
65
326
 
66
327
  ```text
67
- PrismoDev
328
+ Allowed first:
329
+ - .prismo/architecture-summary.md
330
+ - .prismo/backend-summary.md
331
+ - backend/app/*/auth/*
332
+
333
+ Blocked unless justified:
334
+ - node_modules/**
335
+ - .next/**
336
+ - dist/**
337
+ - coverage/**
338
+ - package-lock.json
339
+ ```
340
+
341
+ `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.
342
+
343
+ ---
68
344
 
69
- Score: 72/100 | Risk: Medium | Token leaks: 5
70
- Estimated avoidable waste: 20-40%
345
+ ## real output: cc timeline
71
346
 
72
- Top Token Leaks
73
- 1. Missing .claudeignore
74
- 2. Recent local AI sessions used 2.40M tokens
75
- 3. Large exposed file detected
76
- 4. Tool output/context contributed about 95k tokens
77
- 5. CLAUDE.md is ~1,900 tokens
347
+ run `npx getprismo cc timeline` after a session to understand what happened:
78
348
 
79
- Top Fix
80
- Run: npx getprismo scan --fix
81
- Then: npx getprismo optimize
82
- Then: npx getprismo context frontend
83
349
  ```
350
+ Prismo Claude Code Cost
351
+
352
+ Session: 7689982e-42a3-44fb-9734-2588e5e01145
353
+ Model: claude-opus-4-6
354
+
355
+ Timeline
356
+ 05:24 PM Generated artifact likely entered context package-lock.json (2x)
357
+ 05:24 PM Generated artifact likely entered context logs/debug-output.json (1x)
358
+ 05:24 PM Repeated file/path context CLAUDE.md (8x)
359
+ 05:24 PM Repeated file/path context AGENTS.md (8x)
360
+ 05:24 PM Repeated file/path context node bin/prismo.js (6x)
361
+
362
+ Suggested Action
363
+ Run npx getprismo optimize, then start from .prismo/architecture-summary.md.
364
+ ```
365
+
366
+ timeline shows exactly what leaked, what repeated, and what to do differently next time.
367
+
368
+ ---
369
+
370
+ ## how doctor improves a repo
371
+
372
+ doctor does four things in sequence:
373
+
374
+ 1. **scans** the repo and reads local codex/claude code session logs
375
+ 2. **applies safe fixes** — creates `.claudeignore`, `.cursorignore`, generates recommendation templates
376
+ 3. **generates context packs** — compact `.prismo/` files that give agents focused context instead of reading everything
377
+ 4. **re-scans** and shows the before/after score
378
+
379
+ what doctor creates:
380
+
381
+ ```
382
+ .claudeignore blocks waste from claude code
383
+ .cursorignore blocks waste from cursor
384
+ .prismo/architecture-summary.md compact project overview for agents
385
+ .prismo/backend-summary.md backend-specific context
386
+ .prismo/frontend-summary.md frontend-specific context
387
+ .prismo/recommended-CLAUDE.md optimized CLAUDE.md template
388
+ .prismo/recommended-AGENTS.md optimized AGENTS.md template
389
+ .prismo/recommended-.claudeignore full recommended ignore list
390
+ .prismo/recommended-.cursorignore full recommended ignore list
391
+ .prismo/recommended-.gitignore-additions things your gitignore might be missing
392
+ prismo-dev-report.md full diagnostic report
393
+ ```
394
+
395
+ what doctor never touches:
84
396
 
85
- ## Setup And Live Watch
397
+ - your real `CLAUDE.md`
398
+ - your real `AGENTS.md`
399
+ - your `.gitignore`
400
+ - any source code
401
+ - any config files
402
+
403
+ it only creates new files and recommendations. you decide what to apply.
404
+
405
+ ---
406
+
407
+ ## how watch catches waste live
408
+
409
+ watch reads local session logs from codex and claude code. it detects:
410
+
411
+ | signal | what it means |
412
+ |--------|--------------|
413
+ | context pressure HIGH | session is consuming too many tokens |
414
+ | repeated file 286x | agent keeps re-reading the same file |
415
+ | lockfiles entered context | `package-lock.json` got loaded (pure waste) |
416
+ | tool output dominating | agent output is larger than actual code context |
417
+ | loop suspicion | agent may be stuck in a command loop |
418
+ | recent growth +380k | context just spiked by 380k tokens |
419
+
420
+ watch tells you the single most useful action to take right now. usually: start a fresh session, or switch to a scoped context pack.
421
+
422
+ `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:
423
+
424
+ ```bash
425
+ npx getprismo watch --rescue
426
+ ```
427
+
428
+ 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.
429
+
430
+ watch is tuned for large repos:
431
+
432
+ - ignores absolute paths outside the target repo
433
+ - keeps generated artifacts out of repeated-source-file actions
434
+ - groups lockfiles, `__pycache__`, `node_modules`, and hashed build assets separately
435
+ - only treats repeated non-generated files as actionable when they exist inside the target repo
436
+
437
+ this keeps large-repo output focused on real source context instead of path noise from old logs or unrelated projects.
438
+
439
+ ---
440
+
441
+ ## quick start
86
442
 
87
443
  ```bash
88
- npx getprismo setup
444
+ # see what prismodev does without touching anything
445
+ npx getprismo demo
446
+
447
+ # simple plain-english check
448
+ npx getprismo scan --simple
449
+
450
+ # the full workflow
451
+ npx getprismo doctor
452
+ npx getprismo watch --once
453
+ npx getprismo cc timeline
89
454
  ```
90
455
 
91
- Setup is read-only. It detects Claude Code, Codex, Cursor, local logs, MCP/tool config, and whether the Prismo proxy is reachable for exact API tracking.
456
+ if you don't have node installed, get it from [nodejs.org](https://nodejs.org) (LTS). then:
92
457
 
93
458
  ```bash
94
- npx getprismo watch
459
+ node -v # should print 18+
460
+ npx getprismo doctor
95
461
  ```
96
462
 
97
- Watch is the local live session view. It shows active session tokens, context risk, tool/output token spikes, largest context sources, top tools, warnings, and the next recommended action.
463
+ no install needed. npx runs it directly.
464
+
465
+ ---
466
+
467
+ ## all commands
468
+
469
+ | command | what it does |
470
+ |---------|-------------|
471
+ | `doctor` | diagnose, fix, optimize, show before/after |
472
+ | `watch` | live session monitoring with warnings |
473
+ | `cc` | claude code cost breakdown |
474
+ | `cc timeline` | session reconstruction with events |
475
+ | `scan --usage` | full repo scan with local usage data |
476
+ | `scan --simple` | plain-english summary |
477
+ | `scan --fix` | create safe fix files |
478
+ | `scan --ci` | fail CI when token-risk gates fail |
479
+ | `optimize` | generate `.prismo/` context packs |
480
+ | `context` | print paste-ready prompt for agents |
481
+ | `setup` | detect tools, logs, proxy readiness |
482
+ | `usage` | show raw session token usage |
483
+ | `init` | add npm scripts and .prismo/README.md |
484
+ | `demo` | sample output without reading your repo |
98
485
 
99
- For machine-readable output:
486
+ ---
487
+
488
+ ## doctor modes
489
+
490
+ ```bash
491
+ npx getprismo doctor # full run
492
+ npx getprismo firewall auth-bug # generate scoped context firewall
493
+ npx getprismo doctor --dry-run # preview without writing files
494
+ npx getprismo doctor --apply-ignores-only # only create ignore files
495
+ npx getprismo doctor --no-context-packs # skip .prismo/ generation
496
+ npx getprismo doctor frontend # scope to frontend
497
+ npx getprismo doctor --json # machine-readable output
498
+ ```
499
+
500
+ ---
501
+
502
+ ## watch modes
503
+
504
+ ```bash
505
+ npx getprismo watch # live refresh
506
+ npx getprismo watch --once # single snapshot
507
+ npx getprismo watch --once --report # write .prismo/watch-report.md
508
+ npx getprismo watch --once --json # machine-readable
509
+ npx getprismo watch --auto # guardrails + throttle + 600k budget
510
+ npx getprismo watch --auto --no-events # live protection without event history
511
+ npx getprismo watch --guardrails # update .prismo/live-guardrails.md continuously
512
+ npx getprismo watch --guardrails --json # include guardrailsPath and rescuePath
513
+ npx getprismo watch --throttle --budget 600k # enforce a live context budget
514
+ npx getprismo watch --events # append changed warnings to .prismo/watch-events.jsonl
515
+ npx getprismo watch --rescue # paste-ready live-session rescue prompt
516
+ npx getprismo watch --rescue --json # include rescuePrompt in JSON
517
+ npx getprismo watch --once --redact-paths # hide local paths
518
+ npx getprismo watch codex # only codex sessions
519
+ npx getprismo watch claude # only claude code sessions
520
+ ```
521
+
522
+ ---
523
+
524
+ ## cc modes
525
+
526
+ ```bash
527
+ npx getprismo cc # latest session cost
528
+ npx getprismo cc timeline # event timeline for latest session
529
+ npx getprismo cc list # list recent sessions
530
+ npx getprismo cc last 5 # last 5 sessions
531
+ npx getprismo cc all # everything
532
+ npx getprismo cc timeline --json # machine-readable timeline
533
+ ```
534
+
535
+ ---
536
+
537
+ ## ci integration
538
+
539
+ ```bash
540
+ npx getprismo scan --ci --no-report
541
+ ```
542
+
543
+ exits non-zero when:
544
+ - score is below threshold
545
+ - risk is too high
546
+ - ai ignore files are missing
547
+ - generated artifacts are exposed
548
+ - large files are exposed
549
+
550
+ add to your ci:
551
+
552
+ ```json
553
+ {
554
+ "scripts": {
555
+ "ai:ci": "prismo scan --ci --no-report"
556
+ }
557
+ }
558
+ ```
559
+
560
+ ---
561
+
562
+ ## scoped context packs
563
+
564
+ prismodev generates context packs scoped to different areas of your codebase:
100
565
 
101
566
  ```bash
102
- npx getprismo setup --json
103
- npx getprismo watch --once --json
567
+ npx getprismo optimize frontend
568
+ npx getprismo optimize backend
569
+ npx getprismo optimize auth
570
+ npx getprismo context frontend # prints a paste-ready prompt
571
+ npx getprismo context backend
104
572
  ```
105
573
 
106
- ## Local Usage Tracking
574
+ use these as the starting point for coding sessions instead of letting agents explore the whole repo.
107
575
 
108
- Prismo can show real token usage when local tool logs expose token fields.
576
+ ---
109
577
 
110
- - Codex: reads local `~/.codex/sessions/**/*.jsonl`
111
- - Claude Code: reads local `~/.claude/projects/**/*.jsonl`
578
+ ## tracking modes
112
579
 
113
- If exact usage fields are present, Prismo marks the result as `exact-local-log`. If not, it falls back to local text-size estimates.
580
+ ```
581
+ local scan heuristic repo/context risk, no keys needed
582
+ local logs exact when codex/claude session logs expose token fields
583
+ prismo proxy exact usage/cost when traffic routes through prismo base url
584
+ ```
114
585
 
115
- No API keys are required. Prismo does not proxy Claude Code subscription traffic or intercept prompts.
586
+ prismodev reads local session logs from:
587
+ - codex: `~/.codex/sessions/**/*.jsonl`
588
+ - claude code: `~/.claude/projects/**/*.jsonl`
116
589
 
117
- ## Generated Files
590
+ no api keys. no intercepted prompts. no data uploaded.
118
591
 
119
- `npx getprismo optimize` creates recommendation files in `.prismo/`:
592
+ ---
120
593
 
121
- - `.prismo/architecture-summary.md`
122
- - `.prismo/backend-summary.md`
123
- - `.prismo/frontend-summary.md`
124
- - `.prismo/recommended-CLAUDE.md`
125
- - `.prismo/recommended-AGENTS.md`
126
- - `.prismo/recommended-.claudeignore`
127
- - `.prismo/optimize-report.md`
594
+ ## what gets generated
128
595
 
129
- These files are templates and context packs. Prismo does not overwrite your real `CLAUDE.md`, `AGENTS.md`, `.gitignore`, or `.claudeignore` during optimize.
596
+ ```
597
+ .prismo/
598
+ ├── architecture-summary.md
599
+ ├── backend-summary.md
600
+ ├── frontend-summary.md
601
+ ├── frontend-context.md
602
+ ├── backend-context.md
603
+ ├── recommended-CLAUDE.md
604
+ ├── recommended-AGENTS.md
605
+ ├── recommended-.claudeignore
606
+ ├── recommended-.cursorignore
607
+ ├── recommended-.gitignore-additions
608
+ ├── optimize-report.md
609
+ └── watch-report.md (when using --report)
610
+ ```
130
611
 
131
- ## Safe Fix Mode
612
+ all recommendation files. nothing is overwritten. you decide what to use.
613
+
614
+ ---
615
+
616
+ ## init (npm project setup)
132
617
 
133
618
  ```bash
134
- npx getprismo scan --fix
619
+ npx getprismo init
135
620
  ```
136
621
 
137
- Fix mode can create:
622
+ adds to your `package.json`:
623
+
624
+ ```json
625
+ {
626
+ "scripts": {
627
+ "ai:doctor": "prismo doctor",
628
+ "ai:watch": "prismo watch",
629
+ "ai:context": "prismo context",
630
+ "ai:scan": "prismo scan --usage"
631
+ }
632
+ }
633
+ ```
634
+
635
+ then your team can run `npm run ai:doctor` without remembering the full command.
636
+
637
+ ---
138
638
 
139
- - `.claudeignore` if missing
140
- - `.claudeignore.prismo-suggested` if `.claudeignore` already exists
141
- - `prismo-dev-report.md`
142
- - `prismo-optimized-CLAUDE.template.md`
143
- - `prismo-AGENTS-recommendations.md`
639
+ ## philosophy
144
640
 
145
- Existing reports and suggestion files are backed up before replacement.
641
+ - local first. nothing leaves your machine.
642
+ - safe by default. doctor never overwrites your real config files.
643
+ - exact when possible. reads real session logs when agents expose them.
644
+ - honest about limits. uses "likely" and "estimate" language when visibility is limited.
645
+ - one suggested action. every output ends with the single best thing to do next.
146
646
 
147
- ## Help
647
+ ---
648
+
649
+ ## works with
650
+
651
+ - claude code (subscription and api modes)
652
+ - openai codex
653
+ - cursor
654
+ - any tool that respects `.claudeignore` or `.cursorignore`
655
+ - any repo (node, python, go, rust, monorepos, whatever)
656
+
657
+ ---
658
+
659
+ ## internal layout
660
+
661
+ ```
662
+ lib/prismo-dev-scan.js cli entry and command dispatch
663
+ lib/prismo-dev/constants.js shared defaults, pricing, patterns
664
+ lib/prismo-dev/context-optimize.js context packs, scoped prompts
665
+ lib/prismo-dev/doctor.js doctor/dev/init orchestration
666
+ lib/prismo-dev/fixes.js safe ignore/template generation
667
+ lib/prismo-dev/report.js terminal, markdown, ci reports
668
+ lib/prismo-dev/scan.js repo scanning, scoring, readiness
669
+ lib/prismo-dev/usage-watch.js local logs, watch, cost, timeline
670
+ ```
671
+
672
+ ---
673
+
674
+ ## help
148
675
 
149
676
  ```bash
150
677
  npx getprismo --help
151
- npx getprismo scan --help
152
- npx getprismo setup --help
678
+ npx getprismo doctor --help
153
679
  npx getprismo watch --help
154
- npx getprismo optimize --help
155
- npx getprismo usage --help
680
+ npx getprismo cc --help
681
+ npx getprismo scan --help
156
682
  ```