Anti-Alzheimer - Memory Health & Cognitive Architecture Maintenance
Version: 0.1
Why this exists
AI agent memory systems degrade silently. Memories freeze at write-time while rules evolve. Projects complete but their memories persist. Cross-references break. Contradictions accumulate. The result: an agent that advises with full confidence but partial context.
This skill detects and repairs that drift.
Operation Routing
| User action / argument |
Read file |
Modifies files? |
/antialzheimer or check (default) |
op-health-check.md |
No - read-only scan |
full or consolidate |
op-full-consolidation.md |
Yes - backup first |
session or review |
op-post-session.md |
Maybe - proposes, user approves |
Cognitive Layer Model
Understanding where information belongs is the core skill. Wrong placement = wrong weight.
| Layer |
Loaded |
Weight |
Content type |
Examples |
| CLAUDE.md (global) |
Always, all projects |
Highest |
Cross-project rules |
Language, tone, safety |
| CLAUDE.md (project) |
Always, this project |
High |
Project identity, rules |
Stack, conventions, delegation |
| .claude/rules/ |
Always, this project |
High |
Operational patterns |
Learned patterns, debugging, docs index |
| MEMORY.md (index) |
Always |
Medium-High |
Instructional descriptors |
One-line actionable pointers per memory |
| Memory files |
On-demand |
Medium |
User context, project state |
Profile, strategies, active projects |
| docs/system/ |
On-demand |
Lower |
Session artifacts |
SCRATCHPAD, CHANGELOG, DECISIONS |
Key insight: every line added to an always-loaded layer reduces adherence to ALL other lines in that layer. The ROI of pruning is high. Memories in files are suggestions; rules in CLAUDE.md are enforced.
What to detect
| Issue |
Severity |
Description |
| Silent contradiction |
HIGH |
Memory says X, CLAUDE.md says NOT-X. Agent receives conflicting instructions |
| Zombie memory |
MEDIUM |
Memory about completed project or obsolete context still occupying cognitive space |
| Orphan reference |
MEDIUM |
Memory references file/memory that no longer exists |
| Missing cross-reference |
LOW |
Related memories don't reference each other, risking "partial personality" advice |
| Stale descriptor |
LOW |
MEMORY.md descriptor doesn't match actual file content |
| Budget overrun |
MEDIUM |
Always-loaded tokens significantly exceed recommended limits |
| Graduation candidate |
LOW |
SCRATCHPAD pattern repeated 3+ times, should promote to learned-patterns |
| Premature promotion |
MEDIUM |
Rule in CLAUDE.md that was promoted without sufficient evidence (< 3 observations) |
What NOT to save as memory
Before creating or keeping a memory, apply this filter:
- Code patterns, architecture, file paths -> derivable from codebase. Don't save.
- Git history, recent changes ->
git log / git blame are authoritative. Don't save.
- Debugging solutions -> the fix is in the code, the context in the commit message. Don't save.
- Anything already in CLAUDE.md or rules files -> duplicate. Don't save.
- Ephemeral task state -> use tasks/plans for current conversation. Don't save.
Memory is for what is NOT derivable: user profile, strategic context, organizational knowledge, calibration feedback, project state that transcends code.
Graduation Pipeline
The lifecycle of an observation becoming a rule:
Session error/discovery
-> SCRATCHPAD.md (raw, timestamped)
-> 3+ repetitions OR critical impact
-> learned-patterns.md (graduated pattern)
-> Repeated across projects OR universal applicability
-> CLAUDE.md (permanent rule)
Each promotion increases enforcement weight but consumes instruction budget. Promote deliberately.
Failure Modes
These are the most common ways memory consolidation goes wrong:
Silent contradiction - A memory freezes a rule at write-time. The rule evolves in CLAUDE.md. Now the agent gets conflicting instructions. Detection: diff memory content against CLAUDE.md rules + learned-patterns.
Partial personality - Incomplete memory sets generate confident but incomplete advice. Origin: this was discovered when two PCs had disjoint memory sets - one knew HOW to work (process), the other knew WHY (strategy). Neither had the full decision chain.
Memory hoarding - Saving everything as memory when most of it is derivable from code, git, or docs. This bloats the system and increases noise. Test: "Could I derive this by reading the codebase?"
Premature rule promotion - Moving a single observation straight to CLAUDE.md. Every line in CLAUDE.md reduces adherence to all other lines (linear degradation for frontier models). Promote only after 3+ observations or critical impact.
Over-consolidation - Merging so much context into one memory that it loses specificity. Every memory should have a clear "when to use" - if it's always relevant, it might belong in CLAUDE.md instead.
Zombie accumulation - Completed projects, obsolete contexts, resolved decisions lingering as active memories. They compete for attention with current priorities.
1---2name: antialzheimer3description: Memory health and cognitive architecture maintenance. Use when: memory drift, stale memories, instruction budget bloat, post-refactor cleanup, "check memories", "memory health", "consolidate", "clean up", or periodic maintenance (~every 10-15 sessions).4---56# Anti-Alzheimer - Memory Health & Cognitive Architecture Maintenance78Version: 0.1910## Why this exists1112AI agent memory systems degrade silently. Memories freeze at write-time while rules evolve. Projects complete but their memories persist. Cross-references break. Contradictions accumulate. The result: an agent that advises with full confidence but partial context.1314This skill detects and repairs that drift.1516## Operation Routing1718| User action / argument | Read file | Modifies files? |19|---|---|---|20| `/antialzheimer` or `check` (default) | [op-health-check.md](op-health-check.md) | No - read-only scan |21| `full` or `consolidate` | [op-full-consolidation.md](op-full-consolidation.md) | Yes - backup first |22| `session` or `review` | [op-post-session.md](op-post-session.md) | Maybe - proposes, user approves |2324## Cognitive Layer Model2526Understanding where information belongs is the core skill. Wrong placement = wrong weight.2728| Layer | Loaded | Weight | Content type | Examples |29|---|---|---|---|---|30| **CLAUDE.md** (global) | Always, all projects | Highest | Cross-project rules | Language, tone, safety |31| **CLAUDE.md** (project) | Always, this project | High | Project identity, rules | Stack, conventions, delegation |32| **.claude/rules/** | Always, this project | High | Operational patterns | Learned patterns, debugging, docs index |33| **MEMORY.md** (index) | Always | Medium-High | Instructional descriptors | One-line actionable pointers per memory |34| **Memory files** | On-demand | Medium | User context, project state | Profile, strategies, active projects |35| **docs/system/** | On-demand | Lower | Session artifacts | SCRATCHPAD, CHANGELOG, DECISIONS |3637**Key insight**: every line added to an always-loaded layer reduces adherence to ALL other lines in that layer. The ROI of pruning is high. Memories in files are suggestions; rules in CLAUDE.md are enforced.3839## What to detect4041| Issue | Severity | Description |42|---|---|---|43| **Silent contradiction** | HIGH | Memory says X, CLAUDE.md says NOT-X. Agent receives conflicting instructions |44| **Zombie memory** | MEDIUM | Memory about completed project or obsolete context still occupying cognitive space |45| **Orphan reference** | MEDIUM | Memory references file/memory that no longer exists |46| **Missing cross-reference** | LOW | Related memories don't reference each other, risking "partial personality" advice |47| **Stale descriptor** | LOW | MEMORY.md descriptor doesn't match actual file content |48| **Budget overrun** | MEDIUM | Always-loaded tokens significantly exceed recommended limits |49| **Graduation candidate** | LOW | SCRATCHPAD pattern repeated 3+ times, should promote to learned-patterns |50| **Premature promotion** | MEDIUM | Rule in CLAUDE.md that was promoted without sufficient evidence (< 3 observations) |5152## What NOT to save as memory5354Before creating or keeping a memory, apply this filter:5556- Code patterns, architecture, file paths -> derivable from codebase. Don't save.57- Git history, recent changes -> `git log` / `git blame` are authoritative. Don't save.58- Debugging solutions -> the fix is in the code, the context in the commit message. Don't save.59- Anything already in CLAUDE.md or rules files -> duplicate. Don't save.60- Ephemeral task state -> use tasks/plans for current conversation. Don't save.6162Memory is for what is NOT derivable: user profile, strategic context, organizational knowledge, calibration feedback, project state that transcends code.6364## Graduation Pipeline6566The lifecycle of an observation becoming a rule:6768```69Session error/discovery70 -> SCRATCHPAD.md (raw, timestamped)71 -> 3+ repetitions OR critical impact72 -> learned-patterns.md (graduated pattern)73 -> Repeated across projects OR universal applicability74 -> CLAUDE.md (permanent rule)75```7677Each promotion increases enforcement weight but consumes instruction budget. Promote deliberately.7879## Failure Modes8081These are the most common ways memory consolidation goes wrong:82831. **Silent contradiction** - A memory freezes a rule at write-time. The rule evolves in CLAUDE.md. Now the agent gets conflicting instructions. Detection: diff memory content against CLAUDE.md rules + learned-patterns.84852. **Partial personality** - Incomplete memory sets generate confident but incomplete advice. Origin: this was discovered when two PCs had disjoint memory sets - one knew HOW to work (process), the other knew WHY (strategy). Neither had the full decision chain.86873. **Memory hoarding** - Saving everything as memory when most of it is derivable from code, git, or docs. This bloats the system and increases noise. Test: "Could I derive this by reading the codebase?"88894. **Premature rule promotion** - Moving a single observation straight to CLAUDE.md. Every line in CLAUDE.md reduces adherence to all other lines (linear degradation for frontier models). Promote only after 3+ observations or critical impact.90915. **Over-consolidation** - Merging so much context into one memory that it loses specificity. Every memory should have a clear "when to use" - if it's always relevant, it might belong in CLAUDE.md instead.92936. **Zombie accumulation** - Completed projects, obsolete contexts, resolved decisions lingering as active memories. They compete for attention with current priorities.