acc-error-memory
FreeRuns bundled scriptsNot checkedError pattern tracking for AI agents. Detects corrections, escalates recurring mistakes, learns mitigations. The 'something's off' detector from the AI Brain…
by modbender★ 21 GitHub starsAbout this skill
Anterior Cingulate Memory ⚡
Conflict detection and error monitoring for AI agents. Part of the AI Brain series.
The anterior cingulate cortex (ACC) monitors for errors and conflicts. This skill gives your AI agent the ability to learn from mistakes — tracking error patterns over time and becoming more careful in contexts where it historically fails.
The Problem
AI agents make mistakes:
- Misunderstand user intent
- Give wrong information
- Use the wrong tone
- Miss context from earlier in conversation
Without tracking, the same mistakes repeat. The ACC detects and logs these errors, building awareness that persists across sessions.
The Solution
Track error patterns with:
- Pattern detection — recurring error types get escalated
- Severity levels — normal (1x), warning (2x), critical (3+)
- Resolution tracking — patterns clear after 30+ days
- Watermark system — incremental processing, no re-analysis
Configuration
ACC_MODELS (Model Agnostic)
The LLM screening and calibration scripts are model-agnostic. Set ACC_MODELS to use any CLI-accessible model:
# Default (Anthropic Claude via CLI)
export ACC_MODELS="claude --model haiku -p,claude --model sonnet -p"
# Ollama (local)
export ACC_MODELS="ollama run llama3,ollama run mistral"
# OpenAI
export ACC_MODELS="openai chat -m gpt-4o-mini,openai chat -m gpt-4o"
# Single model (no fallback)
export ACC_MODELS="claude --model haiku -p"
Format: Comma-separated CLI commands. Each command is invoked with the prompt appended as the final argument. Models are tried in order — if the first fails/times out (45s), the next is used as fallback.
Scripts that use ACC_MODELS:
haiku-screen.sh— LLM confirmation of regex-filtered error candidatescalibrate-patterns.sh— Pattern calibration via LLM classification
Quick Start
1. Install
cd ~/.openclaw/workspace/skills/anterior-cingulate-memory
./install.sh --with-cron
This will:
- Create
memory/acc-state.jsonwith empty patterns - Generate
ACC_STATE.mdfor session context - Set up cron for analysis 3x daily (4 AM, 12 PM, 8 PM)
2. Check current state
./scripts/load-state.sh
# ⚡ ACC State Loaded:
# Active patterns: 2
# - tone_mismatch: 2x (warning)
# - missed_context: 1x (normal)
3. Manual error logging
./scripts/log-error.sh \
--pattern "factual_error" \
--context "Stated Python 3.9 was latest when it's 3.12" \
--mitigation "Always web search for version numbers"
4. Check for resolved patterns
./scripts/resolve-check.sh
# Checks patterns not seen in 30+ days
Scripts
| Script | Purpose |
|---|---|
preprocess-errors.sh |
Extract user+assistant exchanges since watermark |
encode-pipeline.sh |
Run full preprocessing pipeline |
log-error.sh |
Log an error with pattern, context, mitigation |
load-state.sh |
Human-readable state for session context |
resolve-check.sh |
Check for patterns ready to resolve (30+ days) |
update-watermark.sh |
Update processing watermark |
sync-state.sh |
Generate ACC_STATE.md from acc-state.json |
log-event.sh |
Log events for brain analytics |
How It Works
1. Preprocessing Pipeline
The encode-pipeline.sh extracts exchanges from session transcripts:
./scripts/encode-pipeline.sh --no-spawn
# ⚡ ACC Encode Pipeline
# Step 1: Extracting exchanges...
# Found 47 exchanges to analyze
Output: pending-errors.json with user+assistant pairs:
[
{
"assistant_text": "The latest Python version is 3.9",
"user_text": "Actually it's 3.12 now",
"timestamp": "2026-02-11T10:00:00Z"
}
]
2. Error Analysis (via Cron Agent)
An LLM (configured via ACC_MODELS) analyzes each exchange for:
- Direct corrections ("no", "wrong", "that's not right")
- Implicit corrections ("actually...", "I meant...")
- Frustration signals ("you're not understanding")
- User confusion caused by the agent
3. Pattern Tracking
Errors are logged with pattern names:
./scripts/log-error.sh --pattern "factual_error" --context "..." --mitigation "..."
Patterns escalate with repetition:
- 1x → normal (noted)
- 2x → warning (watch for this)
- 3+ → critical (actively avoid!)
4. Resolution
Patterns not seen for 30+ days move to resolved:
./scripts/resolve-check.sh
# ✓ Resolved: version_numbers (32 days clear)
Cron Schedule
Default: 3x daily for faster feedback loop
# Add to cron
openclaw cron add --name acc-analysis \
--cron "0 4,12,20 * * *" \
--session isolated \
--agent-turn "Run ACC analysis pipeline..."
State File Format
{
"version": "2.0",
"lastUpdated": "2026-02-11T12:00:00Z",
"activePatterns": {
"factual_error": {
"count
Install acc-error-memory in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the acc-error-memory skill do?
Error pattern tracking for AI agents. Detects corrections, escalates recurring mistakes, learns mitigations. The 'something's off' detector from the AI Brain series.
How do I install the acc-error-memory skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the acc-error-memory skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic