@mrclrchtr/supi-claude-md 1.7.0 → 1.8.1

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.
Files changed (29) hide show
  1. package/README.md +2 -2
  2. package/node_modules/@mrclrchtr/supi-core/README.md +3 -13
  3. package/node_modules/@mrclrchtr/supi-core/package.json +13 -8
  4. package/node_modules/@mrclrchtr/supi-core/src/api.ts +26 -92
  5. package/node_modules/@mrclrchtr/supi-core/src/config.ts +11 -0
  6. package/node_modules/@mrclrchtr/supi-core/src/context.ts +16 -0
  7. package/node_modules/@mrclrchtr/supi-core/src/index.ts +26 -92
  8. package/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
  9. package/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
  10. package/node_modules/@mrclrchtr/supi-core/src/session.ts +4 -0
  11. package/node_modules/@mrclrchtr/supi-core/src/settings-ui.ts +2 -0
  12. package/node_modules/@mrclrchtr/supi-core/src/settings.ts +9 -0
  13. package/node_modules/@mrclrchtr/supi-core/src/substrate-types.ts +11 -0
  14. package/node_modules/@mrclrchtr/supi-core/src/types.ts +2 -0
  15. package/package.json +5 -5
  16. package/skills/claude-md-improver/SKILL.md +31 -20
  17. package/skills/claude-md-improver/references/quality-criteria.md +20 -17
  18. package/skills/claude-md-improver/references/templates.md +32 -46
  19. package/skills/claude-md-improver/references/update-guidelines.md +74 -18
  20. package/skills/claude-md-revision/SKILL.md +15 -5
  21. package/skills/claude-md-revision/evals/evals.json +2 -1
  22. package/skills/claude-md-revision/references/quality-criteria.md +20 -17
  23. package/skills/claude-md-revision/references/templates.md +32 -46
  24. package/skills/claude-md-revision/references/update-guidelines.md +74 -18
  25. package/src/config.ts +1 -1
  26. package/src/discovery.ts +11 -6
  27. package/src/settings-registration.ts +2 -5
  28. package/src/subdirectory.ts +1 -1
  29. package/node_modules/@mrclrchtr/supi-core/src/extension.ts +0 -1
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ ![SuPi](assets/logo.png)
2
+
1
3
  # @mrclrchtr/supi-claude-md
2
4
 
