Feedback loop skills
Copy these skill definitions into your .claude/skills/ directory. They implement the error and success logging patterns from Lesson 01.
Setup Instructions
-
1.
Create
.claude/skills/directory in your project root -
2.
Create
.claude/error-logs/directory for log storage -
3.
Copy each skill below into its own
.mdfile -
4.
Invoke with
/log_erroror/log_successwhen needed
/log_error
Systematic failure capture and analysis
Purpose
When Claude makes a mistake, this skill guides you through a structured process to capture what went wrong, why it happened, and how to prevent it in the future. The key is capturing the exact prompt wording, not a paraphrase.
Workflow
Fork conversation (create checkpoint)
Interview Claude about the failure
Document exact prompt
Rewind to pre-error state
Skill Definition
Save as: .claude/skills/log-error.md
# /log_error
Systematic error capture for building feedback loops.
## Trigger
Invoke when Claude produces incorrect output, misses instructions, or behaves unexpectedly.
## Workflow
### Step 1: Create Checkpoint
Fork the conversation to preserve the error state before investigating.
### Step 2: Root Cause Interview
Ask Claude:
- "What prompt or instruction triggered this behavior?"
- "What did you think I was asking for?"
- "What context were you missing?"
### Step 3: Document the Failure
Create log entry in `.claude/error-logs/` with timestamp:
```markdown
## Error Log: [YYYY-MM-DD-HHMM]
**Context:** [What were you trying to accomplish?]
**Incorrect Behavior:** [What Claude did wrong]
**Exact Prompt (verbatim, not paraphrased):**
> [Copy the exact text you sent]
**What Claude Misunderstood:** [The gap between intent and interpretation]
**Root Cause Category:**
- [ ] Ambiguous instruction
- [ ] Missing context
- [ ] Assumed knowledge
- [ ] Faulty mental model
- [ ] Other: ___
**Preventive Guideline:** [What rule would prevent this?]
**Consider Hook?** [ ] Yes - if this is a recurring pattern
```
### Step 4: Recovery
Rewind to pre-error state using double-escape restore.
## Key Principle
Capture the EXACT prompt wording. Paraphrasing loses the specific language that caused the failure.
Root Cause Categories
/log_success
Capture what works for reuse
Purpose
When Claude produces excellent results, capture the interaction pattern while context is fresh. Look for recurring patterns that can be promoted to CLAUDE.md or converted into reusable skills.
Workflow
Pause to preserve context
Identify what worked
Record exact prompt
Extract reusable template
Skill Definition
Save as: .claude/skills/log-success.md
# /log_success
Capture effective patterns for reuse.
## Trigger
Invoke when Claude produces excellent results that you want to replicate.
## Workflow
### Step 1: Pause
Capture while context is fresh - don't wait until later.
### Step 2: Identify Success Factors
What made this work?
- Clear, specific instruction?
- Good examples provided?
- Appropriate context given?
- Right level of detail?
### Step 3: Document the Success
Create log entry:
```markdown
## Success Log: [YYYY-MM-DD-HHMM]
**Context:** [What were you building?]
**Outcome:** [What Claude produced that impressed you]
**Exact Prompt (verbatim):**
> [Copy the exact text you sent]
**Success Factors:**
- [ ] Clear, specific instruction
- [ ] Effective example included
- [ ] Appropriate context scope
- [ ] Good constraint definition
- [ ] Other: ___
**What Made It Work:**
1. [Factor 1]
2. [Factor 2]
3. [Factor 3]
**Generalized Template:**
> [Reusable version with placeholders]
**Promote to CLAUDE.md?** [ ] Yes - if this is a recurring need
**Convert to Skill?** [ ] Yes - if this is a complex workflow
```
### Step 4: Pattern Recognition
Look across multiple success logs to identify recurring patterns worth promoting.
## Key Principle
Success patterns compound. What works once can work many times if documented properly.
Success Factors Checklist
Recommended Directory Structure
your-project/
├── .claude/
│ ├── skills/
│ │ ├── log-error.md
│ │ └── log-success.md
│ ├── error-logs/
│ │ ├── 2024-01-15-1430.md
│ │ └── 2024-01-16-0900.md
│ ├── success-logs/
│ │ └── 2024-01-15-1600.md
│ └── commands/
│ └── [your custom commands]
└── CLAUDE.md