skills/error-audit/SKILL.md
Use when repeated Claude Code session errors need analysis; scans session transcripts for errors, clusters by root cause, and suggests remediations.
npx skillsauth add arndvs/ctrlshft error-auditInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Output "Read Error Audit skill." to chat to acknowledge you read this file.
Scan every Claude Code session transcript for errors, cluster by root cause, surface the top offenders with suggested remediations.
# Default: all sessions, top 20 clusters, human output
python3 skills/error-audit/error-audit.py
# Last 30 days only
python3 skills/error-audit/error-audit.py --since 30
# Show fewer clusters
python3 skills/error-audit/error-audit.py --top 10
# Machine-readable (for piping into other tools)
python3 skills/error-audit/error-audit.py --json
# Override the projects dir (useful for testing)
python3 skills/error-audit/error-audit.py --projects-dir /path/to/projects
# Override or disable suppressions
python3 skills/error-audit/error-audit.py --suppressions-path /path/to/suppressions.md
python3 skills/error-audit/error-audit.py --no-suppressions
python3 skills/error-audit/error-audit.py --show-suppressed
/error-audit)python3 <skill-path>/error-audit.py with any arguments the user provided.~/.claude/settings.json entry to add, but do NOT auto-apply — user must review Bash allowlist changes.| Class | Signal | Example |
|-------|--------|---------|
| tool_error | is_error:true on a tool result (excluding denials) | Read/Write/Edit failures |
| validation_error | InputValidationError in tool result | Wrong parameter types |
| permission_denial | "The user doesn't want to proceed" | Bash command rejected |
| hook_block | hook_failure attachment type | git-workflow-gate blocks |
| bash_fail | Non-zero exitCode on Bash attachment | Command failures |
| retry_storm | 3+ overloaded_error records for the same tool on the same day | API overload |
| read_before_edit | "File has not been read yet" | Edit without prior Read |
| Tier | Fix type | Example |
|------|----------|---------|
| 1 | Settings allowlist | Add Bash(cmd:*) to allow list (review first) |
| 2 | Hook or script fix | Tune a hook to exclude a known-good pattern |
| 3 | Instruction/memory | Add behavioral memory covering the failure mode |
| Env var | Purpose | Default |
|---|---|---|
| CLAUDE_ERROR_AUDIT_SUPPRESSIONS | Suppressions file path | <skill-dir>/suppressions.md |
The suppressions.md file (ships alongside error-audit.py) marks known "working-as-designed" cluster keys. Default human output hides them; --show-suppressed re-includes them; --json always includes them with a suppressed: true|false field.
If python3 is not available, fall back to manual analysis:
# Recent fix commits
git log --oneline --since="2 weeks ago" --grep="fix" --grep="revert" | head -30
# Find recent session files
find ~/.claude/projects/ -name "*.jsonl" -mtime -14 2>/dev/null | head -10
# HUD events
if [[ -f "$HOME/dotfiles/working/events.jsonl" ]]; then
grep -i "error\|fail\|block" "$HOME/dotfiles/working/events.jsonl" | tail -30
fi
Group errors into: Tooling, Convention, Environment, Architecture, External.
Frequency × Cost × Fixability. Minimum 3 occurrences before calling "systemic."
One specific action per pattern. For each high-priority pattern, recommend ONE specific action:
| Action Type | When to use | Example | |-------------|-------------|---------| | New hook | Repeated mechanical error that can be detected before it happens | "Add a hook that checks Node version on SessionStart" | | New rule | Convention violation that the model keeps forgetting | "Add a rule that requires test file for every new module" | | Architecture fix | Structural issue causing cascading failures | "Extract shared types to a package" | | Documentation | Misunderstanding of how something works | "Document the auth flow in README" | | Ignore | External/transient issue not worth automating | "GH API rate limits during peak hours" |
## Error Audit Report
**Period**: Last 2 weeks (N sessions analyzed)
**Patterns found**: M
### High Priority
| # | Pattern | Freq | Cost | Action |
|---|---------|------|------|--------|
| 1 | TypeScript path alias misconfigured | 4 sessions | ~10 min each | Rule: verify tsconfig paths on project start |
| 2 | Commit to main without PR | 3 sessions | 5 min each | Hook: ✅ already fixed (git-workflow-gate) |
### Medium Priority
...
### Resolved by existing mechanisms
- [pattern] → resolved by [hook/rule name]
### Recommendations
1. [Specific action with a one-liner justification]
2. ...
After producing recommendations:
hooks/PROPOSAL_TEMPLATE.md to draft itrules/ following existing patternshooks/COVERAGE_MATRIX.md to reflect new coveragedevelopment
Use when implementing UI, checking dark/light mode, or validating animations — adds a visual feedback loop via browser screenshots so frontend changes are verified, not assumed.
development
Use when Claude Code sessions had many manual approval ("press 1") prompts or when auditing hook permissions; identifies which Bash commands required approval.
tools
Use after merging a PR or during periodic cleanup to archive plan-mode files by linking them to merged PRs.
testing
Use when stress-testing a plan against the project's domain model — grills the design, sharpens terminology, and updates documentation (CONTEXT.md, ADRs) inline as decisions crystallise.