Clauft is in closed beta. Sign-ups are temporarily disabled.
Session #4,291 · clauft/cli · 14 min ago

This session burned $2.47
on the same mistake
four times.

Claude tried to import Stripe at module scope in a use node file. The build failed. Claude retried with a different import. Failed again. Retried. Failed. Retried. Four attempts, same root causeone line in CLAUDE.md would have prevented all of them.

Error cascade detected 4 retries from same root cause
$2.47 wasted
T:1214:32Error: Cannot use import statement outside a module stripeActions.ts:3$0.18
T:1514:34Error: Stripe is not defined stripeActions.ts:7 (moved import inside function)$0.52
T:1914:37Error: require is not defined in ES module scope stripeActions.ts:3$0.84
T:2414:41Error: Module '"stripe"' has no default export stripeActions.ts:1$0.93
Clauft was watching
Chapter 1 Mission Control

Detected in real time.

The CLI daemon watches every Claude Code session. When the error cascade started, Mission Control flagged it immediatelycost, root cause, and wasted tokens, all visible in a single dashboard.

Mission Control
Debug Studio
Context Studio
Live Sessions
Add Stripe webhooks
clauft/cli4 errors
Refactor auth flow
clauft/web$0.34
Fix CSS overflow
clauft/web$0.12
!
Error cascade detected 4 retries from single root cause, $2.47 wasted tokens
Quality
31
Cost
$2.47
Cache
89%
Errors
4
Cascade Chainroot cause identified
T:12 import error
T:15 retry (moved import)
T:19 retry (require)
T:24 retry (default export)
Click Investigate
Chapter 2 Debug Studio

Investigated forensically.

One click opens the full transcript. Select the cascade messages, group them, annotate the root cause. Debug Studio traces the UUID chain automaticallyno guesswork, no scrolling through logs.

Mission Control
Debug Studio
Context Studio
11CLAUDEI'll add the Stripe webhook handler to stripeActions.ts...
12ERRORCannot use import statement outside a module stripeActions.ts:3
13CLAUDELet me try moving the import inside the function body...
15ERRORStripe is not defined stripeActions.ts:7
17CLAUDEI'll try using require() instead of import...
19ERRORrequire is not defined in ES module scope
24ERRORModule '"stripe"' has no default export
Annotations
Root Cause
Stripe SDK initialized at module scope in use node file. Convex requires lazy init pattern.
+ Add to CLAUDE.md
Fix
Use lazy init: let _stripe = null; function getStripe() { ... }
Insight
This pattern has occurred in 3 of the last 12 sessions involving Convex actions.
Group: Import Cascade
4 messages · $2.47 cost
T:12, T:15, T:19, T:24
Click Add to CLAUDE.md
Chapter 3 Context Studio

Improved permanently.

The root cause annotation becomes a CLAUDE.md rule. Context Studio scores the change, confirms it improves the file, and previews the score delta before you commit.

Mission Control
Debug Studio
Context Studio
# Convex Rules
 
## use node files
 
- Only contain actions (no queries/mutations)
- Split pattern: stripe.ts + stripeActions.ts
 
- Don't initialize SDKs at module scope
  use lazy init: let _stripe = null;
  function getStripe() { if (!_stripe)
  { _stripe = new Stripe(...); } }
 
- No hyphens in Convex file names
## http.ts
- Cannot have use node delegate to
  internal actions for Node.js work
84
Quality Score
+7 from this rule
Score Breakdown
Clarity
18
Completeness
16
Token Efficiency
17
Specificity
18
Consistency
15
Overnight, Dream Mode runs
Chapter 4 Dream Mode

Compounded overnight.

While you sleep, Dream Mode runs a 6-stage pipeline: summarize sessions, detect patterns, analyze rule compliance, and generate an improved CLAUDE.md with before/after scoring. Review the diff, save to your project, or compare side-by-side in split editor.

Dream Mode generated 1 improved CLAUDE.md

Analyzed 8 sessions. The lazy-init rule you added yesterday hit 95% complianceworking great. Found 2 new patterns and generated an improved version:

CLAUDE.md quality score 84 91+7
+Added: validate parentFolderId when creating folders (from pattern detection)
~Rewritten: Convex schema rule (was 25% compliance) (made more specific)
Apply to ProjectView DiffCompare with Current
Next morning, same project
The Result

Session #4,292 gets it right
on the first try.

Same project. Same developer. Same Stripe integration task. But now CLAUDE.md has the ruleand Claude uses the lazy init pattern without a single error.

Before
Session #4,291
Quality score31/100
Cost$2.47
Errors4 (cascade)
Duration14 min
Retries4
after
After
Session #4,292
Quality score94/100
Cost$0.34
Errors0
Duration3 min
Retries0
$ npm install -g @clauft/cli && clauft watch

Stop burning money on the
same mistakes.

The CLI is free and open source. Install it, run clauft watch, and every Claude Code session becomes data that makes the next one better.

Start free

Simple, honest pricing

CLI is free forever. Pay for the workbench.

Free
$0 /month
  • CLI session sync
  • 5 synced sessions retained
  • Basic quality score
  • Cost attribution
  • Cache efficiency analysis
  • Error cascade detection
  • DAG visualization
  • Subagent autopsy
  • Anti-pattern detection
  • Productivity metrics
  • Dream Mode (overnight AI)
  • Rule effectiveness analysis
  • API access
  • 5 MB max file size
Get started
Pro
$29 /month
  • CLI session sync
  • Unlimited sessions retained
  • Full quality score
  • Cost attribution
  • Cache efficiency analysis
  • Error cascade detection
  • DAG visualization
  • Subagent autopsy
  • Anti-pattern detection
  • Productivity metrics
  • Dream Mode (overnight AI)
  • Rule effectiveness analysis
  • API access
  • 25 MB max file size
Get Pro