getprismo 0.1.3 → 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/LICENSE +21 -0
- package/NOTICE +16 -0
- package/README.md +620 -82
- package/docs/prismodev-user-testing.md +157 -0
- package/lib/prismo-dev/constants.js +173 -0
- package/lib/prismo-dev/context-optimize.js +629 -0
- package/lib/prismo-dev/doctor.js +453 -0
- package/lib/prismo-dev/firewall.js +215 -0
- package/lib/prismo-dev/fixes.js +109 -0
- package/lib/prismo-dev/report.js +360 -0
- package/lib/prismo-dev/scan.js +1124 -0
- package/lib/prismo-dev/usage-watch.js +1847 -0
- package/lib/prismo-dev-scan.js +465 -2684
- package/package.json +25 -7
package/README.md
CHANGED
|
@@ -1,144 +1,682 @@
|
|
|
1
|
-
#
|
|
1
|
+
# prismodev
|
|
2
2
|
|
|
3
|
-
|
|
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
|
|
7
|
-
npx getprismo setup
|
|
8
|
-
npx getprismo watch
|
|
6
|
+
npx getprismo doctor
|
|
9
7
|
```
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
that's it. run it on any repo. no api keys, no login, no data leaves your machine.
|
|
12
10
|
|
|
13
|
-
|
|
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
|
-
##
|
|
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:
|
|
20
142
|
|
|
21
143
|
```bash
|
|
22
|
-
npx getprismo
|
|
23
|
-
npx getprismo setup
|
|
24
|
-
npx getprismo watch --once
|
|
144
|
+
npx getprismo watch --auto
|
|
25
145
|
```
|
|
26
146
|
|
|
27
|
-
|
|
147
|
+
`--auto` turns on live guardrails, live context throttling, event logging, and a default 600k session budget. it writes:
|
|
28
148
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
+
```
|
|
32
155
|
|
|
33
|
-
|
|
156
|
+
if you want prismodev to keep updating instructions while the session runs, use:
|
|
34
157
|
|
|
35
158
|
```bash
|
|
36
|
-
npx getprismo
|
|
159
|
+
npx getprismo watch --guardrails
|
|
37
160
|
```
|
|
38
161
|
|
|
39
|
-
|
|
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:
|
|
170
|
+
|
|
171
|
+
```text
|
|
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.
|
|
192
|
+
```
|
|
193
|
+
|
|
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
|
+
---
|
|
197
|
+
|
|
198
|
+
## new: live rescue mode
|
|
199
|
+
|
|
200
|
+
when `watch` detects a session going sideways, run:
|
|
40
201
|
|
|
41
202
|
```bash
|
|
42
|
-
npx getprismo
|
|
43
|
-
npx getprismo setup
|
|
44
|
-
npx getprismo watch
|
|
45
|
-
npx getprismo scan --fix
|
|
46
|
-
npx getprismo optimize
|
|
47
|
-
npx getprismo context frontend
|
|
48
|
-
npx getprismo usage codex
|
|
49
|
-
npx getprismo usage claude
|
|
203
|
+
npx getprismo watch --rescue
|
|
50
204
|
```
|
|
51
205
|
|
|
52
|
-
|
|
206
|
+
it prints a paste-ready rescue prompt for the current ai coding session:
|
|
53
207
|
|
|
54
208
|
```text
|
|
55
|
-
|
|
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
|
+
}
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
live action causes include:
|
|
251
|
+
|
|
252
|
+
- `tool-output-flood`
|
|
253
|
+
- `artifact-leak`
|
|
254
|
+
- `possible-loop`
|
|
255
|
+
- `repeated-file-read`
|
|
256
|
+
- `context-spike`
|
|
257
|
+
- `high-context-pressure`
|
|
258
|
+
|
|
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.
|
|
260
|
+
|
|
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
|
+
```
|
|
56
272
|
|
|
57
|
-
|
|
58
|
-
Estimated avoidable waste: 20-40%
|
|
273
|
+
this writes:
|
|
59
274
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
5. CLAUDE.md is ~1,900 tokens
|
|
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:
|
|
66
280
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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.
|
|
71
286
|
```
|
|
72
287
|
|
|
73
|
-
|
|
288
|
+
use it with guardrails for the most proactive setup:
|
|
74
289
|
|
|
75
290
|
```bash
|
|
76
|
-
npx getprismo
|
|
291
|
+
npx getprismo watch --auto
|
|
77
292
|
```
|
|
78
293
|
|
|
79
|
-
|
|
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:
|
|
80
299
|
|
|
81
300
|
```bash
|
|
82
|
-
npx getprismo watch
|
|
301
|
+
npx getprismo watch --auto --no-events
|
|
83
302
|
```
|
|
84
303
|
|
|
85
|
-
|
|
304
|
+
---
|
|
86
305
|
|
|
87
|
-
|
|
306
|
+
## new: context firewall
|
|
307
|
+
|
|
308
|
+
generate a scoped context policy before a task:
|
|
88
309
|
|
|
89
310
|
```bash
|
|
90
|
-
npx getprismo
|
|
91
|
-
npx getprismo watch --once --json
|
|
311
|
+
npx getprismo firewall auth-bug
|
|
92
312
|
```
|
|
93
313
|
|
|
94
|
-
|
|
314
|
+
this writes:
|
|
95
315
|
|
|
96
|
-
|
|
316
|
+
```text
|
|
317
|
+
.prismo/context-firewall.md
|
|
318
|
+
.prismo/allowed-context.txt
|
|
319
|
+
.prismo/blocked-context.txt
|
|
320
|
+
.prismo/firewall-prompt.md
|
|
321
|
+
```
|
|
97
322
|
|
|
98
|
-
|
|
99
|
-
- Claude Code: reads local `~/.claude/projects/**/*.jsonl`
|
|
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.
|
|
100
324
|
|
|
101
|
-
|
|
325
|
+
example:
|
|
102
326
|
|
|
103
|
-
|
|
327
|
+
```text
|
|
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
|
+
```
|
|
104
340
|
|
|
105
|
-
|
|
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.
|
|
106
342
|
|
|
107
|
-
|
|
343
|
+
---
|
|
108
344
|
|
|
109
|
-
|
|
110
|
-
- `.prismo/backend-summary.md`
|
|
111
|
-
- `.prismo/frontend-summary.md`
|
|
112
|
-
- `.prismo/recommended-CLAUDE.md`
|
|
113
|
-
- `.prismo/recommended-AGENTS.md`
|
|
114
|
-
- `.prismo/recommended-.claudeignore`
|
|
115
|
-
- `.prismo/optimize-report.md`
|
|
345
|
+
## real output: cc timeline
|
|
116
346
|
|
|
117
|
-
|
|
347
|
+
run `npx getprismo cc timeline` after a session to understand what happened:
|
|
118
348
|
|
|
119
|
-
|
|
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:
|
|
396
|
+
|
|
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
|
|
442
|
+
|
|
443
|
+
```bash
|
|
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
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
if you don't have node installed, get it from [nodejs.org](https://nodejs.org) (LTS). then:
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
node -v # should print 18+
|
|
460
|
+
npx getprismo doctor
|
|
461
|
+
```
|
|
462
|
+
|
|
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 |
|
|
485
|
+
|
|
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
|
|
120
525
|
|
|
121
526
|
```bash
|
|
122
|
-
npx getprismo
|
|
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
|
|
123
533
|
```
|
|
124
534
|
|
|
125
|
-
|
|
535
|
+
---
|
|
126
536
|
|
|
127
|
-
|
|
128
|
-
- `.claudeignore.prismo-suggested` if `.claudeignore` already exists
|
|
129
|
-
- `prismo-dev-report.md`
|
|
130
|
-
- `prismo-optimized-CLAUDE.template.md`
|
|
131
|
-
- `prismo-AGENTS-recommendations.md`
|
|
537
|
+
## ci integration
|
|
132
538
|
|
|
133
|
-
|
|
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:
|
|
565
|
+
|
|
566
|
+
```bash
|
|
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
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
use these as the starting point for coding sessions instead of letting agents explore the whole repo.
|
|
575
|
+
|
|
576
|
+
---
|
|
577
|
+
|
|
578
|
+
## tracking modes
|
|
579
|
+
|
|
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
|
+
```
|
|
585
|
+
|
|
586
|
+
prismodev reads local session logs from:
|
|
587
|
+
- codex: `~/.codex/sessions/**/*.jsonl`
|
|
588
|
+
- claude code: `~/.claude/projects/**/*.jsonl`
|
|
589
|
+
|
|
590
|
+
no api keys. no intercepted prompts. no data uploaded.
|
|
591
|
+
|
|
592
|
+
---
|
|
593
|
+
|
|
594
|
+
## what gets generated
|
|
595
|
+
|
|
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
|
+
```
|
|
134
611
|
|
|
135
|
-
|
|
612
|
+
all recommendation files. nothing is overwritten. you decide what to use.
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
## init (npm project setup)
|
|
617
|
+
|
|
618
|
+
```bash
|
|
619
|
+
npx getprismo init
|
|
620
|
+
```
|
|
621
|
+
|
|
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
|
+
---
|
|
638
|
+
|
|
639
|
+
## philosophy
|
|
640
|
+
|
|
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.
|
|
646
|
+
|
|
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
|
|
136
675
|
|
|
137
676
|
```bash
|
|
138
677
|
npx getprismo --help
|
|
139
|
-
npx getprismo
|
|
140
|
-
npx getprismo setup --help
|
|
678
|
+
npx getprismo doctor --help
|
|
141
679
|
npx getprismo watch --help
|
|
142
|
-
npx getprismo
|
|
143
|
-
npx getprismo
|
|
680
|
+
npx getprismo cc --help
|
|
681
|
+
npx getprismo scan --help
|
|
144
682
|
```
|