error-memory
Use when: making a mistake, breaking build/tests, realizing wrong approach, misunderstanding requirements, using wrong patterns, forgetting conventions, receiving correction from user, unexpected behavior, or any error situation
When & Why to Use This Skill
The Error Memory skill empowers Claude to learn from its mistakes by maintaining a persistent log of technical errors, misunderstood requirements, and convention violations. By analyzing root causes and formulating actionable rules in a dedicated `.claude/errors.md` file, this skill ensures continuous improvement, reduces repetitive debugging cycles, and significantly enhances the agent's alignment with project-specific standards and long-term context.
Use Cases
- Technical Debt Prevention: Documenting build or test failures with specific fixes to prevent the agent from re-introducing the same bugs in subsequent coding sessions.
- Contextual Alignment: Recording project-specific coding patterns and conventions that were previously missed, ensuring future code generation adheres strictly to the established style guide.
- Requirement Refinement: Tracking instances of misunderstood user instructions to create a 'lessons learned' log that improves the agent's comprehension of complex project requirements.
- Workflow Optimization: Analyzing unexpected behaviors to formulate reusable rules, effectively creating a self-correcting mechanism for the AI agent.
| name | error-memory |
|---|---|
| description | > |
| Use when | making a mistake, breaking build/tests, realizing wrong approach, |
Error Memory
Document errors to avoid repeating them.
Trigger
Invoke when:
- Build/tests fail after your action
- User corrects you
- You realize a wrong approach
- You forget a project convention
- Unexpected behavior occurs
Process
Identify error type
tech: build, tests, syntax, runtimectx: conventions, patterns, project stackcomp: misunderstood requirements
Analyze root cause (not symptom)
Formulate fix as reusable rule
Append line to
.claude/errors.md:| MM-DD | type | Short error | Root cause | Rule to follow |Create file if missing with this template:
# Project Errors > Past Claude mistakes on this project. Check before acting. | Date | Type | Error | Cause | Fix | |------|------|-------|-------|-----| ## Legend - **tech** : Technical (build, tests, syntax) - **ctx** : Context (conventions, patterns) - **comp** : Comprehension (misunderstood request)
Rules
- One line = one error (no paragraphs)
- Fix = actionable rule, not excuse
- Cause = why, not what
- Keep < 100 lines (archive if needed)
- Check errors.md before acting on any project