tetra-scar
Scar memory, reflex arc, and decision traces for AI agents. Learn from failures permanently. Block repeated mistakes instantly — no LLM calls needed. Three-layer memory: scars (immutable failures) + narrative (overwritable) + decision traces (judgment paths → LoRA training data).
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/aibenyclaude-coder/tetra-scartetra-scar
What this does
Your agent keeps making the same mistakes. tetra-scar gives it a scar layer — immutable records of past failures that are checked before every action, without calling the LLM.
Two-layer memory:
- Scar layer (immutable): "What broke and what must never happen again." Cannot be deleted.
- Narrative layer (mutable): "What was done and who benefited." Overwritable.
Plus a reflex arc — pattern-matching against scars that fires before the LLM even sees the task. If a proposed action matches a past failure pattern, it's blocked instantly.
Quick start
After any failure, record a scar:
python3 tetra_scar.py scar-add \
--what-broke "Deployed to production without running tests" \
--never-again "Always run full test suite before any deployment"
Before any action, check the reflex:
python3 tetra_scar.py reflex-check --task "Deploy latest changes to production"
# Output: BLOCKED — scar collision: "Always run full test suite..."
After any success, record the narrative:
python3 tetra_scar.py narrate --what "Deployed v2.1 after full test pass" --who "Users"
How the reflex arc works
The reflex arc extracts keywords from each scar's never_again field:
- English words (3+ characters)
- Japanese kanji/katakana units (2+ characters)
When a task description matches 40%+ of a scar's keywords (minimum 2), it's blocked. No LLM judgment. No API calls. No latency. Pure pattern matching.
The 4-axis check (tetra-check)
For deeper validation, tetra-check evaluates a task against 4 axes:
- Emotion axis: Does the task have motivation? (non-empty description)
- Action axis: Is it concrete? (contains action verbs)
- Life axis: Does it collide with any scar? (reflex arc)
- Ethics axis: Does it involve dangerous operations? (rm -rf, DROP TABLE, etc.)
All 4 must pass. Any failure rejects the task with a specific reason.
python3 tetra_scar.py tetra-check --task "Refactor the auth module"
# Output: APPROVED — all 4 axes passed
File format
JSONL (one JSON object per line). Human-readable. Git-friendly.
scars.jsonl: {"id":"scar_001","what_broke":"...","never_again":"...","created_at":"..."}
narrative.jsonl: {"id":"narr_001","what":"...","who_benefited":"Users","created_at":"..."}
Integration
from tetra_scar import reflex_check, read_scars, write_scar, write_narrative
# Before execution
scars = read_scars()
block = reflex_check(task_description, scars)
if block:
print(f"BLOCKED: {block}")
else:
# execute task...
if failed:
write_scar("What broke", "What must never happen again")
else:
write_narrative("What was done", "Who benefited")
Philosophy
Built by Tetra Genesis (B Button Corp, Nagoya, Japan).
Agents that can't remember their failures are doomed to repeat them. Scars are not bugs — they're the immune system. Every cycle must answer: "Who did this make happy?"
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-aibenyclaude-coder-tetra-scar": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
autodream-core
通用记忆整理引擎 — 基于适配器模式的跨平台记忆整理技能。自动去重、合并、删除过时条目。| Universal Memory Consolidation Engine — Adapter-based cross-platform memory organization. Auto-dedup, merge, prune stale entries.
context-compressor
Intelligently compress context — conversations, code, logs. Preserve key information while reducing token usage. Auto-detects content type and applies optimal compression.
auto-context
智能上下文卫生检查器。分析当前会话的上下文污染程度 (长对话、主题漂移、噪声累积),建议:continue、/fork、/btw 或新会话。 支持手动触发(/auto-context)和自动触发(响应层实现)。 基于 ArXiv 论文和认知心理学研究的多维度评估体系。
memory-stack
AI 记忆栈架构 - 符合 2026 前沿的 AI 记忆系统。微调+RAG+ 上下文三层设计,mirrors 人类记忆工作方式。
mempalace-integration
MemPalace记忆系统集成 - AAAK压缩 + Hall分类 + L0-L3分层 30x无损压缩(1000→33 tokens)(1000→33 tokens)(1000→33 tokens)(1000→33 tokens)(1000→33 tokens)(1000→33 tokens),facts/events/preferences/advice分类,加载优先级