You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Closes#277.
Every paste-style fix now declares an explicit `destination` so users can
tell at a glance whether a suggestion belongs in CLAUDE.md as a permanent
rule, in a one-time session opener, in the current chat as an ask, or in
a shell config file. Previously the prompts had no labeled home and users
were dropping one-time session openers into CLAUDE.md as permanent rules.
Type changes:
- New `PasteDestination` union: `claude-md` / `session-opener` / `prompt`
/ `shell-config`
- `WasteAction.paste` gains `destination?: PasteDestination`
Renderer changes:
- CLI `optimize` command (renderOptimize → renderFinding) prints a
section header above each fix block:
-- Suggested CLAUDE.md addition (permanent rule) ───
-- One-time session opener (do NOT add to CLAUDE.md) ───
-- Ask Claude in the current session ───
-- Add to your shell config ───
-- Run this command ───
- Interactive dashboard (FindingAction in dashboard.tsx) gets the same
treatment so the in-popover findings list reads identically.
Existing fixes retagged appropriately. Two existing prompts that lacked
destination context altogether ("Set a delivery checkpoint at the start
of the next expensive thread", "Start the next expensive thread with a
fresh-context constraint") now read as one-time session openers with a
clear "do not add to CLAUDE.md" hint — the exact failure mode the
reporter described.
Tests:
- Existing `detectJunkReads` test extended to assert the destination tag.
- New regression block walks every detector that emits a paste-style fix
and asserts each one declares a destination — future detectors that
ship without one get caught here.
text: `Do not read or search files under these directories unless I explicitly ask: ${dirsToAvoid}.`,
459
472
},
@@ -513,6 +526,7 @@ export function detectDuplicateReads(calls: ToolCall[], dateRange?: DateRange):
513
526
tokensSaved,
514
527
fix: {
515
528
type: 'paste',
529
+
destination: 'prompt',
516
530
label: 'Point Claude at exact locations in your prompt, for example:',
517
531
text: 'In <file> lines <start>-<end>, look at the <function> function.',
518
532
},
@@ -960,7 +974,8 @@ export function detectBloatedClaudeMd(projectCwds: Set<string>): WasteFinding |
960
974
tokensSaved,
961
975
fix: {
962
976
type: 'paste',
963
-
label: 'Ask Claude to trim it:',
977
+
destination: 'prompt',
978
+
label: 'Ask Claude in the current session to trim it:',
964
979
text: `Review CLAUDE.md and all @-imported files. Cut total expanded content to under ${CLAUDEMD_HEALTHY_LINES} lines. Remove anything Claude can figure out from the code itself. Keep only rules, gotchas, and non-obvious conventions.`,
@@ -1417,7 +1435,8 @@ export function detectLowWorthSessions(projects: ProjectSummary[]): WasteFinding
1417
1435
tokensSaved,
1418
1436
fix: {
1419
1437
type: 'paste',
1420
-
label: 'Set a delivery checkpoint at the start of the next expensive thread:',
1438
+
destination: 'session-opener',
1439
+
label: 'Paste at the start of your NEXT expensive thread (one-time, do not add to CLAUDE.md):',
1421
1440
text: 'Before continuing, name the deliverable in one sentence (PR title, file changed, command output you expect). Stop and check with me if (a) you spend more than 10 minutes without an edit, or (b) the same approach fails twice. Do not retry past two attempts on any single fix.',
1422
1441
},
1423
1442
}
@@ -1529,7 +1548,8 @@ export function detectContextBloat(projects: ProjectSummary[], excludedSessionId
1529
1548
tokensSaved,
1530
1549
fix: {
1531
1550
type: 'paste',
1532
-
label: 'Start the next expensive thread with a fresh-context constraint:',
1551
+
destination: 'session-opener',
1552
+
label: 'Paste at the start of your NEXT expensive thread (one-time, do not add to CLAUDE.md):',
1533
1553
text: 'Start fresh before continuing. Use only the current goal, the relevant files, the failing command/output, and the constraints below. Restate the working context in under 10 bullets before editing.',
1534
1554
},
1535
1555
}
@@ -1598,7 +1618,8 @@ export function detectSessionOutliers(projects: ProjectSummary[], excludedSessio
1598
1618
tokensSaved,
1599
1619
fix: {
1600
1620
type: 'paste',
1601
-
label: 'For expensive work, start with a tighter operating constraint:',
1621
+
destination: 'session-opener',
1622
+
label: 'Paste at the start of your NEXT expensive thread (one-time, do not add to CLAUDE.md):',
1602
1623
text: 'Before making changes, summarize the smallest viable plan. Keep context narrow, avoid broad searches, and stop after the first working patch so I can review before continuing.',
0 commit comments