inspecto 1.1.1 → 1.1.2
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 +79 -80
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,32 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
**Claude Code session quality analyzer — grade sessions, detect regressions, catch cache bugs.**
|
|
8
8
|
|
|
9
|
-
> CLI to grade Claude Code sessions — 915+ total downloads.
|
|
10
|
-
|
|
11
|
-
> AMD's AI director manually analyzed 7,000 Claude Code sessions to prove it got worse.
|
|
12
|
-
> `inspecto` automates that analysis for every developer.
|
|
13
|
-
|
|
14
|
-
| | `ccusage` | `claude-usage` | `Claude-Code-Usage-Monitor` | **`inspecto`** |
|
|
15
|
-
|---|---|---|---|---|
|
|
16
|
-
| Tracks token spend | ✅ | ✅ | ✅ | ✅ |
|
|
17
|
-
| Answers *"how much did I spend?"* | ✅ | ✅ | ✅ | ✅ |
|
|
18
|
-
| Detects quality regressions | ❌ | ❌ | ❌ | **✅** |
|
|
19
|
-
| Grades Claude's behavior | ❌ | ❌ | ❌ | **✅** |
|
|
20
|
-
| Catches silent cache bugs | ❌ | ❌ | ❌ | **✅** |
|
|
21
|
-
| Flags lazy editing patterns | ❌ | ❌ | ❌ | **✅** |
|
|
22
|
-
| Works fully offline, no API key | ✅ | ✅ | ✅ | **✅** |
|
|
23
|
-
|
|
24
|
-
The others answer *"how much did I spend?"*
|
|
25
|
-
|
|
26
|
-
`inspecto` answers: **"Is Claude Code getting worse for me — and can I prove it?"**
|
|
27
|
-
|
|
28
|
-
<img width="427" height="338" alt="Screenshot 2026-04-11 at 6 00 37 PM" src="https://github.com/user-attachments/assets/81777511-dd45-4ae0-8382-8e008dd98a7a" />
|
|
9
|
+
> CLI to grade Claude Code sessions — 915+ total downloads.
|
|
29
10
|
|
|
30
11
|
---
|
|
31
12
|
|
|
32
13
|
## What's New in v1.1.0
|
|
33
14
|
|
|
34
|
-
|
|
15
|
+
915+ downloads in. Thank you. Here's everything that shipped.
|
|
35
16
|
|
|
36
17
|
### 5 new quality metrics — 7 → 12
|
|
37
18
|
|
|
@@ -98,7 +79,73 @@ npx inspecto audit --no-fail # warns but never blocks
|
|
|
98
79
|
|
|
99
80
|
---
|
|
100
81
|
|
|
101
|
-
##
|
|
82
|
+
## Why I built this
|
|
83
|
+
|
|
84
|
+
In the 30 days before this tool existed:
|
|
85
|
+
|
|
86
|
+
- **Apr 7, 2026** — A Reddit post about Claude Code's declining quality hit 1,060 upvotes
|
|
87
|
+
- **Apr 6, 2026** — AMD's Director of AI filed a GitHub issue with data from 6,852 sessions proving Claude Code reads code 3x less before editing and rewrites entire files 2x more often than before
|
|
88
|
+
- **Mar 31, 2026** — Claude Code's source leaked via npm, revealing 2 cache bugs that silently inflate costs 10-20x
|
|
89
|
+
- **Mar 26, 2026** — Users on the $100/mo plan reported burning through limits in 90 minutes instead of 5 hours
|
|
90
|
+
|
|
91
|
+
AMD's AI director manually analyzed 7,000 sessions to prove it got worse. That shouldn't require manual analysis.
|
|
92
|
+
|
|
93
|
+
The tools that track token spending tell you *what* you used. `inspecto` tells you *whether it was worth it*.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## What it does
|
|
98
|
+
|
|
99
|
+
`inspecto` reads the JSONL session logs Claude Code already writes to `~/.claude/projects/` and grades every session across 12 quality metrics — no API key, no telemetry, fully offline.
|
|
100
|
+
|
|
101
|
+
| | `ccusage` | `claude-usage` | `Claude-Code-Usage-Monitor` | **`inspecto`** |
|
|
102
|
+
|---|---|---|---|---|
|
|
103
|
+
| Tracks token spend | ✅ | ✅ | ✅ | ✅ |
|
|
104
|
+
| Answers *"how much did I spend?"* | ✅ | ✅ | ✅ | ✅ |
|
|
105
|
+
| Detects quality regressions | ❌ | ❌ | ❌ | **✅** |
|
|
106
|
+
| Grades Claude's behavior | ❌ | ❌ | ❌ | **✅** |
|
|
107
|
+
| Catches silent cache bugs | ❌ | ❌ | ❌ | **✅** |
|
|
108
|
+
| Flags lazy editing patterns | ❌ | ❌ | ❌ | **✅** |
|
|
109
|
+
| Works fully offline, no API key | ✅ | ✅ | ✅ | **✅** |
|
|
110
|
+
|
|
111
|
+
The others answer *"how much did I spend?"*
|
|
112
|
+
|
|
113
|
+
`inspecto` answers: **"Is Claude Code getting worse for me — and can I prove it?"**
|
|
114
|
+
|
|
115
|
+
<img width="427" height="338" alt="Screenshot 2026-04-11 at 6 00 37 PM" src="https://github.com/user-attachments/assets/81777511-dd45-4ae0-8382-8e008dd98a7a" />
|
|
116
|
+
|
|
117
|
+
### The 12 quality metrics
|
|
118
|
+
|
|
119
|
+
Each metric is a pure function computed from your local session files.
|
|
120
|
+
|
|
121
|
+
| # | Metric | What it detects | Healthy |
|
|
122
|
+
|---|---|---|---|
|
|
123
|
+
| **M1** | Reads-before-edit ratio | Claude editing without reading context first | ≥ 4.0 |
|
|
124
|
+
| **M2** | Rewrite ratio | Full-file rewrites instead of surgical edits | ≤ 0.25 |
|
|
125
|
+
| **M3** | Cache hit rate | Prompt cache bugs inflating token costs | ≥ 0.50 |
|
|
126
|
+
| **M4** | Task completion | "I'll do X" promises without follow-through | ≥ 0.90 |
|
|
127
|
+
| **M5** | Retry density | User repeating themselves (proxy for misunderstanding) | ≤ 0.10 |
|
|
128
|
+
| **M6** | Tool diversity | Over-reliance on a narrow set of tools (Shannon entropy) | ≥ 0.60 |
|
|
129
|
+
| **M7** | Tokens per edit | Token cost per productive action | ≤ 5,000 |
|
|
130
|
+
| **M8** | Subagent overhead | Fraction of token work delegated to subagents | < 0.60 |
|
|
131
|
+
| **M9** | Tool error rate | Rate of tool calls returning errors | ≤ 5% |
|
|
132
|
+
| **M10** | Thinking utilization | Fraction of tool-using turns with extended thinking | ≥ 30% |
|
|
133
|
+
| **M11** | MCP usage | Count of MCP tool turns (informational) | — |
|
|
134
|
+
| **M12** | Session cost | Total estimated session cost | ≤ $2.00 |
|
|
135
|
+
|
|
136
|
+
### How it works
|
|
137
|
+
|
|
138
|
+
Claude Code writes one JSONL session file per conversation to `~/.claude/projects/{project}/{sessionId}.jsonl`. Each line is a JSON record — user messages, assistant responses (streamed as multiple chunks), tool calls, and tool results. Subagent sessions land in `{sessionId}/subagents/agent-*.jsonl`.
|
|
139
|
+
|
|
140
|
+
`inspecto` streams these files line-by-line (never loading 100MB+ files into memory), merges streaming chunks by `message.id`, aggregates subagent turns into the parent session, extracts tool-use patterns and token usage, and computes the 12 metrics above.
|
|
141
|
+
|
|
142
|
+
The composite grade is a weighted average mapped to a letter grade from **A+** to **F**.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## How to use it
|
|
147
|
+
|
|
148
|
+
### Install
|
|
102
149
|
|
|
103
150
|
```bash
|
|
104
151
|
npm install -g inspecto
|
|
@@ -114,8 +161,6 @@ Requires Node.js >= 22 (uses the built-in `node:sqlite` module). Works on macOS,
|
|
|
114
161
|
|
|
115
162
|
---
|
|
116
163
|
|
|
117
|
-
## Usage
|
|
118
|
-
|
|
119
164
|
### Grade your most recent session
|
|
120
165
|
|
|
121
166
|
```bash
|
|
@@ -204,15 +249,15 @@ npx inspecto compare --projects my-app,api-gateway,shared-lib
|
|
|
204
249
|
|
|
205
250
|
### Manage the grade cache
|
|
206
251
|
|
|
207
|
-
`inspecto trend` and `inspecto compare` cache computed grade results in `~/.claude/inspecto-cache.db` so re-runs over the same sessions are near-instant. The cache is keyed by file path + mtime, so it invalidates automatically when Claude Code writes new data to a session.
|
|
208
|
-
|
|
209
252
|
```bash
|
|
210
253
|
npx inspecto cache clear # delete the cache file (~/.claude/inspecto-cache.db)
|
|
211
254
|
```
|
|
212
255
|
|
|
256
|
+
`inspecto trend` and `inspecto compare` cache computed grades in `~/.claude/inspecto-cache.db`. The cache is keyed by file path + mtime and invalidates automatically when Claude Code writes new data.
|
|
257
|
+
|
|
213
258
|
---
|
|
214
259
|
|
|
215
|
-
|
|
260
|
+
### CI integration
|
|
216
261
|
|
|
217
262
|
`inspecto` exits with a non-zero code when quality drops below acceptable thresholds:
|
|
218
263
|
|
|
@@ -223,7 +268,7 @@ npx inspecto cache clear # delete the cache file (~/.claude/inspecto-cache.db)
|
|
|
223
268
|
| `inspecto cache-check` | Any session has a cache anomaly |
|
|
224
269
|
| `inspecto compare` | Never (comparison is informational) |
|
|
225
270
|
|
|
226
|
-
Use `--no-fail`
|
|
271
|
+
Use `--no-fail` to always exit 0:
|
|
227
272
|
|
|
228
273
|
```bash
|
|
229
274
|
# In a pre-push hook — warn but don't block
|
|
@@ -238,9 +283,7 @@ npx inspecto audit --format csv --no-fail >> metrics.csv
|
|
|
238
283
|
|
|
239
284
|
---
|
|
240
285
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
All commands default to terminal output with color and tables. For scripting:
|
|
286
|
+
### Output formats
|
|
244
287
|
|
|
245
288
|
```bash
|
|
246
289
|
# Structured JSON
|
|
@@ -252,13 +295,13 @@ npx inspecto audit --format csv
|
|
|
252
295
|
npx inspecto trend --format csv
|
|
253
296
|
```
|
|
254
297
|
|
|
255
|
-
`audit --format csv`
|
|
298
|
+
`audit --format csv` — one row per metric: `name,value,status,label`
|
|
256
299
|
|
|
257
|
-
`trend --format csv`
|
|
300
|
+
`trend --format csv` — one row per metric: `name,recentAvg,fullAvg,changePercent,status`
|
|
258
301
|
|
|
259
302
|
---
|
|
260
303
|
|
|
261
|
-
|
|
304
|
+
### Global options
|
|
262
305
|
|
|
263
306
|
| Flag | Commands | Description |
|
|
264
307
|
|---|---|---|
|
|
@@ -273,30 +316,9 @@ npx inspecto trend --format csv
|
|
|
273
316
|
|
|
274
317
|
---
|
|
275
318
|
|
|
276
|
-
|
|
319
|
+
### What to do about it
|
|
277
320
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
| # | Metric | What it detects | Healthy |
|
|
281
|
-
|---|---|---|---|
|
|
282
|
-
| **M1** | Reads-before-edit ratio | Claude editing without reading context first | ≥ 4.0 |
|
|
283
|
-
| **M2** | Rewrite ratio | Full-file rewrites instead of surgical edits | ≤ 0.25 |
|
|
284
|
-
| **M3** | Cache hit rate | Prompt cache bugs inflating token costs | ≥ 0.50 |
|
|
285
|
-
| **M4** | Task completion | "I'll do X" promises without follow-through | ≥ 0.90 |
|
|
286
|
-
| **M5** | Retry density | User repeating themselves (proxy for misunderstanding) | ≤ 0.10 |
|
|
287
|
-
| **M6** | Tool diversity | Over-reliance on a narrow set of tools (Shannon entropy) | ≥ 0.60 |
|
|
288
|
-
| **M7** | Tokens per edit | Token cost per productive action | ≤ 5,000 |
|
|
289
|
-
| **M8** | Subagent overhead | Fraction of token work delegated to subagents | < 0.60 |
|
|
290
|
-
| **M9** | Tool error rate | Rate of tool calls returning errors | ≤ 5% |
|
|
291
|
-
| **M10** | Thinking utilization | Fraction of tool-using turns with extended thinking | ≥ 30% |
|
|
292
|
-
| **M11** | MCP usage | Count of MCP tool turns (informational) | — |
|
|
293
|
-
| **M12** | Session cost | Total estimated session cost | ≤ $2.00 |
|
|
294
|
-
|
|
295
|
-
---
|
|
296
|
-
|
|
297
|
-
## What to do about it
|
|
298
|
-
|
|
299
|
-
Once inspecto shows you where your sessions are degrading, here's how to fix each metric:
|
|
321
|
+
Once inspecto shows you where sessions are degrading, here's how to fix each metric:
|
|
300
322
|
|
|
301
323
|
| Metric | Symptom | Fix |
|
|
302
324
|
|---|---|---|
|
|
@@ -316,29 +338,6 @@ Once inspecto shows you where your sessions are degrading, here's how to fix eac
|
|
|
316
338
|
|
|
317
339
|
---
|
|
318
340
|
|
|
319
|
-
## How it works
|
|
320
|
-
|
|
321
|
-
Claude Code writes one JSONL session file per conversation to `~/.claude/projects/{project}/{sessionId}.jsonl`. Each line is a JSON record — user messages, assistant responses (streamed as multiple chunks), tool calls, and tool results. Subagent sessions land in `{sessionId}/subagents/agent-*.jsonl`.
|
|
322
|
-
|
|
323
|
-
`inspecto` streams these files line-by-line (never loading 100MB+ files into memory), merges streaming chunks by `message.id`, aggregates subagent turns into the parent session, extracts tool-use patterns and token usage, and computes the 12 metrics above.
|
|
324
|
-
|
|
325
|
-
The composite grade is a weighted average mapped to a letter grade from **A+** to **F**. Grades below **D+** (score < 67) trigger a non-zero exit code in CI mode.
|
|
326
|
-
|
|
327
|
-
---
|
|
328
|
-
|
|
329
|
-
## Why this exists
|
|
330
|
-
|
|
331
|
-
In the 30 days before this tool was built:
|
|
332
|
-
|
|
333
|
-
- **Apr 7, 2026** — A Reddit post about Claude Code's declining quality hit 1,060 upvotes
|
|
334
|
-
- **Apr 6, 2026** — AMD's Director of AI filed a GitHub issue with data from 6,852 sessions proving Claude Code reads code 3x less before editing and rewrites entire files 2x more often than before
|
|
335
|
-
- **Mar 31, 2026** — Claude Code's source leaked via npm, revealing 2 cache bugs that silently inflate costs 10-20x
|
|
336
|
-
- **Mar 26, 2026** — Users on the $100/mo plan reported burning through limits in 90 minutes instead of 5 hours
|
|
337
|
-
|
|
338
|
-
The tools that track token spending tell you *what* you used. `inspecto` tells you *whether it was worth it*.
|
|
339
|
-
|
|
340
|
-
---
|
|
341
|
-
|
|
342
341
|
## Development
|
|
343
342
|
|
|
344
343
|
```bash
|
package/package.json
CHANGED