The dorsolateral prefrontal cortex (dlPFC) region tracks which files are actively relevant across sessions and generates compact context summaries. It bridges the gap between hippocampus (structural map) and CC2 (conversation recall) by maintaining a live, decaying map of file relevance.
Long-running projects touch the same hub files session after session. Without working memory, each session starts cold — re-reading files to rebuild understanding. The dlPFC carries forward per-file context notes so hot files don't need re-reading.
Database: ~/.claude/brain/working-memory.db
Tracks per-file relevance with exponential decay scoring.
| Column | Type | Description |
|---|---|---|
| project | TEXT | Project name (resolved from hippocampus DIR roots) |
| file_path | TEXT | Path relative to project root |
| score | REAL | Decay score — bumped on touch, decayed 0.8x per wrapup |
| touch_count | INTEGER | Lifetime touch counter (never decays) |
| last_session | TEXT | Session ID of most recent touch |
| summary | TEXT | Stable description — seeded from DIR purpose line |
| context_note | TEXT | Volatile — why this file matters in current work |
Tracks files that co-occur across sessions.
| Column | Type | Description |
|---|---|---|
| project | TEXT | Project name |
| file_paths | TEXT | JSON array of file paths, always sorted alphabetically |
| co_occurrence_count | INTEGER | Number of sessions the pair co-occurred in |
| Event | Weight | Source |
|---|---|---|
| Edit/Write/MultiEdit | +1.0 | PostToolUse hook (post-edit-hook.js) |
| Read | +0.3 | PreToolUse hook (dlpfc/hooks/read-hook.js) |
| Referenced in conversation | +0.5 | Wrapup reconciliation (cross-refs CC2 window_files) |
All scores multiplied by 0.8 at each dlPFC-active wrapup. Decay only runs when the user opts in.
| Scenario | Equilibrium score | Sessions to cool below 1.0 |
|---|---|---|
| Touched once | 1.0 | 1 |
| Touched across 3 sessions | ~1.95 | ~3 after last touch |
| Touched 10+ sessions | ~4.0 | ~7 after last touch |
| Tier | Score | Loaded at session start |
|---|---|---|
| Hot | > 2.0 | summary + context_note |
| Warm | 1.0–2.0 | summary only |
| Cold | < 1.0 | Nothing — falls back to hippocampus/CC2 |
~/.claude/brain/dlpfc-live.md — generated at wrapup, loaded at session start.
## Working Memory — {project}
{file_path} [{score}] — {summary}
> {context_note}
clusters: {file_a, file_b}
Caps: 15 files per project, 3 clusters per project. Target: ~200-400 tokens per active project.
- Hello/continue: If hot entries exist, asks "Want to load the dlPFC working memory?"
- Wrapup: First question: "Should this session be logged to working memory (dlPFC)?"
No other user interaction. Decay only runs on opted-in wrapups.
| File | Purpose |
|---|---|
dlpfc/lib/db.js |
Schema, CRUD for file_heat and clusters |
dlpfc/lib/tracker.js |
Score bumping, decay math, cluster detection |
dlpfc/lib/generator.js |
Produces dlpfc-live.md from DB |
dlpfc/hooks/read-hook.js |
PreToolUse hook — bumps score on Read |
dlpfc/scripts/wrapup-step.js |
Wrapup orchestrator — reconciliation, decay, generation |
When opted in, runs after CC2 extraction and before PFC trim:
- Reconciliation — cross-ref CC2
window_filesfor referenced but untouched files - Context enrichment — Claude writes
context_noteper file from session knowledge (in wrapup skill, not script) - Decay — multiply all scores by 0.8
- Cluster detection — pair co-occurrence counting
- Generation — write
dlpfc-live.md
working-memory.db is not fully rebuildable — context_note values are Claude-authored. Add to backup scope alongside signals.db and recall.db.