3
5
  Adds subdirectory context-file discovery to the [pi coding agent](https://github.com/earendil-works/pi).
@@ -16,8 +18,6 @@ For local development:
16
18
  pi install ./packages/supi-claude-md
17
19
  ```
18
20
 
19
- After editing the source, run `/reload`.
20
-
21
21
  ## What you get
22
22
 
23
23
  When the agent touches a file or directory inside the project, this package can inject nearby subdirectory context files into the conversation.
@@ -1,29 +1,20 @@
1
+ ![SuPi](assets/logo.png)
2
+
1
3
  # @mrclrchtr/supi-core
2
4
 
3
5
  Shared infrastructure for SuPi extensions.
4
6
 
5
- This package is mainly for extension authors. It gives you a common config system, settings plumbing, context helpers, registries, and a small extension surface that registers `/supi-settings`.
7
+ This is a **pure library** it does not register any pi commands or tools. The `/supi-settings` command is now available through `@mrclrchtr/supi-settings`.
6
8
 
7
9
  ## Install
8
10
 
9
- ### As a dependency for another extension
10
-
11
11
  ```bash
12
12
  pnpm add @mrclrchtr/supi-core
13
13
  ```
14
14
 
15
- ### As a pi package
16
-
17
- ```bash
18
- pi install npm:@mrclrchtr/supi-core
19
- ```
20
-
21
- Installing it as a pi package adds the minimal `/supi-settings` extension surface.
22
-
23
15
  ## Package surfaces
24
16
 
25
17
  - `@mrclrchtr/supi-core/api` — reusable helpers for other packages and extensions
26
- - `@mrclrchtr/supi-core/extension` — minimal pi extension that registers `/supi-settings`
27
18
 
28
19
  ## What you get from the API
29
20
 
@@ -101,7 +92,6 @@ const message = wrapExtensionContext("my-extension", "hello", {
101
92
  ## Source
102
93
 
103
94
  - `src/api.ts` — exported library surface
104
- - `src/extension.ts` — minimal `/supi-settings` entrypoint
105
95
  - `src/config.ts` — shared config loading and writing
106
96
  - `src/config-settings.ts` — config-backed settings registration helper
107
97
  - `src/settings-ui.ts` — shared settings overlay
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-core",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "SuPi core — shared infrastructure for SuPi extensions (XML context tags, config system)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,12 +37,17 @@
37
37
  "main": "src/api.ts",
38
38
  "exports": {
39
39
  "./api": "./src/api.ts",
40
- "./extension": "./src/extension.ts",
41
- "./package.json": "./package.json"
42
- },
43
- "pi": {
44
- "extensions": [
45
- "./src/extension.ts"
46
- ]
40
+ "./config": "./src/config.ts",
41
+ "./context": "./src/context.ts",
42
+ "./debug": "./src/debug-registry.ts",
43
+ "./package.json": "./package.json",
44
+ "./path": "./src/path.ts",
45
+ "./project": "./src/project.ts",
46
+ "./session": "./src/session.ts",
47
+ "./settings": "./src/settings.ts",
48
+ "./settings-ui": "./src/settings-ui.ts",
49
+ "./terminal": "./src/terminal.ts",
50
+ "./tool-framework": "./src/tool-framework.ts",
51
+ "./types": "./src/types.ts"
47
52
  }
48
53
  }
@@ -1,96 +1,30 @@
1
1
  // supi-core — shared infrastructure for SuPi extensions.
2
2
  // Provides XML context tag wrapping, unified config system, context-message utilities,
3
3
  // settings registry for supi-wide TUI settings, and a shared tool-spec/registration framework.
4
+ //
5
+ // Convenience barrel — re-exports all domain entry points.
6
+ // For lighter imports, use one of the domain subpaths directly
7
+ // (e.g. @mrclrchtr/supi-core/config, @mrclrchtr/supi-core/context).
4
8
 
5
- export type { SupiConfigLocation, SupiConfigOptions } from "./config/config.ts";
6
- export {
7
- loadSupiConfig,
8
- loadSupiConfigForScope,
9
- readJsonFile,
10
- removeSupiConfigKey,
11
- writeSupiConfig,
12
- } from "./config/config.ts";
13
- export type { ConfigSettingsHelpers, ConfigSettingsOptions } from "./config/config-settings.ts";
14
- export { registerConfigSettings } from "./config/config-settings.ts";
15
- export type { ContextMessageLike } from "./context/context-messages.ts";
16
- export {
17
- findLastUserMessageIndex,
18
- getContextToken,
19
- getPromptContent,
20
- pruneAndReorderContextMessages,
21
- restorePromptContent,
22
- } from "./context/context-messages.ts";
23
- export type { ContextProvider } from "./context/context-provider-registry.ts";
24
- export {
25
- clearRegisteredContextProviders,
26
- getRegisteredContextProviders,
27
- registerContextProvider,
28
- } from "./context/context-provider-registry.ts";
29
- export { wrapExtensionContext } from "./context/context-tag.ts";
30
- export type {
31
- DebugAgentAccess,
32
- DebugEvent,
33
- DebugEventInput,
34
- DebugEventQuery,
35
- DebugEventQueryResult,
36
- DebugEventView,
37
- DebugLevel,
38
- DebugNotifyLevel,
39
- DebugRegistryConfig,
40
- DebugSummary,
41
- } from "./debug-registry.ts";
42
- export {
43
- clearDebugEvents,
44
- configureDebugRegistry,
45
- DEBUG_REGISTRY_DEFAULTS,
46
- getDebugEvents,
47
- getDebugRegistryConfig,
48
- getDebugSummary,
49
- recordDebugEvent,
50
- redactDebugData,
51
- resetDebugRegistry,
52
- } from "./debug-registry.ts";
53
- export { fileToUri, resolveToolPath, stripToolPathPrefix, uriToFile } from "./path-utils.ts";
54
- export type { KnownRootEntry } from "./project-roots.ts";
55
- export {
56
- buildKnownRootsMap,
57
- byPathDepth,
58
- dedupeTopmostRoots,
59
- findProjectRoot,
60
- isWithin,
61
- isWithinOrEqual,
62
- mergeKnownRoots,
63
- resolveKnownRoot,
64
- segmentCount,
65
- sortRootsBySpecificity,
66
- walkProject,
67
- } from "./project-roots.ts";
68
- export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
69
- export { getActiveBranchEntries } from "./session-utils.ts";
70
- export { registerSettingsCommand } from "./settings/settings-command.ts";
71
- export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
72
- export {
73
- clearRegisteredSettings,
74
- getRegisteredSettings,
75
- registerSettings,
76
- } from "./settings/settings-registry.ts";
77
- export { createInputSubmenu, openSettingsOverlay } from "./settings/settings-ui.ts";
78
- export type { TitleTarget } from "./terminal.ts";
79
- export {
80
- DONE_SYMBOL,
81
- formatTitle,
82
- signalBell,
83
- signalDone,
84
- signalWaiting,
85
- WAITING_SYMBOL,
86
- } from "./terminal.ts";
87
- export type { SuiPiToolPromptSurface, SuiPiToolSpec, ToolExecuteFn } from "./tool-framework.ts";
88
- export {
89
- CharacterParam,
90
- derivePromptSurface,
91
- FileParam,
92
- LineParam,
93
- MaxResultsParam,
94
- registerSuiPiTools,
95
- SymbolParam,
96
- } from "./tool-framework.ts";
9
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
10
+ export * from "./config.ts";
11
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
12
+ export * from "./context.ts";
13
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
14
+ export * from "./debug-registry.ts";
15
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
16
+ export * from "./path.ts";
17
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
18
+ export * from "./project.ts";
19
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
20
+ export * from "./session.ts";
21
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
22
+ export * from "./settings.ts";
23
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
24
+ export * from "./settings-ui.ts";
25
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
26
+ export * from "./terminal.ts";
27
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
28
+ export * from "./tool-framework.ts";
29
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
30
+ export * from "./types.ts";
@@ -0,0 +1,11 @@
1
+ // supi-core config domain — config loading and config-settings helpers.
2
+ export type { SupiConfigLocation, SupiConfigOptions } from "./config/config.ts";
3
+ export {
4
+ loadSupiConfig,
5
+ loadSupiConfigForScope,
6
+ readJsonFile,
7
+ removeSupiConfigKey,
8
+ writeSupiConfig,
9
+ } from "./config/config.ts";
10
+ export type { ConfigSettingsHelpers, ConfigSettingsOptions } from "./config/config-settings.ts";
11
+ export { registerConfigSettings } from "./config/config-settings.ts";
@@ -0,0 +1,16 @@
1
+ // supi-core context domain — context messages, providers, and XML tags.
2
+ export type { ContextMessageLike } from "./context/context-messages.ts";
3
+ export {
4
+ findLastUserMessageIndex,
5
+ getContextToken,
6
+ getPromptContent,
7
+ pruneAndReorderContextMessages,
8
+ restorePromptContent,
9
+ } from "./context/context-messages.ts";
10
+ export type { ContextProvider } from "./context/context-provider-registry.ts";
11
+ export {
12
+ clearRegisteredContextProviders,
13
+ getRegisteredContextProviders,
14
+ registerContextProvider,
15
+ } from "./context/context-provider-registry.ts";
16
+ export { wrapExtensionContext } from "./context/context-tag.ts";
@@ -1,96 +1,30 @@
1
1
  // supi-core — shared infrastructure for SuPi extensions.
2
2
  // Provides XML context tag wrapping, unified config system, context-message utilities,
3
3
  // settings registry for supi-wide TUI settings, and a shared tool-spec/registration framework.
4
+ //
5
+ // Convenience barrel — re-exports all domain entry points.
6
+ // For lighter imports, use one of the domain subpaths directly
7
+ // (e.g. @mrclrchtr/supi-core/config, @mrclrchtr/supi-core/context).
4
8
 
5
- export type { SupiConfigLocation, SupiConfigOptions } from "./config/config.ts";
6
- export {
7
- loadSupiConfig,
8
- loadSupiConfigForScope,
9
- readJsonFile,
10
- removeSupiConfigKey,
11
- writeSupiConfig,
12
- } from "./config/config.ts";
13
- export type { ConfigSettingsHelpers, ConfigSettingsOptions } from "./config/config-settings.ts";
14
- export { registerConfigSettings } from "./config/config-settings.ts";
15
- export type { ContextMessageLike } from "./context/context-messages.ts";
16
- export {
17
- findLastUserMessageIndex,
18
- getContextToken,
19
- getPromptContent,
20
- pruneAndReorderContextMessages,
21
- restorePromptContent,
22
- } from "./context/context-messages.ts";
23
- export type { ContextProvider } from "./context/context-provider-registry.ts";
24
- export {
25
- clearRegisteredContextProviders,
26
- getRegisteredContextProviders,
27
- registerContextProvider,
28
- } from "./context/context-provider-registry.ts";
29
- export { wrapExtensionContext } from "./context/context-tag.ts";
30
- export type {
31
- DebugAgentAccess,
32
- DebugEvent,
33
- DebugEventInput,
34
- DebugEventQuery,
35
- DebugEventQueryResult,
36
- DebugEventView,
37
- DebugLevel,
38
- DebugNotifyLevel,
39
- DebugRegistryConfig,
40
- DebugSummary,
41
- } from "./debug-registry.ts";
42
- export {
43
- clearDebugEvents,
44
- configureDebugRegistry,
45
- DEBUG_REGISTRY_DEFAULTS,
46
- getDebugEvents,
47
- getDebugRegistryConfig,
48
- getDebugSummary,
49
- recordDebugEvent,
50
- redactDebugData,
51
- resetDebugRegistry,
52
- } from "./debug-registry.ts";
53
- export { fileToUri, resolveToolPath, stripToolPathPrefix, uriToFile } from "./path-utils.ts";
54
- export type { KnownRootEntry } from "./project-roots.ts";
55
- export {
56
- buildKnownRootsMap,
57
- byPathDepth,
58
- dedupeTopmostRoots,
59
- findProjectRoot,
60
- isWithin,
61
- isWithinOrEqual,
62
- mergeKnownRoots,
63
- resolveKnownRoot,
64
- segmentCount,
65
- sortRootsBySpecificity,
66
- walkProject,
67
- } from "./project-roots.ts";
68
- export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
69
- export { getActiveBranchEntries } from "./session-utils.ts";
70
- export { registerSettingsCommand } from "./settings/settings-command.ts";
71
- export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
72
- export {
73
- clearRegisteredSettings,
74
- getRegisteredSettings,
75
- registerSettings,
76
- } from "./settings/settings-registry.ts";
77
- export { createInputSubmenu, openSettingsOverlay } from "./settings/settings-ui.ts";
78
- export type { TitleTarget } from "./terminal.ts";
79
- export {
80
- DONE_SYMBOL,
81
- formatTitle,
82
- signalBell,
83
- signalDone,
84
- signalWaiting,
85
- WAITING_SYMBOL,
86
- } from "./terminal.ts";
87
- export type { SuiPiToolPromptSurface, SuiPiToolSpec, ToolExecuteFn } from "./tool-framework.ts";
88
- export {
89
- CharacterParam,
90
- derivePromptSurface,
91
- FileParam,
92
- LineParam,
93
- MaxResultsParam,
94
- registerSuiPiTools,
95
- SymbolParam,
96
- } from "./tool-framework.ts";
9
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
10
+ export * from "./config.ts";
11
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
12
+ export * from "./context.ts";
13
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
14
+ export * from "./debug-registry.ts";
15
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
16
+ export * from "./path.ts";
17
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
18
+ export * from "./project.ts";
19
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
20
+ export * from "./session.ts";
21
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
22
+ export * from "./settings.ts";
23
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
24
+ export * from "./settings-ui.ts";
25
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
26
+ export * from "./terminal.ts";
27
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
28
+ export * from "./tool-framework.ts";
29
+ // biome-ignore lint/performance/noReExportAll: intentional convenience barrel
30
+ export * from "./types.ts";
@@ -0,0 +1,2 @@
1
+ // supi-core path domain — file and URI path utilities.
2
+ export { fileToUri, resolveToolPath, stripToolPathPrefix, uriToFile } from "./path-utils.ts";
@@ -0,0 +1,15 @@
1
+ // supi-core project domain — project root discovery and traversal.
2
+ export type { KnownRootEntry } from "./project-roots.ts";
3
+ export {
4
+ buildKnownRootsMap,
5
+ byPathDepth,
6
+ dedupeTopmostRoots,
7
+ findProjectRoot,
8
+ isWithin,
9
+ isWithinOrEqual,
10
+ mergeKnownRoots,
11
+ resolveKnownRoot,
12
+ segmentCount,
13
+ sortRootsBySpecificity,
14
+ walkProject,
15
+ } from "./project-roots.ts";
@@ -0,0 +1,4 @@
1
+ // supi-core session domain — session utilities and registries.
2
+
3
+ export { createRegistry, createSessionStateRegistry } from "./registry-utils.ts";
4
+ export { getActiveBranchEntries } from "./session-utils.ts";
@@ -0,0 +1,2 @@
1
+ // supi-core settings-ui domain — settings TUI components (imports pi-tui at runtime, heavy).
2
+ export { createInputSubmenu, openSettingsOverlay } from "./settings/settings-ui.ts";
@@ -0,0 +1,9 @@
1
+ // supi-core settings domain — settings registry (lightweight, type-only pi-tui import).
2
+
3
+ export { registerSettingsCommand } from "./settings/settings-command.ts";
4
+ export type { SettingsScope, SettingsSection } from "./settings/settings-registry.ts";
5
+ export {
6
+ clearRegisteredSettings,
7
+ getRegisteredSettings,
8
+ registerSettings,
9
+ } from "./settings/settings-registry.ts";
@@ -0,0 +1,11 @@
1
+ /** 0-based position used by LSP and code-intelligence internally. */
2
+ export interface CodePosition {
3
+ line: number;
4
+ character: number;
5
+ }
6
+
7
+ /** Normalized location — flat replacement for LSP's nested Location/range shape. */
8
+ export interface CodeLocation {
9
+ uri: string;
10
+ range: { start: CodePosition; end: CodePosition };
11
+ }
@@ -0,0 +1,2 @@
1
+ // supi-core types domain — shared substrate types (zero dependencies, pure types).
2
+ export type { CodeLocation, CodePosition } from "./substrate-types.ts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrclrchtr/supi-claude-md",
3
- "version": "1.7.0",
3
+ "version": "1.8.1",
4
4
  "description": "SuPi claude-md extension — automatic subdirectory context injection for pi",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -21,7 +21,7 @@
21
21
  "!__tests__"
22
22
  ],
23
23
  "dependencies": {
24
- "@mrclrchtr/supi-core": "1.7.0"
24
+ "@mrclrchtr/supi-core": "1.8.1"
25
25
  },
26
26
  "bundledDependencies": [
27
27
  "@mrclrchtr/supi-core"
@@ -40,9 +40,9 @@
40
40
  },
41
41
  "pi": {
42
42
  "extensions": [
43
- "./src/extension.ts",
44
- "node_modules/@mrclrchtr/supi-core/src/extension.ts"
45
- ]
43
+ "./src/extension.ts"
44
+ ],
45
+ "image": "https://raw.githubusercontent.com/mrclrchtr/supi/main/packages/supi-claude-md/assets/logo.png"
46
46
  },
47
47
  "main": "src/api.ts",
48
48
  "exports": {
@@ -41,6 +41,7 @@ Add rows for any additional categories visible in context.
41
41
 
42
42
  - **Root-level high risk** (already auto-delivered; do NOT recommend for root `./CLAUDE.md`):
43
43
  - Package/module inventories (from `supi-code-intelligence`)
44
+ - Package layout / project structure sections that just list packages with descriptions (from `supi-code-intelligence`)
44
45
  - Root directory trees and file counts (from `supi-code-intelligence`)
45
46
  - Dependency graphs from manifests (from `supi-code-intelligence`)
46
47
  - High-level architecture without project-specific reasoning (from `supi-code-intelligence`)
@@ -49,7 +50,7 @@ Add rows for any additional categories visible in context.
49
50
  - Subdirectory CLAUDE.md/AGENTS.md already injected by `supi-claude-md` during this session
50
51
 
51
52
  - **Low risk** (not auto-delivered; safe to recommend in CLAUDE.md at any scope):
52
- - Commands and workflows
53
+ - Non-obvious commands and workflows (not routine build/test/lint — those are in package.json)
53
54
  - Gotchas and non-obvious patterns
54
55
  - Cross-package conventions not obvious from manifests
55
56
  - Curated "start here" guidance with ownership or boundary reasoning
@@ -108,7 +109,7 @@ For each CLAUDE.md file found in Phase 2, evaluate against quality criteria, inc
108
109
 
109
110
  | Criterion | Weight | Check |
110
111
  |-----------|--------|-------|
111
- | Commands/workflows documented | High | Are build/test/deploy commands present? |
112
+ | Commands/workflows documented | High | Are non-obvious commands/workflows captured (not routine build/test)? |
112
113
  | Architecture clarity | High | Can PI understand the codebase structure? |
113
114
  | Non-obvious patterns | Medium | Are gotchas and quirks documented? |
114
115
  | Conciseness | Medium | No verbose explanations or obvious info? |
@@ -136,6 +137,9 @@ Format:
136
137
  - Files found: X
137
138
  - Average score: X/100
138
139
  - Files needing update: X
140
+ - Potential token savings: ~X (removing redundant/auto-delivered content)
141
+
142
+ **Auto-delivered content overlaps are never "minor" or "not worth the churn."** Content that duplicates what SuPi extensions auto-inject wastes tokens every session and MUST be flagged for removal. A single edit that saves ~200 tokens per session pays for itself within a few sessions.
139
143
 
140
144
  ### File-by-File Assessment
141
145
 
@@ -147,6 +151,7 @@ Format:
147
151
  - **Fully redundant (package-specific):** [sections already covered by baseline context — applies to that package's `CLAUDE.md`]
148
152
  - **Partially redundant:** [sections with overlap plus human-only value]
149
153
  - **Unique:** [sections that should stay]
154
+ - **Estimated waste:** ~X tokens (characters ÷ 4) of existing content duplicate auto-delivered context — should be removed
150
155
 
151
156
  | Criterion | Score | Notes |
152
157
  |-----------|-------|-------|
@@ -161,6 +166,9 @@ Format:
161
166
  **Issues:**
162
167
  - [List specific problems]
163
168
 
169
+ **Recommended removals (non-negotiable for auto-delivered content):**
170
+ - [List what MUST be removed or compressed, with estimated token savings. Auto-delivered content is never "minor" or "not worth the churn" — it wastes tokens every session and MUST be removed.]
171
+
164
172
  **Recommended additions:**
165
173
  - [List what should be added]
166
174
 
@@ -170,24 +178,33 @@ Format:
170
178
 
171
179
  ### Phase 5: Targeted Updates
172
180
 
181
+ **Core principle: every token must earn its place in the instruction file.** If content doesn't save future sessions more time than it costs to read, remove it. No instruction file should exceed 200 lines — above that, every line must fight for its place against removal.
182
+
173
183
  After outputting the quality report, ask user for confirmation before updating.
174
184
 
175
185
  **Update Guidelines (Critical):**
176
186
 
177
- 1. **Propose targeted additions only** - Focus on genuinely useful info:
178
- - Commands or workflows discovered during analysis
187
+ 1. **Remove or compress unnecessary content first** — Before adding anything, flag sections that MUST be removed or tightened. Never skip removals because of edit churn — a one-time edit that saves tokens every session pays for itself immediately.
188
+ - Routine command listings (`npm install`, `npm test`, `npm run build`) — remove; they're in package.json
189
+ - Package/module inventories that duplicate what `code_brief` auto-delivers — MUST be removed (these waste hundreds of tokens every session)
190
+ - Package layout / project structure sections that just list packages with descriptions — MUST be removed; `code_intelligence` delivers this. Architecture trees that restate what `code_map` or `code_intelligence` auto-deliver are never acceptable.
191
+ - Verbose explanations where a one-liner suffices — compress
192
+ - Stale or outdated commands, file references, or architecture descriptions — remove
193
+
194
+ 2. **Then propose targeted additions** — Add only genuinely useful, non-obvious info:
195
+ - Non-obvious commands or workflows discovered during analysis. Non-obvious means: gotcha flags (`--unsafe`, `--runInBand`), hook behaviors, ordering requirements, cross-tool workflows. Routine commands with scoped paths (`pnpm vitest run packages/<pkg>/path`) are still routine — they're equally discoverable from the file tree.
179
196
  - Gotchas or non-obvious patterns found in code
180
197
  - Package relationships that weren't clear
181
198
  - Testing approaches that work
182
199
  - Configuration quirks
183
200
 
184
- 2. **Keep it minimal** - Avoid:
201
+ 3. **Keep it minimal** - Avoid:
185
202
  - Restating what's obvious from the code
186
203
  - Generic best practices already covered
187
204
  - One-off fixes unlikely to recur
188
205
  - Verbose explanations when a one-liner suffices
189
206
 
190
- 3. **Show diffs** - For each change, show:
207
+ 4. **Show diffs** - For each change, show:
191
208
  - Which CLAUDE.md file to update
192
209
  - The specific addition (as a diff or quoted block)
193
210
  - Brief explanation of why this helps future sessions
@@ -197,15 +214,10 @@ After outputting the quality report, ask user for confirmation before updating.
197
214
  ```markdown
198
215
  ### Update: ./CLAUDE.md
199
216
 
200
- **Why:** Build command was missing, causing confusion about how to run the project.
217
+ **Why:** The pre-push hook behavior wasn't documented, causing repeated confusion in CI.
201
218
 
202
219
  ```diff
203
- + ## Quick Start
204
- +
205
- + ```bash
206
- + npm install
207
- + npm run dev # Start development server on port 3000
208
- + ```
220
+ + The pre-push hook runs `pnpm verify` — covers both lint and tests; don't run them separately.
209
221
  ```
210
222
  ```
211
223
 
@@ -219,19 +231,18 @@ See [references/templates.md](references/templates.md) for CLAUDE.md templates b
219
231
 
220
232
  ## Common Issues to Flag
221
233
 
222
- 1. **Stale commands**: Build commands that no longer work
234
+ 1. **Stale commands**: Non-obvious commands or flags that no longer work
223
235
  2. **Missing dependencies**: Required tools not mentioned
224
236
  3. **Outdated architecture**: File structure that's changed
225
237
  4. **Missing environment setup**: Required env vars or config
226
- 5. **Broken test commands**: Test scripts that have changed
227
- 6. **Undocumented gotchas**: Non-obvious patterns not captured
238
+ 5. **Undocumented gotchas**: Non-obvious patterns not captured
228
239
 
229
240
  ## User Tips to Share
230
241
 
231
242
  When presenting recommendations, remind users:
232
243
 
233
244
  - **Keep it concise**: CLAUDE.md should be human-readable; dense is better than verbose
234
- - **Actionable commands**: All documented commands should be copy-paste ready
245
+ - **Actionable commands**: All documented commands should be non-obvious and copy-paste ready; skip routine ones
235
246
  - **Use `.claude.local.md`**: For personal preferences not shared with team (add to `.gitignore`)
236
247
  - **Global defaults**: Put user-wide preferences in `~/.claude/CLAUDE.md`
237
248
 
@@ -239,16 +250,16 @@ When presenting recommendations, remind users:
239
250
 
240
251
  **Key principles:**
241
252
  - Concise and human-readable
242
- - Actionable commands that can be copy-pasted
253
+ - Non-obvious commands and workflows (gotcha flags, ordering, hooks — not routine build/test)
243
254
  - Project-specific patterns, not generic advice
244
255
  - Non-obvious gotchas and warnings
245
256
 
246
257
  **Recommended sections** (use only what's relevant):
247
- - Commands (build, test, dev, lint)
258
+ - Non-Obvious Commands & Workflows (gotcha flags, hook behaviors, ordering)
248
259
  - Architecture (directory structure)
249
260
  - Key Files (entry points, config)
250
261
  - Code Style (project conventions)
251
262
  - Environment (required vars, setup)
252
- - Testing (commands, patterns)
263
+ - Testing (non-obvious patterns and conventions)
253
264
  - Gotchas (quirks, common mistakes)
254
265
  - Workflow (when to do what)