liteagents 2.12.1 → 2.15.0

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.
@@ -6,7 +6,7 @@
6
6
  * node friction.js <sessions-directory>
7
7
  * node friction.js ~/.claude/projects/-home-hamr-PycharmProjects-liteagents/
8
8
  *
9
- * Outputs (all in .claude/friction/):
9
+ * Outputs (all in .claude/remember/friction/):
10
10
  * friction_analysis.json - Per-session analysis
11
11
  * friction_summary.json - Aggregate stats
12
12
  * friction_raw.jsonl - Raw signals
@@ -1483,7 +1483,7 @@ function analyzeMain(sessionsDir) {
1483
1483
  }
1484
1484
 
1485
1485
  // Create output dir
1486
- const outputDir = '.claude/friction';
1486
+ const outputDir = '.claude/remember/friction';
1487
1487
  fs.mkdirSync(outputDir, { recursive: true });
1488
1488
 
1489
1489
  // Process each session
@@ -1641,12 +1641,12 @@ function analyzeMain(sessionsDir) {
1641
1641
 
1642
1642
  // Output files
1643
1643
  console.log('Outputs:');
1644
- console.log(' \uD83D\uDCCA .claude/friction/report.md (detailed analysis)');
1645
- console.log(' \uD83D\uDCCB .claude/friction/antigen_review.md (clustered failure patterns)');
1646
- console.log(` \uD83D\uDCC1 .claude/friction/*.json (raw data: ${allSignals.length} signals, ${analyses.length} sessions)`);
1644
+ console.log(' \uD83D\uDCCA .claude/remember/friction/report.md (detailed analysis)');
1645
+ console.log(' \uD83D\uDCCB .claude/remember/friction/antigen_review.md (clustered failure patterns)');
1646
+ console.log(` \uD83D\uDCC1 .claude/remember/friction/*.json (raw data: ${allSignals.length} signals, ${analyses.length} sessions)`);
1647
1647
  console.log();
1648
1648
 
1649
- console.log('Next: Review .claude/friction/report.md');
1649
+ console.log('Next: Review .claude/remember/friction/report.md');
1650
1650
  console.log('='.repeat(60));
1651
1651
 
1652
1652
  if (errors.length > 0) {
@@ -2196,9 +2196,9 @@ function clusterCandidates(allCandidates) {
2196
2196
 
2197
2197
  function extractMain(sessionsDir) {
2198
2198
  // Load friction analysis
2199
- const analysisFile = '.claude/friction/friction_analysis.json';
2199
+ const analysisFile = '.claude/remember/friction/friction_analysis.json';
2200
2200
  if (!fs.existsSync(analysisFile)) {
2201
- console.log('Error: Run friction analysis first to generate .claude/friction/friction_analysis.json');
2201
+ console.log('Error: Run friction analysis first to generate .claude/remember/friction/friction_analysis.json');
2202
2202
  return 1;
2203
2203
  }
2204
2204
 
@@ -2211,7 +2211,7 @@ function extractMain(sessionsDir) {
2211
2211
  }
2212
2212
 
2213
2213
  // Load raw signals
2214
- const rawFile = '.claude/friction/friction_raw.jsonl';
2214
+ const rawFile = '.claude/remember/friction/friction_raw.jsonl';
2215
2215
  let signals = [];
2216
2216
  if (fs.existsSync(rawFile)) {
2217
2217
  const rawContent = fs.readFileSync(rawFile, 'utf-8');
@@ -2266,7 +2266,7 @@ function extractMain(sessionsDir) {
2266
2266
  console.log();
2267
2267
 
2268
2268
  // Save outputs
2269
- const outputDir = '.claude/friction';
2269
+ const outputDir = '.claude/remember/friction';
2270
2270
  fs.mkdirSync(outputDir, { recursive: true });
2271
2271
 
2272
2272
  // Raw candidates (kept for debugging)
@@ -2340,7 +2340,7 @@ function extractMain(sessionsDir) {
2340
2340
  });
2341
2341
 
2342
2342
  fs.writeFileSync(path.join(outputDir, 'antigen_review.md'), reviewLines.join(''));
2343
- console.log('Output: .claude/friction/antigen_review.md\n');
2343
+ console.log('Output: .claude/remember/friction/antigen_review.md\n');
2344
2344
 
2345
2345
  return 0;
2346
2346
  }
@@ -2358,7 +2358,7 @@ Usage:
2358
2358
  node friction.js <sessions-directory>
2359
2359
  node friction.js ~/.claude/projects/-home-hamr-PycharmProjects-liteagents/
2360
2360
 
2361
- Outputs (all in .claude/friction/):
2361
+ Outputs (all in .claude/remember/friction/):
2362
2362
  friction_analysis.json - Per-session analysis
2363
2363
  friction_summary.json - Aggregate stats
2364
2364
  friction_raw.jsonl - Raw signals
@@ -2385,7 +2385,7 @@ Outputs (all in .claude/friction/):
2385
2385
  analyzeMain(sessionsDir);
2386
2386
 
2387
2387
  // Check if analysis produced output
2388
- const analysisFile = '.claude/friction/friction_analysis.json';
2388
+ const analysisFile = '.claude/remember/friction/friction_analysis.json';
2389
2389
  if (!fs.existsSync(analysisFile)) {
2390
2390
  console.log('\nNo analysis output. Check session directory.');
2391
2391
  return 1;
@@ -2401,7 +2401,7 @@ Outputs (all in .claude/friction/):
2401
2401
  console.log(' DONE');
2402
2402
  console.log('='.repeat(60));
2403
2403
 
2404
- const reviewFile = '.claude/friction/antigen_review.md';
2404
+ const reviewFile = '.claude/remember/friction/antigen_review.md';
2405
2405
  if (fs.existsSync(reviewFile)) {
2406
2406
  console.log('\nReview your antigens:');
2407
2407
  console.log(` cat ${reviewFile}`);
@@ -10,10 +10,17 @@ Run friction analysis, then consolidate session stashes + friction antigens into
10
10
  - Favor straightforward, minimal implementations first and add complexity only when requested or clearly required.
11
11
  - Keep changes tightly scoped to the requested outcome.
12
12
  - **Precision over recall for hot memory.** A false antigen loaded into `@MEMORY.md` steers every future session. When unsure, record as a low-confidence episode — do not promote.
13
+ - **Mid-tier model, not hardcoded.** Steps 2/3/4a delegate to a mid-tier model — capable of
14
+ semantic judgment, cheaper/faster than your top reasoning tier (e.g. Claude's Sonnet vs
15
+ Opus). Use whatever your tool designates as that balanced default; never hardcode a
16
+ vendor-specific model name.
17
+ - **Batch independent subagent calls.** Step 2's per-stash extractions are independent of
18
+ each other — spawn them concurrently (parallel/background subagent calls in one turn)
19
+ where your tool supports it, instead of processing stashes one at a time.
13
20
 
14
21
  **What it does**
15
22
 
16
- Reads all raw material (`.claude/stash/*.md` + `.claude/friction/antigen_clusters.json`), extracts durable facts, episodes, and behavioral antigens into a single `.claude/memory/MEMORY.md`, then injects a managed memory section into `CLAUDE.md`.
23
+ Reads all raw material (`.claude/stash/*.md` + `.claude/remember/friction/antigen_clusters.json`), extracts durable facts, episodes, and behavioral antigens into a single `.claude/remember/MEMORY.md`, then injects a managed memory section into `CLAUDE.md`.
17
24
 
18
25
  **Steps**
19
26
 
@@ -23,7 +30,7 @@ Reads all raw material (`.claude/stash/*.md` + `.claude/friction/antigen_cluster
23
30
  project are behavioral lessons worth keeping everywhere. So point it at the tool's
24
31
  **global sessions root** (all projects), not a per-project directory.
25
32
 
26
- - **Locate `friction.js`** — it is bundled next to this command at `friction/friction.js`
33
+ - **Locate `friction.js`** — it is bundled next to this command at `remember/friction.js`
27
34
  (the same directory as `remember.md`, whether installed or run from the package). If it
28
35
  exists nowhere, skip to step 1 (stash-only) and tell the user friction.js is missing.
29
36
  - **Resolve the global sessions root** — probe this list top-to-bottom, use the first that
@@ -41,7 +48,7 @@ Reads all raw material (`.claude/stash/*.md` + `.claude/friction/antigen_cluster
41
48
  > will resolve but yield no signals until friction learns their formats — open an issue
42
49
  > to request one: https://github.com/hamr0/liteagents/issues
43
50
  - **Run** `node <friction.js> "<resolved-root>"`. friction writes its output to
44
- `.claude/friction/` in the current project.
51
+ `.claude/remember/friction/` in the current project.
45
52
  - **On any miss — loud, never silent.** If no root resolves, or friction errors, or it
46
53
  finds no usable sessions, print this and continue with stash-only consolidation:
47
54
  > ⚠️ Friction didn't run — no sessions found. To enable it, open this command file
@@ -49,27 +56,41 @@ Reads all raw material (`.claude/stash/*.md` + `.claude/friction/antigen_cluster
49
56
  > list in step 0, then re-run `/remember`. Consolidating stashes only this time.
50
57
 
51
58
  1. **Gather sources**
59
+ - **Legacy layout migration (one-time, loud).** Older versions used `.claude/memory/` and
60
+ `.claude/friction/`. If either exists: move the pipeline files
61
+ `.claude/memory/{MEMORY.md,ledger.json,.processed}` → `.claude/remember/`, and **discard**
62
+ the old `.claude/friction/` contents entirely — friction regenerates all of its output
63
+ fresh every run (step 0 has already rebuilt it in `.claude/remember/friction/` by the time
64
+ migration runs; stale copies carry no unique information and moving them would overwrite
65
+ fresh output). **Move only those pipeline files** — anything else in `.claude/memory/`
66
+ (e.g. user-owned rule files) stays where it is. Remove the old dirs only if empty, update the managed MEMORY section in CLAUDE.md to
67
+ the new reference (step 5), and tell the user exactly what moved.
68
+ - **Bootstrap `AGENT_RULES.md` (one-time, silent-if-present).** If
69
+ `.claude/remember/AGENT_RULES.md` does not exist, copy it from the bundled template next
70
+ to this command (`remember/AGENT_RULES.md`, same directory as `friction.js`). If it
71
+ already exists, leave it untouched — never overwrite, even if the bundled template
72
+ changes in a later version; it becomes user-owned the moment it lands in the project.
52
73
  - Read all `.claude/stash/*.md` files in the current project
53
- - Read friction output written in step 0: `.claude/friction/antigen_clusters.json` (preferred) or `.claude/friction/antigen_review.md` (fallback)
54
- - Read existing `.claude/memory/MEMORY.md` if it exists — create dir if missing
55
- - Read processed manifest at `.claude/memory/.processed` — skip already-processed stashes
74
+ - Read friction output written in step 0: `.claude/remember/friction/antigen_clusters.json` (preferred) or `.claude/remember/friction/antigen_review.md` (fallback)
75
+ - Read existing `.claude/remember/MEMORY.md` if it exists — create dir if missing
76
+ - Read processed manifest at `.claude/remember/.processed` — skip already-processed stashes
56
77
  - If no unprocessed stashes AND friction produced no new antigens, report "nothing to consolidate" and stop
57
78
 
58
- 2. **Extract from unprocessed stashes** (use Task tool with sonnet model for each)
59
- - For each unprocessed stash, call sonnet to extract:
79
+ 2. **Extract from unprocessed stashes** (spawn one subagent per stash, in parallel — see Guardrails)
80
+ - For each unprocessed stash, call the mid-tier model (see Guardrails) to extract:
60
81
  - **FACTS** (atomic, one-line): stable preferences, decisions, corrections, explicit "remember this"
61
82
  - **EPISODE** (3-5 bullet narrative): what was the goal, what was tried, outcome, lesson
62
83
  - **SKIP**: code details, file paths, errors, mechanical steps, LLM responses
63
84
  - Collect all new facts and episodes
64
85
 
65
86
  3. **Merge into MEMORY.md**
66
- - Read existing `.claude/memory/MEMORY.md` and parse its sections (## Facts, ## Episodes, ## Antigens)
67
- - **Facts section**: call sonnet with existing facts + newly extracted facts
87
+ - Read existing `.claude/remember/MEMORY.md` and parse its sections (## Facts, ## Episodes, ## Antigens)
88
+ - **Facts section**: call the mid-tier model with existing facts + newly extracted facts
68
89
  - Rules: new updates replace old, contradictions keep new version, duplicates dropped
69
90
  - Keep facts atomic, one line each
70
91
  - **Episodes section**: append new episode entries (append-only, timestamped, no dedup)
71
92
  - **Antigens section**: only update from friction output (step 4)
72
- - Write merged result to `.claude/memory/MEMORY.md` in the format under step 6.
93
+ - Write merged result to `.claude/remember/MEMORY.md` in the format under step 6.
73
94
 
74
95
  4. **Distill friction into antigens** (only if friction output exists)
75
96
 
@@ -83,9 +104,9 @@ Reads all raw material (`.claude/stash/*.md` + `.claude/friction/antigen_cluster
83
104
  > *themselves*). **You work from these short quotes — never re-read the session
84
105
  > logs.** Friction's lexical grouping and flags are hints, not the verdict.
85
106
 
86
- - Read `.claude/friction/antigen_clusters.json`.
107
+ - Read `.claude/remember/friction/antigen_clusters.json`.
87
108
  - **4a. Classify target, then semantically consolidate** (the parts lexical matching can't do).
88
- Call sonnet with the cluster quotes + their `preceding`/`projects`/`sessions`/`self_suspect`
109
+ Call the mid-tier model with the cluster quotes + their `preceding`/`projects`/`sessions`/`self_suspect`
89
110
  (NOT the logs), and have it:
90
111
  1. **Decide the target of each reaction — agent or self.** Drop *self/context*
91
112
  corrections where the user redirected themselves ("wrong project", "wrong window",
@@ -114,21 +135,80 @@ Reads all raw material (`.claude/stash/*.md` + `.claude/friction/antigen_cluster
114
135
  - **High** (5+ sessions) → loaded hot via `@MEMORY.md`
115
136
  - **Medium** (3-4 sessions) → recorded under Antigens, *not* loaded hot
116
137
  - **Low** (<3 sessions) → keep as Episode only
138
+ - **Recurrence tiers bind everything, including LLM-merged groups:** merging consolidates
139
+ evidence, it never elevates it — a merged group's tier comes from its combined
140
+ distinct-session count (e.g. a 2-session merged group is still Low → Episode + ledger
141
+ `observing`, not an antigen entry in MEMORY.md).
117
142
  - **Never auto-promote.** Only High-confidence (5+ sessions) antigens load hot. A
118
143
  single dramatic correction is an Episode, not an antigen.
119
144
  - Update the Antigens section in MEMORY.md (promote/demote based on new recurrence).
145
+ - **4c. Update the antigen ledger** (`.claude/remember/ledger.json`) — the evidence trail
146
+ linking each rule to the mistake it targets and whether it is working. Create it as
147
+ `{"version": 1, "entries": []}` if missing. It is JSON for exact matching — bookkeeping
148
+ only, never injected into context as guidance (MEMORY.md is what gets read; the ledger
149
+ is what gets checked).
120
150
 
121
- 5. **Inject memory reference into CLAUDE.md**
151
+ Entry shape:
152
+ ```json
153
+ { "id": "ag-001", "class": "claimed-done-not-verified",
154
+ "class_hints": ["says pushed but", "none got it"],
155
+ "status": "observing|hot|rejected|escalated",
156
+ "rule": "<current phrasing>",
157
+ "attempts": [{ "n": 1, "rule": "<phrasing>", "adopted": "YYYY-MM-DD", "outcome": "active|failed" }],
158
+ "evidence": { "sessions": 0, "projects": [], "quotes": [], "last_seen": "YYYY-MM-DD" },
159
+ "recurred_while_hot": 0,
160
+ "history": [{ "date": "YYYY-MM-DD", "event": "<transition>" }] }
161
+ ```
162
+
163
+ For each surviving antigen from 4a/4b, match against existing entries by `class_hints`
164
+ (the mistake class, not the rule wording — rules change, the class doesn't):
165
+ - **No match** → new entry, `status: "observing"`, attempt 1, history "candidate (N sessions)".
166
+ - **Match, `observing`** → merge evidence (sessions, quotes, projects, last_seen).
167
+ Crosses the 4b hot threshold → `status: "hot"`, history "promoted to hot (N sessions)".
168
+ - **Match, `hot`** → the mistake happened *while its rule was loaded*:
169
+ `recurred_while_hot += 1`, merge evidence, history "recurred while hot (count)".
170
+ - At `recurred_while_hot >= 2`: the phrasing failed. Mark the current attempt
171
+ `outcome: "failed"`, draft attempt n+1 — it must differ from **every** prior
172
+ attempt's text in this entry (failed attempts are the rejected-edit buffer: never
173
+ re-propose one verbatim) — replace `rule`, update MEMORY.md's Antigens section,
174
+ reset `recurred_while_hot` to 0.
175
+ - If 2 attempts have already failed and the antigen persists → `status: "escalated"`:
176
+ remove the rule from MEMORY.md's hot section, record a Fact instead ("persistent
177
+ failure mode: <class> — no phrasing reduces it"), and flag it in the step-7 report.
178
+ **Flag, don't act** — the user decides: enforcement (a hook, where the tool has
179
+ them) or accepted limit.
180
+ - **Match, `escalated`/`rejected`** (rejected = user veto) → merge evidence only; never re-propose.
181
+
182
+ Consistency: MEMORY.md's Antigens section is the render; the ledger is the record —
183
+ after 4c every hot antigen in MEMORY.md has a matching `hot` ledger entry. Mutations
184
+ are append-friendly: merge evidence and change status, never delete entries or history
185
+ lines. If ledger.json is malformed, say so loudly, move it aside as
186
+ `ledger.json.bad-<date>`, and start fresh — never silently overwrite.
187
+
188
+ 5. **Inject memory + rules references into CLAUDE.md**
122
189
  - Compose the section between `<!-- MEMORY:START -->` and `<!-- MEMORY:END -->` markers:
123
190
  ```
124
191
  <!-- MEMORY:START -->
125
- @MEMORY.md
192
+ @.claude/remember/MEMORY.md
126
193
  <!-- MEMORY:END -->
127
194
  ```
128
- - The `@MEMORY.md` reference points to `.claude/memory/MEMORY.md` — Claude loads the full file directly, so no inline duplication is needed
129
- - If CLAUDE.md already has MEMORY markers, replace the section between them
130
- - If CLAUDE.md has no MEMORY markers, append the section at the end
131
- - If no CLAUDE.md exists, create one with just the memory section
195
+ - The reference is an **explicit path** (`@.claude/remember/MEMORY.md`)`@`-references
196
+ resolve relative to the file containing them, so a bare `@MEMORY.md` in the project root
197
+ would point at a nonexistent root-level file. Claude loads the full file directly, so no
198
+ inline duplication is needed
199
+ - If `.claude/remember/AGENT_RULES.md` exists (bootstrapped in step 1), compose a second,
200
+ independent section between `<!-- AGENT_RULES:START -->` and `<!-- AGENT_RULES:END -->`
201
+ markers:
202
+ ```
203
+ <!-- AGENT_RULES:START -->
204
+ Consult when building something new or adding a feature — a standards guide, not hot
205
+ context like MEMORY.md above:
206
+ @.claude/remember/AGENT_RULES.md
207
+ <!-- AGENT_RULES:END -->
208
+ ```
209
+ - Each marker pair is independent: if CLAUDE.md already has a given pair, replace the
210
+ section between them; if not, append it at the end; if no CLAUDE.md exists, create one
211
+ containing whichever section(s) apply
132
212
 
133
213
  ```markdown
134
214
  # Project Memory
@@ -153,19 +233,31 @@ Reads all raw material (`.claude/stash/*.md` + `.claude/friction/antigen_cluster
153
233
  ```
154
234
 
155
235
  6. **Update processed manifest**
156
- - Append paths of newly processed stashes to `.claude/memory/.processed`
236
+ - Append paths of newly processed stashes to `.claude/remember/.processed`
157
237
 
158
- 7. **Report to user**
238
+ 7. **Report to user** — print it AND write the same content to `.claude/remember/report.md`
239
+ (overwritten each run; the ledger keeps history — the report is just the latest snapshot)
159
240
  - Number of stashes processed
160
241
  - Facts count (total, new)
161
242
  - Episodes count (total, new)
162
243
  - Antigens count by confidence tier, with how many newly promoted to hot
244
+ - Ledger lines — one per non-observing entry: id, short rule, status, recurrences since
245
+ adoption. Highlight rephrased (RECURRED) and ESCALATED entries; escalations need a
246
+ user decision, e.g.:
247
+ ```
248
+ ledger: ag-001 "verify live after publish" hot, 0 recurrences since 2026-07-10
249
+ ledger: ag-003 "don't commit per change" RECURRED while hot (2/2) → rephrased, attempt 2
250
+ ledger: ag-002 "literal scoped ask" ESCALATED → Fact; 2 phrasings failed. Hook or accept?
251
+ ```
252
+ - If AGENT_RULES.md was bootstrapped this run, say so (one line)
163
253
  - Confirm MEMORY.md and CLAUDE.md updated
164
254
 
165
- **File locations (all project-local)**
166
- - Memory file: `.claude/memory/MEMORY.md` (single source of truth, referenced as @MEMORY.md)
255
+ **File locations (all project-local — two dirs: `/stash` owns `.claude/stash/`, `/remember` owns `.claude/remember/`)**
167
256
  - Stash files: `.claude/stash/*.md`
168
- - Friction output: `.claude/friction/antigen_clusters.json` (observed-reaction clusters: theme, suggested_artifact, confidence, severity, sessions, projects, contexts)
169
- - Friction fallback: `.claude/friction/antigen_review.md` (human-readable clusters)
170
- - Processed manifest: `.claude/memory/.processed`
171
- - Output: `CLAUDE.md` (managed MEMORY section with @MEMORY.md reference)
257
+ - Memory file: `.claude/remember/MEMORY.md` (single source of truth, referenced as `@.claude/remember/MEMORY.md`)
258
+ - Rules template: `.claude/remember/AGENT_RULES.md` (bootstrapped once from the bundled package template on first `/remember` run, never overwritten again — user-owned after that; referenced as `@.claude/remember/AGENT_RULES.md`)
259
+ - Antigen ledger: `.claude/remember/ledger.json` (per-rule evidence trail: class, status, attempts/rejected-buffer, recurrence-while-hot)
260
+ - Consolidation report: `.claude/remember/report.md` (latest step-7 report, overwritten each run)
261
+ - Processed manifest: `.claude/remember/.processed`
262
+ - Friction output (transient, regenerated each run): `.claude/remember/friction/` — `antigen_clusters.json` (preferred input), `antigen_review.md` (fallback), plus raw analysis files
263
+ - Output: `CLAUDE.md` (managed MEMORY section, plus an AGENT_RULES section once bootstrapped)
@@ -10,15 +10,26 @@ Save session context for compaction recovery or handoffs.
10
10
  **Guardrails**
11
11
  - Favor straightforward, minimal implementations first and add complexity only when requested or clearly required.
12
12
  - Keep changes tightly scoped to the requested outcome.
13
+ - **Mid-tier model, not hardcoded.** The write-up subagent (step 2) uses a mid-tier model —
14
+ capable of semantic judgment, cheaper/faster than your top reasoning tier (e.g. Claude's
15
+ Sonnet vs Opus). Use whatever your tool designates as that balanced default; never hardcode
16
+ a vendor-specific model name.
17
+ - **Background dispatch where supported.** Run the write-up subagent in the background
18
+ (non-blocking) so the session isn't held up waiting on formatting/file I/O. Fall back to
19
+ writing inline (today's behavior) if your tool has no subagent or background-dispatch
20
+ mechanism.
13
21
 
14
22
  **What it does**
15
- 1. Captures current conversation context and key decisions
16
- 2. Records active work in progress
17
- 3. Stores important findings and insights
18
- 4. Creates stash file in `.claude/stash/`
19
- 5. Enables context restoration after compaction
20
- 6. **Consolidation nudge** after saving, count the unprocessed backlog:
21
- `unprocessed = (files in .claude/stash/*.md) − (entries in .claude/memory/.processed)`
23
+ 1. Drafts a compact brief of current conversation context, key decisions, active work in
24
+ progress, and findings/insights done inline, since only the running session holds full
25
+ conversation context
26
+ 2. Hands the brief to a subagent on the mid-tier model (see Guardrails) to expand into the
27
+ full stash file at `.claude/stash/<name>.md`, dispatched in the background where the tool
28
+ supports it. Falls back to writing inline if subagent/background dispatch isn't available
29
+ 3. Enables context restoration after compaction
30
+ 4. **Consolidation nudge** — whichever actor wrote the file (the subagent, or the session
31
+ itself on the inline fallback) counts the unprocessed backlog after saving:
32
+ `unprocessed = (files in .claude/stash/*.md) − (entries in .claude/remember/.processed)`
22
33
  (a missing `.processed` manifest means 0 processed). If `unprocessed >= 5`, end with one line:
23
34
  > 📝 N stashes since last consolidation — run `/remember` to fold them into memory.
24
35
 
@@ -50,3 +61,5 @@ cat .claude/stash/<name>.md
50
61
  - Stashes stored in `.claude/stash/` (project-local)
51
62
  - Automatically includes: timestamp, active plan, recent decisions
52
63
  - Maximum context retention with minimal token usage
64
+ - When dispatched in the background, the "Stashed to X" confirmation and consolidation nudge
65
+ arrive as the subagent's completion notification rather than inline in the same turn