What It Does
SNARC (Surprise, Novelty, Arousal, Reward, Conflict) is a memory system for Claude Code that captures what matters and forgets what doesn't. Unlike traditional memory systems that capture everything and retrieve via search, SNARC uses salience scoring to selectively store observations from your coding sessions.
Every tool Claude uses during a session is observed and scored on five dimensions. Observations below the salience threshold stay briefly in a circular buffer then evict, 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
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. Wrong memory is considered more damaging than missing memory.
The Dream Cycle
At session end, SNARC runs a "dream cycle" that extracts patterns from stored observations. This happens either mechanically (heuristic) or semantically (LLM-powered deep dream). Over time, SNARC builds a structured memory of how you work—what tools you reach for, what errors you hit, what fixes you apply.
Two consolidation modes:
- 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
For semantic pattern extraction, SNARC sends session observations to Claude via claude --print to identify:
- Workflows: Recurring approaches with intent understanding
- 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
Setup and Configuration
Install SNARC from GitHub:
git clone https://github.com/dp-web4/engram
cd engram
npm install # or appropriate package manager
Trigger deep dream manually:
snarc dream --deep
Or enable automatic deep dream at session end:
export ENGRAM_DEEP_DREAM=1
Safety Features
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 good proposals:
snarc promote 42 "test_framework" "Jest" # human confirms → Tier 3
Reject bad proposals:
snarc reject 43 # delete bad proposal
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
When To Use It
SNARC shines when:
- You work on the same project across multiple sessions
- You have recurring workflows or patterns
- You want Claude Code to remember your architectural decisions
- You frequently encounter and fix similar errors
- You want automated knowledge capture without manual note-taking
Integration with Claude Code
SNARC integrates seamlessly with Claude Code's existing workflow. It observes tool usage through the same interfaces Claude Code uses, making it compatible with MCP servers and other extensions. The memory injection happens at the context level, meaning Claude receives relevant memories alongside your current prompt and file context.
This creates a feedback loop where SNARC learns from your interactions with Claude, and Claude benefits from SNARC's memory of past interactions.







