Memory Maintenance
ASecurityUse when curating the persistent file-based memory (…/memory/MEMORY.md + per-fact *.md) — structuring/grouping the index, removing cruft or duplication, fixing stale index hooks, trimming a bloated index line, or ensuring open action-items in memory are also tracked in 00_07. The HOW lives in .claude/prompts/memory_housekeeping.md; the memory FORMAT standard lives in the system prompt (don't restate). The curation traps — scout counts run low, a half-home may be a duplicate, machine dedup is ...
- 23 stars
- 0 votes
- 0 copies
- 1 view
- Added September 20, 2026
Works with
Security analysis
100/100Pro scans all 2 files and shows the line behind each finding
npx -y skills add Alexey-Lukin/silken_net --skill memory-maintenance --agent claude-codeAre you the author of Memory Maintenance?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/alexey-lukin-memory-maintenance)---
name: memory-maintenance
description: "Use when curating the persistent file-based memory (…/memory/MEMORY.md + per-fact *.md) — structuring/grouping the index, removing cruft or duplication, fixing stale index hooks, trimming a bloated index line, or ensuring open action-items in memory are also tracked in 00_07. The HOW lives in .claude/prompts/memory_housekeeping.md; the memory FORMAT standard lives in the system prompt (don't restate). The curation traps — scout counts run low, a half-home may be a duplicate, machine dedup is capped at verbatim, an inventory that NAMES a home has usually not opened it — are indexed here one line each and written in full in this skill's traps.md, which loads on demand: open it before any curation VERDICT (consolidating a class, pricing a duplicate, declaring something homeless, reporting a corpus number). Iron rule: NO AMNESIA — the HARD set (strings · guards · ⛔ · open items · unique lessons · safety) is never thinned in a cleanup (only a consolidation recipe removes a copy); any other cut needs a READ-proven home and is DECLARED with its commit. Examples: \"почисти память\", \"поструктуруй memory\", \"повидаляй дублі в памяті\", \"memory housekeeping\", \"чи всі to-do з памяті є в 00_07?\""
---
# Memory Maintenance
Executable playbook for keeping the persistent memory (`~/.claude/projects/…/memory/`) **clean, structured, dedup'd — without amnesia**. This skill is the **HOW**; it does **not** restate the memory FORMAT (frontmatter / types / Why+How-to-apply / `[[<slug>]]` links / one-fact-per-file — that's in the system prompt), nor the live state (that's in the memories themselves).
## 📖 The method lives in one place (don't restate it here)
Full step-by-step playbook + founder's principles + the zero-loss scripts → **`.claude/prompts/memory_housekeeping.md`**. Read it before acting.
⚖️ **Where this boundary actually runs, ratified 2026-09-08 after the pair was re-litigated once.** «One home» here means the METHOD, not every mechanism the method leans on — and the two split by the MOMENT they fire, never by topic: the prompt carries what fires **while you are deleting** (verify-before-delete, what is safe to trim, whose home must exist first); `traps.md` carries what fires **while you are pricing a VERDICT** (how far a machine measure of duplication can be trusted, and its measured numbers). A rule that fires at BOTH moments legitimately has a carrier at both — that is not the «same warning in two homes» debt, because no single reader at a single moment needs both halves. 🔴 **The test, when the pair looks like a duplicate: name the reader and the instant. If one reader at one instant needs only half, the halves are two carriers; if the same reader needs both, one of them is a restatement and goes.** Sister to `[[reference_item_cementation_prompt]]` (00_07 cement) — same "the prompt is the home, the skill just points" pattern as `ssot-maintenance`.
**Three modes:** (1) *housekeeping* (this skill + the prompt — de-cruft, structure, stale-hooks, action-items→00_07); (2) *4-way memory-sync* — a per-section pass bringing memory ↔ domain-skill ↔ canon ↔ 00_07 to one truth (ROUTE-not-restate, fix drift on BOTH surfaces, write gaps). The sync recipe (fan-out READ-ONLY agents + fable-holistic) lives in the prompt, section «Режим 2»; the per-section results and the program's own lessons stay in `[[project_memory_sync_program]]`; the §00–§08 cycle closed 2026-07-18. (3) **class-home consolidation** — a theme scattered as a side-note across 15–35 files, each time in a DIFFERENT vocabulary, gets one home; grep cannot find it *by construction*, so the inventory is READ-based fan-out. Built in waves, each one paying part of the previous wave's phase-2 debt; the **7-step recipe, its traps and the ledger of still-PARTIAL classes all live in `[[log_perimeter_prep]]` — read it BEFORE consolidating another**. Never keep that tally here, and no longer look for it in the tracker: DOC-T.59 carried it until 2026-08-04, when the item closed, its body was collapsed and the ID went to `§🗄️`.
## Core principle — NO AMNESIA
🧭 **The question that finds the right cuts — ask what FEIGNS fullness, never what to delete** (founder frame, 2026-08-22; the kenosis axis this practice already runs on the hot path). Classic de-cruft hunts verbosity, so it is structurally blind to the expensive class: a form that is EMPTY while looking complete, and usually SHORT. Measured in one session, three findings none of which a wordiness pass would have surfaced — a work QUEUE that had stopped being a queue and only drove readers at finished work; a PROHIBITION whose stated ground had evaporated (the ruby pair it named no longer reproducible); a `reference_*` STUB whose whole justification («the skill carries no state pointer») had been closed months earlier. All three read as healthy content. **So the cut criterion is not «is this too long» but «does this form still do the work its shape claims».** ⚠️ And the frame is a foundation, not an instrument: it says why a cut is right, never whether a fact is still true — that is what the artefact and `grep` are for.
**Preserve beats cleanup.** Before removing ANY content, verify it lives elsewhere (the file, git, canon, `00_07`). Improve/relocate, never delete what's valuable. When "remove cruft" conflicts with "don't lose what's needed" → keep — the rule of the HARD set; how to judge a DOUBT («who would notice the loss?») is the prompt's step 4 (⚖️ delegated 2026-10-17). A well-curated memory's housekeeping is mostly **de-bloat + structure + stale-hook fixes**, not mass-deletion — say so honestly, don't manufacture deletions (the `ssot-maintenance` "don't manufacture moves" lesson, applied to memory).
## Traps before you consolidate — each one cost a wave
**Bodies live in `traps.md` (read it before any curation VERDICT — consolidating a class,
pricing a duplicate, declaring something homeless, reporting a corpus number).** Below is one
generated line per trap: the line is the CARRIER, meant to stop you mid-action; the mechanism,
the measurement and the provenance are in the companion. Numbering is append-only — cited as
«пастка (N)» from memory files and `docs/00_07`.
<!-- MEMORY-TRAPS-INDEX:AUTO — generated from traps.md by `ruby scripts/guard_craft_index.rb --write`; edit rules THERE, never here -->
1. Scout counts run LOW — and the direction is set by WHAT is counted, not by who counts
2. A «half-home» may be a duplicate — compare the two texts before believing they are coverage
3. One-way strings fake homelessness — a home that CITES you is a home you already have
4. Machine dedup is capped at VERBATIM, and on a bilingual corpus the gap is an order of magnitude
5. Declare the UNIT first — «debt weight» and «what an excision returns» differ in the SIGN
6. Mechanism ⊥ frame — «does this have a home» is TWO questions, and the homeless one is almost always the FRAME
7. An excision that TRANSLATES pays the bytes back — and looks like honest work while doing it
8. Measure the RECEIVER's headroom, not just the source's debt
9. «All three surfaces» is FOUR — the index is one of them
10. Ask whether the clause has TWO homes, not whether it has one
11. A `⊥` mark blesses the DIVERGENCE, not the missing router — it does not exempt a clause from phase 2
12. The claims that rot are almost exclusively SELF-LOCATION claims — and no sweep of the file that carries them can see it
13. The verdict ADDRESS-vs-SCOPE is decided by the source's GENRE, so read the genre before you read the pair
14. Every instrument you write to MEASURE this corpus will strip the token that discriminates — verify by reading the top hits before you report the count
15. A `TO-GIT` verdict needs THREE measurements, and the third is the one that manufactures work when skipped: does git ALREADY SEND readers to the memory copy
16. A restatement that SENDS can still LIE — so the redundancy question has a second axis, and only the second one is dangerous
17. Opposed frames do not protect against a shared READING habit — and the two costliest misses of a curation pass both arrived as a home that is not one
18. Editing memory through `Bash` bypasses BOTH of its carriers silently — the growth gate and the auto-commit are hooked on `Edit|Write`, and nothing announces their absence
19. Дзеркало пастки (18): авто-коміт робить ВАКУУМНИМ будь-яке порівняння «до/після», побудоване на робочому дереві — і брехня тут іде в бік «це не я»
20. Нишпорка, що звіряє гачок індексу з тілом, приписує клаузу рядка-ХАБА не тому файлу — і рапортує «гачок обіцяє те, чого в тілі немає», хоч клауза живе в СУСІДА
21. Step 6A's own instrument lies by default: the corpus routes to the tracker by BARE ID, not by the literal `00_07`
22. «This file has no line in `MEMORY.md`» is NOT a finding for a `log_*` journal — it is the design
23. A cited rule number whose generated INDEX line does not match the citation is NOT yet stale — the index carries only the rule's HEAD, and the cited sense often lives in the TAIL of its body
24. A hub's size has TWO ceilings, and `--audit` exits 1 at the LOWER one; and moving an instance to its `log_*` twin fires OVERLAP unless the twin DECLARES itself
<!-- /MEMORY-TRAPS-INDEX -->
## The gate is the home of the mechanics — not this file, not the prompt
`.claude/hooks/memory_gate.sh` runs the whole step-1 battery (`--audit`, exit 0 = clean) **and** rides `PostToolUse` on every write into the corpus, so it fires at the moment a wall gets built rather than when someone remembers to clean. Found a new blindness class? **Patch the script** — it is live on the next write, and the separate "carry the lesson into the gate" step that failed before no longer exists. 🔴 **But that instruction was missing its other half for weeks, and the omission is expensive: the gate carries a `--selftest` battery of 40+ cases with positive AND negative controls, and it is CI-gated (`docs.yml`).** Neither this file nor the prompt said so, so a curator who obeyed the central prescription — patch the gate — would break CI without knowing why, and would not know that the norm here is to ship a patch WITH its pinning case, mutation-verified (remove the fix, prove exactly that case reds). Run it before and after every patch; a case that passes both ways is testing nothing. ⛔ **By hand, always name a mode** (`--audit` · `--stale-state` · …) and feed `< /dev/null`: a bare call or a typo'd mode falls into the HOOK branch (`*)`) and used to wait on stdin forever (2026-10-25: ten minutes; 2026-11-20/21: twice for hours despite this sentence) — the gate now refuses there with exit 2 when no input arrives, a usage error, never a verdict on the corpus. Beside the battery it carries **diagnostic modes that deliberately sit OUTSIDE `--audit`** — read the `case` block for the current set, and the gate's own header for why a worklist never joins the battery (a worklist is the same finding addressed to a session that has time for it). Thresholds are curated constants inside it; the corpus is outside git but the gate is not, so a bump is a visible decision.
## Gotchas (hard-won, 2026-06-13)
- **Edit can't match a ~7000-char index line** → use a Ruby `lines[i] = …` replace with an `abort unless lines[i].include?("marker")` guard. 🔴 **For a multi-row pass the shape is a replacement TABLE, not a run of edits: every `old` must exist, so a typo MISSES safely instead of corrupting.** A substitution that silently matches nothing is the failure you want; one that matches the wrong span is the one you cannot see afterwards — which is also why the anchor must be UNIQUE, verified by counting it first, never a shared token. Then review the FULL diff rather than the changed rows: what survives this discipline is prose-mangling inside a row you did rewrite. ⚠️ The safety half is git now, not a `cp` backup (see the versioning gotcha below) — but versioning replaces the RECOVERY, never the review: a commit records the bytes, it does not notice that a sentence lost its verb.
- 🔴 **Zero-loss is a contract with a HARD set and a DECLARATION duty — and versioning repeals neither.** Hard, never thinned however routine they look: `[[strings]]` · guards and ⛔ stop-lists · open items · unique lessons · safety notes. Routine ID-examples and repeated instances may be thinned when their home is reachable — but **say what you removed**, because an honest report names the cuts, not only the keeps. Silence is the whole failure mode here: a thinned file reads exactly like a tidier version of the same file, so an undeclared cut is invisible at review time and stays invisible afterwards. ⚠️ The proof step used to be a set-diff against a `cp` backup; the corpus is versioned now, so it is `git diff` and `git show HEAD:<file>` — but the obligation did not move, it sharpened: git gives you recovery of a loss somebody NOTICED, and the declaration is the only thing that makes one noticeable.
- 🔴 **The corpus IS versioned now, and that repeals the premise most of this file was written under** (2026-08-08). `git init` at the memory dir, `main`, **local-only forever** — no remote, guarded by a `pre-push` hook that refuses, because two files carry the owner's personal circumstances and git history is permanent (⚖️ 2026-10-17 the founder lifted that privacy leg — nothing in `user_*` is secret; the refusal stands on the hook's other leg: the public route from this corpus to the repo is a reviewed migration, never a push). Every write **made through Edit/Write** is committed automatically by `.claude/hooks/memory_git_commit.sh` (PostToolUse, subject `mem(<file>): <tool>`, body `session <id>` — so `git log -S '<phrase>'` now answers *"when did this claim enter and which session wrote it"*, which trap (12) used to answer by hand-grepping `*.jsonl`). **What this changes: irreversibility no longer sets the proof bar here.** The MIGRATE-FIRST prologue, the "two agents with OPPOSED frames before any excision" rule of trap (13a), and "preserve beats cleanup" were all priced against *unrecoverable* loss — under versioning the doubt rule is set not by reversibility but by NOTICEABILITY (⚖️ delegated 2026-10-17, form — prompt step 4): a READ-proven soft cut is made, committed and declared — the only lever that ever pushed back on the growth `--weight` measures (DOC-T.62) — while the HARD set stays kept, because git restores only a loss somebody notices. ⚠️ **Two halves it does NOT repeal.** (a) *Reversibility is not correctness* — a wrong home is still wrong, and revert only helps a loss somebody NOTICES; the detectors carry only part of that half and stay — `corpus_floor_check` sees MASS loss and `--audit` integrity, while a single cut lesson is noticed by neither (prompt step 4). (b) *CI still cannot see this corpus* — the gate remains the only enforcement point, and it fires at the write. 🔴 **(c) The auto-commit sees only Edit/Write, and BULK curation goes through Bash** — a batch applied through `ruby -e` (the very form this file prescribes for a long line or a replacement TABLE) is invisible to it, so the heavier and more careful the pass, the likelier it slips the safety net. Measured 2026-08-15: eight files sat uncommitted through a whole session; re-measured 2026-10-02 the shape CHANGED (trap 18): the hook now commits with `git add -A`, so the NEXT `Edit` sweeps Bash edits in under ITS OWN subject. **Reflex: commit a Bash sweep yourself before the next Edit — by EXPLICIT paths, `git -C <memory> add <your files> && git -C <memory> commit`, never `-A` — and close with `git status` in the memory repo, not only in the repo.** ⚠️ Measured 2026-11-03 with a parallel session in the corpus: `-A` swept six of its uncommitted files under my subject, and an `--amend` right after rewrote that session's own fresh commit (restored, then noted append-only). The hook was adapted the next day: it now commits ONLY the file the Edit/Write touched (`add` + `commit --only`) and NAMES every other dirty corpus file in `additionalContext` instead of sweeping it — so your own Bash edits stay uncommitted until you commit them by path, and the hook says so at each corpus write.
- 🔴 **The index ratchet is BYTE-wise, so an over-long hook is paid for in a haggling loop — write the hook short on the FIRST pass.** Measured 2026-08-09: adding one clause to an existing index line put `MEMORY.md` 146 B over its ratchet, and bringing it back cost **six** successive rewrites (146 → 105 → 50 → 39 → 13 → 3 → under), each a full edit-and-recheck cycle. Nothing was wrong with the gate — it did exactly its job — but the cost lands on the wrong side: the trimming happens *after* the thought is already phrased, when every remaining word feels load-bearing. Two consequences. (a) When a fact needs a new hook clause, draft it at roughly the length of the clause it sits beside, not at the length the idea wants. (b) Do not spend a second pass shaving a hook toward the ratchet — at the second failed attempt keep the detail in-file and shorten the hook to its trigger, or record the bump beside `IDX_BASELINE` as tax accounting naming what bought it (⚖️ 2026-10-17 re-verdict: displacing an entry is NOT required), never keep golfing bytes.
- 🔴 **Сиблінг ратчета вище, і його бракувало: коли переповнюється сам ФАЙЛ (не індекс), лікуй у ПОРЯДКУ ЦІНИ, а не тим важелем, що першим спав на думку.** **(0) Спершу спитай, чи файл — РЕЄСТР ПОДІЙ, а не шар правил:** реєстр росте з кожною подією за визначенням, тож стеля на ньому червоніє на коректному вжитку — таблиці місце в `log_*` (стелі там немає), хабові лишається протокол рядка й струна (2026-11-18: хаб листів сів на стелю на третій день і 11 днів платив виселення щосесії). Далі найдешевший першим: **(1)** секція, що належить ІНШОМУ файлу **за ПОДІЄЮ** — безкоштовно, вона ніколи не була цього файлу; **(2)** евікція ТІЛ у наявний журнал-близнюк, правила лишаються на місці; **(3)** розкол клаузи, чиї половини належать двом РІЗНИМ подіям; **(4)** і лише тоді новий журнал. ⚠️ **(1) перевіряють ОБОВʼЯЗКОВО перед (2)** — «два вердикти про перенос» майже завжди є одним вердиктом, повтореним двічі. 📏 Прозова дієта на файлі біля стелі дає ~2%, тобто вона не важіль. 🔴 **Виміряно на собі 2026-09-06:** над стелею я зробив (2) наполовину, тоді **чотири рази поспіль гриз байти** — рівно те, що ратчет-урок вище забороняє, — і зрештою зняв власну клаузу; **важіль (1) не перевірявся ЖОДНОГО разу**. Ціна помилки не в байтах: golfing коштує повного циклу edit-and-recheck на кожен захід, а (1) коштує одного грепа по подіях. 🔴 **І доповнення, куплене 2026-09-21 першою ж чесною перевіркою важеля (1): для кластера ОСІ ПОМИЛКИ він здебільшого ЗАКРИТИЙ, бо отримувачі самі під стелею** — виміряно того дня: `self_attestation` 315 B запасу, `verdict_vs_grounds` 189 B, `curated_sample` 615 B, а всього **26 файлів** сиділо в смузі 35.3–36.0 kB, дванадцять із них у межах 100 B. **Тож порядок лишається, але (1) міряй ЗАПАСОМ ОТРИМУВАЧА (пастка 8), а не тематичною спорідненістю — і якщо запасу нема, не витрачай грепа, йди в (2)/(3).** ⊕ Того ж дня знайдено четвертий важіль, дешевший за всі: **клауза, що САМА оголошує свій новий дім («тепер канонізовано в X»), але стоїть у списку бездомних** — це не зріз, а виправлення форми, і в одному файлі воно віддало 642 B. ⚠️ Не плутай насичення з роздуттям: усі 26 РОУТИЛИ в журнали (частина по 100–160 kB), тобто евікція працювала — стеля ловить ріст самого шару ПРАВИЛ, і це вже відсуджено режимом `--weight` (змінити сховище, не різати).
- **Verify-before-delete** ([[feedback_verify_canon_before_delete]]) and **no-volatile-counts** ([[feedback_no_volatile_counts]]) apply to memory too (a hook must not hold drift-prone counts; trimmed detail must already live in the file).
- **De-dup is rare** — memories cross-link via `[[<slug>]]`, not restate; the big duplication is usually index-vs-file. Two distinct facts of the same kind are NOT a duplicate.
- 🔴 **«Merge + dedup» is NOT «shorten» — the founder stopped a pass mid-merge to say exactly that.** Collapsing N blocks keeps each block's CONTENT *verbatim*; what collapses is the STRUCTURE (N headers → 1 + tags) plus genuine duplicates (a recurring lesson → one shared note + a `→` pointer). **Compression is a SEPARATE operation and needs its own instruction** — a merge that quietly shortens is how a merge becomes amnesia, and the loss is invisible precisely because the result reads like a tidier version of the same thing. It fires at the MOMENT of the merge; the prompt's §Durable-2 carries the same rule for the reader who opens the prompt first — two carriers at two moments, not a duplicate.
- 🔴 **Splitting a rule-home or appending at session end: create its `log_*` twin BEFORE you need it** — a twin that does not exist yet turns the cheap append into a file creation plus a routing decision at the worst moment, and that friction is what produced every recorded rollback (body — trap (22)).
- ⚠️ **The head is FULL — measure it, do not trust this line:** `ruby scripts/skill_tier_probe.rb --listing` prints how much of this body sits past the compaction cut, and `guard_craft_index` judges only the generated index, never prose carriers. A new edit-time gotcha earns its line by displacement — a verdict-time one goes to `traps.md`, reference material below this section — or the tail of this list silently leaves the head (2026-11-18: it had drifted ≈480 characters past the cut).
## Type-routing — which surface a fact belongs to
Memory is a ROUTER, not a second copy: the absolute context is re-assembled from scratch every task (memory → skills → canon → code), so anything you would re-read from canon or code anyway is not a memory fact. Route each piece by its TYPE, **at the moment you write it** — this is a write-time question, and it is the one the index is actually consulted for.
| the fact is… | its home |
|---|---|
| operational HOW — generators, CLI recipes, code inventories | the **domain skill** |
| shipped WHAT, or a frozen decision | **canon** `NN_NN` (+ a `00_07` ID while it is still open) |
| live state · cross-domain trap · lesson · the founder's "why" | **memory** |
| a portable rule about how the WORK gets done | the **playbook** someone reads before doing it |
**Імʼя файлу теж роутить — конвенція `<тип>_[<NN>[<під>]_]<предмет>`** (⚖️ founder 2026-09-21, DOC-T.118). Коли памʼять строго привʼязана до модуля чи до КОНКРЕТНОЇ канон-сторінки, координата стоїть у слагу — вже діючі взірці `project_01_anchor_campaign` · `project_vilize_03a_firmware` · `project_vilize_04_backend`. 🔴 **Позиція не догма, несе саме наявність координати** («не обовʼязково префікс, головне щоб в імені було видно» — founder); тип-префікс при цьому НЕ замінюється, бо на ньому стоять групування індексу й `--stops`, що виключає `user_*`. ⛔ **Не давати памʼяті голе `NN_NN`-імʼя**, тотожне канонному: лінтери читають `NN_NN` як канон-адресу, і `04_06_*` у памʼяті почне читатись як `docs/04_06_*`. ⚠️ Перейменування — масова кампанія, а не правка: слаг є адресою у ЧОТИРЬОХ реєстрах (`[[струни]]` · рядок індексу · git→memory маршрути, які судить `--routes` · реєстр пакетів стартового ритуалу, який судить `PKGDEAD`), плюс гейтований інваріант `name:` ≡ filename. ВИКОНАНО 2026-09-21 (24 доми; провенанс — `00_07` §🗄️ DOC-T.118, перелік — `git log` корпусу); далі конвенція діє на ЗАПИСІ нового файлу, а не кампанією.
🔴 **Дві межі, без яких конвенція коштує більше, ніж повертає.** (1) **Координата в імені успадковує ДОЛЮ модуля** — розчиняється модуль, і слаг починає вказувати в порожнечу, тоді як сам файл лишається правдивим; корпус уже несе живий доказ (памʼять vilize-циклу, названа модулями, яких більше немає). Лік не перейменування назад, а ⚠️ у шапці «координата в імені — ЗАПИС, не адреса»: джин не фарбують ([[feedback_crown_bounded_by_roots]]). **Тому координату дає модуль, у який пишуть, а не той, про який згадують.** (2) **`log_*`-двійник координати НЕ отримує** — журнали іменуються за ТЕМОЮ, а не за стемом свого дому (виміряно, пастка (8)), тож дім може переїхати в координатне імʼя, а двійник лишається на місці: струна веде однаково, а кампанія не подвоюється. ⚖️ **Периметр ратифіковано founder-ом 2026-09-21 по рекомендації: координату дістають ЛИШЕ `project_*`-доми.** Підстава — виграш конвенції лежить на WRITE-шляху («чи є вже дім для цього факту»), а він увесь на боці домів: двійник досяжний тільки струною з дому, тож координата в його імені не працює ні на кого. Ціна названа й прийнята: одна адресна кампанія на доми (струни · рядок індексу · git-сайти · `name:` ≡ filename) замість двох.
⛔ **Порядок операцій несучий, і платить за нього саме адресна кампанія: КОНСОЛІДАЦІЯ йде ПЕРЕД перейменуванням.** Консолідація епізод-родини ВИДАЛЯЄ файли (крок 7), тож слаг, перейменований до неї, оплачує свої три реєстри двічі — вдруге вже заради файлу, який зникає.
Two halves make this operational rather than decorative.
**Elevate, then point.** A meta-lesson recurring across domains gets ONE home and every instance points at it. The failure mode is not a missing home but a SECOND one — both links resolve, only the prose disagrees, so no gate can see it. Before building a home, ask which part is actually homeless — instance, mechanism, remedy, or FRAME — because it is nearly always the frame, and grep finds instances (trap 6).
**Routing audit.** Every `project_*` file must route somewhere real: canon, a live tracker ID, code, a skill, or an inbound string. A file routing nowhere is an episode, and an episode with no string dies whatever the index says. ⛔ **Do not rebuild the machine form of this — it was built and measured: 0 true findings against 2 false out of 55**, because the set of legitimate homes is open-ended. It stays a reading discipline on purpose. That verdict is not local to this rule: where the discriminator has a form, the yield is near zero and a carrier is cheap; where the yield is large, there is no form. Check which half you are in before proposing a gate.
**A PLAYBOOK has a trigger of its own, so audit it by asking what fires its READER — not what its title is about.** Measured 2026-08-08 on the housekeeping prompt: of 48 durable lessons only 19 were strictly `housekeeping`-scoped; the rest fired at `memory-write` · `agent-spawn` · `gate-patch` · `measure` · `big-edit` · `founder-push`, i.e. precisely at moments when that file is not loaded and nothing loads it. **A lesson stored in a playbook whose trigger it does not share is stored nowhere** — the surface looks maintained and the rule never arrives. Consequence for writing: before adding a lesson to any playbook, name the event that must interrupt someone, and put it where a reader stands at THAT event (the gate's own message text is often the strongest carrier — it is the one line that reaches the person mid-action). Consequence for the prompt specifically: `§Durable` there is now **housekeeping-scoped by construction**, and each family carries a `📤` router naming where its evicted lessons went — do not put an agent-spawn or gate-patch lesson back into it. ⚠️ Two exceptions survived the pass on purpose and both are instructive: a per-file proposal recipe that had **zero** hits anywhere else, and a classification that **two other files explicitly route INTO** the prompt for. A "home" that cites you is not a home; check the direction of the string before you cut.
**ORDER, because the debt is written in PARALLEL with git — not after it.** Measured across four files: in one rule-home **five of six** debtor sections were written the SAME DAY as the canon paragraph they duplicate, by the session that created it. So the memory is not lagging the repo and no editorial pass can fix it — both texts are produced in one sitting, and the second one is the cheap one. **Write the canon / skill / gate FIRST, verify it landed, and then write only the SEND into memory.** An excision afterwards merely removes what the procedure should never have produced, and it costs the READ bar every time. The other debt shape does need an excision, and its tell is temporal: a home one to two and a half months OLDER than the memory's last write means the home absorbed the content and the memory simply never shrank.
## The loop → `.claude/prompts/memory_housekeeping.md` §🔢 Порядок
Inventory (`memory_gate.sh --audit`) → three mirrors (hook · `description` · file header) → structure → de-cruft (step 4: two questions — who would notice the loss, and is the home OPENED) → duplication → sync with `00_07` (6A memory→tracker, 6B tracker→memory) → stale hooks → safety; close with the checklist and a FINAL `--audit`. «6A» and «step 4» cited in this file are the PROMPT's steps; the consolidation recipe below numbers its own. ⚠️ Never enumerate the audit axes or the modes outside it here: READ the `case` block. An enumeration written two sentences after the rule forbidding it rotted in this very file (measured 2026-08-06: it named an axis «outside --audit» that ran inside it, and a mode that did not exist).
## Two consolidation recipes — read when the operation starts, not at load
### Консолідація ЕПІЗОД-РОДИНИ в роутер — окрема операція від class-home (⚖️ founder 2026-09-18…21, `00_07` DOC-T.118)
⊥ Class-home consolidation бере клас, **розсіяний side-note'ами** по 15–35 файлах. Тут інше: **кампанія наплодила родину епізод-файлів**, вони зливаються в ОДИН роутер, а решта **ВИДАЛЯЄТЬСЯ**. Форму ратифіковано на §01 і виміряно кількома хвилями; поточний склад корпусу бере `--audit`, не цей рядок. ⚠️ **Урожай міряють НЕ байтами:** прохід 2026-09-21 зняв два епізод-файли й повернув −31.5 kB із двох домів, але найдорожчим у ньому було виправлення НЕПРАВДИ (памʼять місяць стверджувала неіснуючу діру в каноні), а вона важить нуль.
1. **Кандидат** — епізод-файл із малим inbound (1–2 струни) при живому роутері родини; вага не критерій.
2. **Тріаж КОЖНОЇ клаузи** на три стани: уже шле в дім (нічого) ⊥ дім є, але клауза його переказує (лишити самий SEND) ⊥ бездомна (крок 3).
3. **Бездомне їде в git** — скіл, плейбук чи канон, — **не в інший файл памʼяті**: там його тримає гейт і CI. Дім обирає **МОМЕНТ ДІЇ**, не тема: урок про згортання секції → плейбук цементації, навіть якщо тематично він «про памʼять».
4. **Зрізати:** хибне-нині · лічильники · опис шару, що вже живе деінде (реєстр/канон/скіл).
5. **Переточити ВСІ вхідні струни** — і з памʼяті, і **з боку репо**: другі невидимі зсередини корпусу, їх віддає `--routes`, і в першому ж проході саме він знайшов пропущену адресу.
6. **Злити рядок індексу** — урок лишається текстом, лінк іде.
7. **`git rm` + опустити `CORPUS_FLOOR` на одиницю** — інакше гейт червонить, а головне: зниження робить втрату git-видимою.
⚠️ **Три пастки, куплені першим проходом.** (а) «Дім є» ставить READ, ніколи греп — на цьому корпусі греп збрехав ТРИЧІ за одну сесію (механічне імʼя журналу · регістр кирилиці ×2). (б) Інвентар «модуль-звʼязаності» по канон-рефах брехатиме, доки не виключиш `00_01`/`00_03`/`00_05`/`00_06`/`00_07` — їх цитує ВСЕ, і прилад починає міряти «цитує Фундамент». ⊕ **Виключити Фундамент НЕ досить: той самий прилад бреше ще двічі, і обидва рази в бік ХИБНОГО кандидата.** (1) **Мертві координати** (розчинені модулі — їхні номери живуть у корпусі як навмисні надгробки) рахуються як предметні рефи й віддають топ-модуль саме файлам-ІСТОРИКАМ, для яких номер є ЗАПИСОМ, а не адресою; тож живий ростер бери з `ls docs/[0-9][0-9]_[0-9][0-9]_*.md`, ніколи з тексту памʼяті. (2) **Поріг «≥N рефів» сліпий до РОУТЕРІВ** — файл, що вже несе координату в імені, цитує канон одиниці разів ЗА ПОБУДОВОЮ (роутер шле в `00_07` і в дім по разу), тож поріг є фільтром шуму, а критерієм лишається ПРЕДМЕТ, і ставить його READ. ⛔ Третій дискримінатор, якого числа не мають зовсім: `feedback_*` (вісь помилки) та її `log_*`-двійник крос-модульні ЗА ПОБУДОВОЮ — навіть 100% рефів в один модуль там є артефактом вибірки інстансів, не належністю, і перейменування зробило б імʼя брехливим. (в) Корпус версіонований, але сумнів судить ПОМІТНІСТЬ втрати, не відкотність (крок 4 плейбука, ⚖️ 2026-10-17): READ-доведений дубль ріж і лиши коміт, а твердий набір лишай — revert рятує лише ПОМІЧЕНУ втрату.
### Дім осі помилки — ІНДЕКС, тіла в журналі (⚖️ founder 2026-10-08, DOC-T.120)
Дім класу помилки (`feedback_*` осі) тримають в індекс-формі: шапка класу · нумеровані рядки, кожен — правило, що мусить спрацювати САМ у мить дії · тіло рядка (механізм · інстанс · межі) — у журналі-двійнику ДОСЛІВНО, з маркером `**(N)**`. Нове правило — рядок у домі й тіло в журналі; абзац у дім не дописують. **Підстава — виміряна 2026-10-08:** доми осі стояли стіною під `FILE_WARN`, від двох до пʼяти десятків окремих правил на дім, а інстанс-тіла вже були виселені попередніми хвилями — тож вага була ЖАНРОМ антології, і важіль «евікція тіл» своє віддав (founder: «оці всі помилки можуть тільки збивати і відволікати»). Пілот вивів `feedback_verdict_lifecycle` під стелю старту `--package` (згодом перетнув її знову — ⊕ біля розвилки нижче). **Ціна:** тіло правила — ще один Read у журнал за номером, і журнали ростуть на тіла. 🔴 **Найслабша ланка — ЗМІРЯНА, і вона задає процедуру:** адверсар із рамкою «яке слово-обмеження з тіла (N) рядок N загубив» знайшов у пілоті девʼять рядків із 34, що стріляли з іншою дією чи межею (один — з ІНВЕРТОВАНИМ напрямком залежності), і жодного голого ярлика. Тож рядок індексу пишуть під адверсарем саме цієї рамки, як застосування присуду, не на око. **Журнал оголошує себе двійником рядком «Тіла рядків хаба `[[хаб]]` за номером `(N)`, дослівно»** — на цій декларації `overlap_check` вважає хаб і двійника ОДНІЄЮ домівкою (індекс-рядок підсумовує власне тіло за задумом, а роутер на хаб дістає й тіло в двійнику); журнал без декларації нічого не отримує, і короткий рядок нижчий за поріг шинглів, тож шаблонним шумом між журналами не стає. **Порядок:** тіло в журнал скриптом із перевіркою нуля втрат ДО запису — маркери ставлять за зміщеннями, а не пошуком (файл може сам нумерувати уроки тією ж формою `**(N)**`) → закомітити журнал ДО наступного `Edit` (пастка 18) → рядки індексу → `--audit` → адверсар → правки → свіп гачка в індексі й `description` (розкол народжує осиротілі гачки). ⚠️ **Стелю індексу задає КІЛЬКІСТЬ правил:** 34 правила з повернутими обмеженнями сіли впритул до стелі старту, тож наступне правило в такому домі — рішення (подієвий ярус ⊥ розкол осі), а не дописка. ⊕ **Розвилку розвʼязано 2026-10-09 (⚖️ founder, «так» на рекомендацію), і перетнуло стелю не правило, а АДРЕСА:** свіп розколу плейбука цементації перепрописав маршрут одного рядка на новий компаньйон, тож пілот переїхав у подієвий ярус пакетів 01a · 01b · 02a · 02b · 03a · 03b. Підстава: у старт його брали за критерієм «малі» (`00_05 §3` крок 1), а ядро половин «подати» й «повернути» несе `00_05 §5`, яку кожна сесія читає першою. Ціна: решта рядків стріляє лише на впізнаній події. Найслабшу ланку зміряно ДО запису, і адверсар уточнив її підставу: рядки 17 · 19 · 20, що стріляють у залізних секціях, мають поза файлом носія лише ХВОСТА чи інстансу (`in-silico` §When Modifying #13 · легенда `00_07` про перечитування ніг · `picogk` #14), а їхні ГОЛОВИ стріляють у мить ратифікації чи застосування — тобто на події самого файлу, тож подієвий ярус їх не губить; власного носія в мить дії потребував лише рядок 18, чий тригер — ПРОГІН, а не присуд (`picogk` #22). Без зовнішнього носія лишаються й негеометричні рядки половини «застосувати» — це та сама названа ціна. Відкинуто з ціною: підрізати рядок під поріг (запас у кілька байтів до першого перейменування — байт-гольф), розколоти вісь (два старт-члени замість одного — та сама вага), лишити прапор (вічне ⚠ у кожній із цих секцій — шумний прилад). ⊕ **Кампанія 2026-10-08 (писарі на Haiku, адверсари на сильнішій моделі) виміряла:** самі стріляють ~⅔ рядків писаря — однаково у двох хвилях, тож уроки першої хвилі в брифі частки не підняли; домінантний дефект — ІНВЕРСІЯ напрямку, далі умова, що стала безумовним наказом. Отже адверсар — несучий крок, не контроль якості, і модель його перевіряй у транскрипті (`message.model`): `Explore` без `model` успадковує модель сесії. Правки писаря застосовуй лише по рядках зі знахідками (писар буває переписує все), а суперечність ВСЕРЕДИНІ тіла писарю не віддають — її судить власник корпусу дописом ⊕ у журналі. Заборона копіювати тіло шматками суперечить точності: копіювали і писар, і власник корпусу, бо обмеження живуть саме в словах тіла, тож судить адверсар, а не лічильник копій. ⊕ **2026-11-19 — авторство власника кроку не знімає:** із семи рядків, які переписував сам власник корпусу (не писар), адверсар тієї ж рамки лишив чистими два, а в подієвому домі, розколотому того ж дня на правила й журнал, знайшов пʼятнадцять місць, де переказ був сильніший за джерело чи губив виняток; повернуте зʼїло дві третини виграшу в байтах — тож виграш розколу рахуй ПІСЛЯ адверсара. ⛔ **Межа присуду:** дім-РАМКА, де провенанс несе механіку (`feedback_crown_bounded_by_roots`), індекс-форми не бере — присуд стоїть на підставі «вага = жанр антології», а рамка не антологія; там виносять лише хроніку. Кампанію закрито (`00_07` §🗄️ DOC-T.120); нове правило в домі осі — за процедурою вище, без кампанії.
## Frontmatter the harness owns (reference — moved below the head 2026-11-18)
- **`node_type` / `originSessionId` in the frontmatter are HARNESS-managed — do not strip them, and do not count them as yours.** A file-watcher re-stamps them on ANY write to `memory/*.md` (a Bash-only edit no longer evades it), so deleting them is wasted effort rather than damage; the direction that matters is the other one — never "clean" them out of a rewritten file expecting the change to stick, and never read their value as something this corpus decided. `format_check_one` in the gate checks `name` + `type` presence AND that `name:` equals the filename slug (the `NAME` verdict) — but nothing enforces the harness-managed pair, so that half stands. ⚠️ This sentence read «requires only `name` + `type`» for two weeks: the slug axis landed **75 minutes after** the claim was written, in the gate rather than here — a self-location claim is falsified by an edit in ANOTHER file, which is why it reads fresher the longer it stands.
## When to use
- Structuring / grouping `MEMORY.md` (by kind: 👤User / 🛠Feedback / 📚Reference / 📦Project, + sub-themes).
- Removing memory cruft / duplication; trimming a bloated index hook (detail belongs in the file).
- Fixing a stale index hook (drifted from its file).
- "Is every open to-do/check in memory also in 00_07?" → migrate the gaps.
- Integrity check (1:1 index↔files, no broken/orphan).
## Keep this skill bounded
> If you're tempted to add the memory FORMAT rules or live state here, stop — format → system prompt; state → the memories; the full method → `.claude/prompts/memory_housekeeping.md`. The bound is a MECHANISM, not an adjective: the traps index is generated with a floor gate, and the carriers of a curation EDIT (traps index · the gate · Gotchas — in that order, so a growing Gotchas pushes out only its own tail, never the gate) stand in the first ~19.9k characters of this body (`00_05 §2`); the recipes below carry their own ⛔ and are read when their operation starts. A new edit-time carrier goes up there, reference material below, a verdict-time trap into `traps.md`.
Files in this skill
- SKILL.md
- traps.md
Attribution
Related skills
View all in research →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.