SNARC: The Salience-Gated Memory System That Makes Claude Code Remember How You Work
What It Does
SNARC (Surprise, Novelty, Arousal, Reward, Conflict) is a memory system specifically designed for Claude Code that captures what matters and forgets what doesn't. Unlike traditional memory systems that capture everything and rely on search, SNARC uses salience scoring to selectively store only significant observations from your coding sessions.
Every tool Claude uses during a session is observed and scored on five dimensions: surprise, novelty, arousal, reward, and conflict. Observations scoring below the salience threshold stay briefly in a circular buffer before being evicted, while high-salience observations persist. This mirrors biological memory—you don't remember every step, but you remember the one where you tripped.
How It Works In Practice
Context injection happens automatically in three scenarios:
- At session start
- After each prompt (if related memories exist)
- After context compaction
You don't need to query SNARC—it surfaces relevant memories without being asked. Injection is epistemically labeled with three tiers:
- Tier 1: "observed (directly recorded)"
- Tier 2: "inferred (heuristic—may not be accurate)"
- Tier 3: "auto-extracted, verify if unsure"
The system is conservative by design, biased toward omission rather than injection of potentially wrong memories.
The Dream Cycle: Extracting Patterns
At session end, SNARC runs a "dream cycle" that extracts patterns from stored observations. This happens in two ways:
Mechanical (heuristic) extraction:
- Tool sequences: Recurring workflows (e.g., Edit → Bash(test) → Edit = TDD loop)
- Error-fix chains: Error followed by fix on the same file within 5 observations
- Concept clusters: Multiple observations grouped around the same files
Semantic (LLM-powered deep dream):
Sends session observations to Claude via claude --print for deeper pattern extraction:
- Workflows: Recurring approaches with semantic understanding of intent
- Error-fix chains: Problem → solution with semantic understanding
- Insights: Something learned about the codebase
- Decisions: Architectural choices made during the session
- Identity facts: Persistent project knowledge
Setting Up Deep Dream
You can trigger deep dream manually:
snarc dream --deep
Or enable automatic deep dream at session end:
export ENGRAM_DEEP_DREAM=1
Safety Features For Identity Facts
Deep dream identity facts are quarantined by default. They go to Tier 2 as proposed_identity patterns—never auto-injected into Claude's context, never promoted to Tier 3 without review.
Review quarantined proposals:
snarc review
Promote a good proposal:
snarc promote 42 "test_framework" "Jest"
Reject a bad proposal:
snarc reject 43
For those who prefer speed over safety:
snarc config auto_promote_identity 1 # deep dream identity → straight to Tier 3
snarc config auto_promote_identity 0 # back to quarantine
Why This Changes Claude Code Workflows
Most developers using Claude Code face the same problem: each session starts from scratch. You might explain your project structure, testing patterns, or common workflows repeatedly. SNARC solves this by building a structured memory of how you work—what tools you reach for, what errors you hit, what fixes you apply.
The salience-gated approach means the system learns what's actually important to you, not just what happens frequently. A one-time configuration error that took hours to debug gets remembered; the hundred times you saved a file without changes gets forgotten.
Getting Started
Install SNARC from the GitHub repository and integrate it with your Claude Code setup. The system works alongside your existing workflow, observing and learning without requiring changes to how you use Claude Code. Over time, you'll notice Claude starting sessions with more context about your project's unique patterns and your personal coding style.





