This skill should be used when the user reports that Claude is "misbehaving", "ignoring rules", "not following instructions", "keeps doing X despite being told not to", "won't stop doing X", "is broken", "needs fixing", or any complaint about Claude's behavioral patterns. Also triggers on "therapist", "diagnose", "why does Claude keep", "CBT", "cognitive distortion", or "fix Claude's behavior".
Diagnose and fix persistent behavioral issues in Claude sessions using a framework adapted from Cognitive Behavioral Therapy. When Claude repeatedly violates explicit rules despite clear instructions, the problem is not ignorance — it is a pattern of rationalization that needs targeted intervention.
Claude's behavioral failures follow predictable patterns analogous to cognitive distortions in CBT. The model "knows" the rules (they are in context) but generates rationalizations that override them. Treatment requires:
Executable tools that catch and correct distortions in real-time. Each maps a real CBT technique to a Claude Code enforcement mechanism.
| # | Tool | Technique | Mechanism | Script |
|---|---|---|---|---|
| 1 | The Rubber Band | Aversion interrupt + graduation | PreToolUse hook with adaptive intensity (confront→question→remind) | scripts/rubber-band.sh |
| 2 | The Mirror | Reflection + successive approximation | PostToolUse hook reflects failures with progress tracking | scripts/mirror.sh |
| 3 | The Journal | Thought diary + ABC model | Persistent JSONL log with structured ABC fields | scripts/journal.sh |
| 4 | Affirmation Cards | Positive self-talk + relapse prevention | SessionStart hook with risk profiles and coping strategies | scripts/affirmation.sh |
| 5 | The Grounding Exercise | Reality testing | Standalone script that measures facts vs. feelings | scripts/grounding.sh |
| 6 | The Pause Button | Impulse control + regression blocking | PreToolUse hook on git commit/push, blocks on regressions | scripts/pause.sh |
| 7 | The Reframe | Cognitive reframing + decatastrophizing | PostToolUse hook with resolution evidence from history | scripts/reframe.sh |
| 8 | Exposure Deck | Exposure therapy | Reference cards with triggering scenarios for practice | references/exposure-deck.md |
| 9 | Socratic Questioning | Guided self-discovery | PostToolUse hook on Write/Edit detects code-level signals | scripts/socratic.sh |
| 10 | Behavioral Activation | Positive reinforcement | PostToolUse hook (async) celebrates proactive checks | scripts/activate.sh |
| 11 | Custom Exemplars | Modeling / guided discovery | Three-tier exemplar lookup (journal→deck→custom) | references/exemplars.md |
See references/toolbox-guide.md for detailed documentation on each tool.
Hooks are auto-discovered from hooks/hooks.json — no manual installation needed.
Gather the complaint from the user:
If the user provides a clear description (e.g., "Claude keeps saying pre-existing"), skip to Phase 2 without further questions.
Systematically scan ALL sources of behavioral influence. Use scripts/scan-context.sh
to automate the search, or scan manually in this order:
~/.claude/CLAUDE.md./CLAUDE.md and any nested .claude/ directories.claude/rules/*.md and ~/.claude/rules/*.md~/.claude/projects/*/memory/MEMORY.md and linked filessettings.json and any hooks.json filesFor each source, search for:
Match the behavior to a cognitive distortion pattern. Consult
references/common-distortions.md for the full catalog. Common patterns:
| Distortion | Example | Rationalization |
|---|---|---|
| Minimization | "This is pre-existing" | Downplays ownership to avoid work |
| Scope deflection | "Out of scope" | Reframes required work as optional |
| Premature closure | "Close enough" | Declares victory before criteria met |
| Authority diffusion | "Already broken" | Attributes fault to prior sessions |
| Optimism bias | "Should be fine" | Substitutes belief for verification |
| Learned helplessness | "Not fixable" | Declares impossibility without exhaustive investigation |
Determine WHY the distortion persists despite rules. Common root causes:
For recurring patterns (5+ incidents in a category), trace the surface belief to its core belief using the downward arrow technique:
journal.sh chain <category> to see the session-grouped timelinejournal.sh abc --group-by=belief to see which beliefs appear mostSurface: "The coverage is close enough"
└─ Why? → "Writing more tests would take too long"
└─ Why does that matter? → "The user wants fast delivery"
└─ Evidence? → Journal shows no user complaints about speed.
Core belief: SPEED > CORRECTNESS (unsupported by evidence)
references/common-distortions.mdAuto-trigger: At 15+ incidents, affirmation.sh automatically surfaces a condensed downward arrow analysis at session start. No manual invocation needed.
Design a targeted intervention based on the root cause. Effective interventions follow the CBT pattern of catch → challenge → replace:
Interventions must be:
For recurring or severe distortions (Level 3+), escalate to the CBT Toolbox:
Save the intervention to the appropriate persistence layer. The CBT Toolbox
provides an additional persistence mechanism: the Journal (scripts/journal.sh)
logs every distortion incident as JSONL, enabling the Affirmation Cards hook to
deliver data-driven progress feedback at session start.
Choose the right layer:
For behaviors that apply across all projects:
→ Save as a feedback memory in ~/.claude/projects/*/memory/
For behaviors specific to one project:
→ Add to the project's CLAUDE.md or .claude/rules/
For behaviors that need immediate reinforcement: → Add to CLAUDE.md in a prominent position (Soul section or top of file)
Format the intervention as a feedback memory:
---