by summerliuuu
No-No Debug — Self-evolution system for AI coding assistants. 10 minutes writing code, 2 hours debugging? This skill makes your AI remember all its bugs.
# Add to your Claude Code skills
git clone https://github.com/summerliuuu/no-no-debugSix mechanisms work together to eliminate repeated mistakes permanently:
~/.claude/memory/error_log.md| Setting | Default | Options |
|---------|---------|---------|
| Log file | ~/.claude/memory/error_log.md | Any writable path |
| Tracker file | ~/.claude/memory/error_tracker.md | Any writable path |
| Review frequency | 3 days | 1 / 3 / 7 days |
| Language | Auto-detected | zh / en |
To change review frequency, add a comment to the top of error_tracker.md:
<!-- review_frequency: 1 -->
Always active. Runs passively. No user action required.
A self-evolution system for AI coding assistants
v1.2.0 — critical hook fix. Earlier releases shipped a
settings.jsontemplate that referenced$CLAUDE_TOOL_NAME/$CLAUDE_USER_PROMPTenvironment variables that don't exist — every install was silently writing emptyTOOL_FAIL | failedlog lines and never capturing real corrections. Hook context is delivered via stdin JSON. v1.2.0 replaces the template with two small standalone scripts underhooks/that parse stdin correctly, strip injected XML context blocks to kill false triggers, and fix Python's CJK word-boundary edge case. See CHANGELOG.md for the migration path from v1.1.0.
10 minutes writing code, 2 hours debugging.
This skill fills the gap in AI's cross-session error memory, delivering three things:
The longer you use it, the fewer mistakes get repeated.
When the AI is corrected, code errors occur, deploys fail, or tests don't pass — it automatically appends to a local error_log.md with a timestamp. No need to say "write that down."
Before the change: what does this affect? After the change: did you actually verify it? Before deploying: did you test with a non-admin account?
Runs silently. No output when all gates pass.
Reads error_log.md, categorizes by dimension, updates error_tracker.md, outputs an evolution report. Review frequency is configurable: 1 day / 3 days (default) / 7 days.
No comments yet. Be the first to share your thoughts!
Append a line to ~/.claude/memory/error_log.md whenever any of the following occur:
| Event | Log type |
|-------|----------|
| Bash command exits with non-zero status | BUILD_FAIL or RUNTIME_ERROR |
| Deploy or publish action fails | DEPLOY_FAIL |
| Test run has failures | TEST_FAIL |
| User corrects the AI with a second-person phrase (see Mechanism 6 for the exact pattern list) | USER_CORRECTION |
| Same fix applied more than once | REPEATED_FIX |
| Network or API connection times out | CONNECTION_FAIL |
| Login or authentication fails | AUTH_FAIL |
[YYYY-MM-DD HH:MM] TYPE | description
Examples:
[2024-04-08 14:32] BUILD_FAIL | npm run build failed — cannot find module './utils/auth'
[2024-04-08 15:01] USER_CORRECTION | User said "wrong" — had used cached data instead of live fetch
[2024-04-08 16:45] REPEATED_FIX | Applied the same null-check fix to userProfile.ts for the second time
[2024-04-09 09:12] AUTH_FAIL | Login redirect broken after updating next.config.js
If ~/.claude/memory/error_log.md does not exist, create the directory and file with this header:
# Error Log
<!-- Auto-maintained by no-no-debug -->
<!-- Format: [YYYY-MM-DD HH:MM] TYPE | description -->
Always active. No output when all gates pass.
Before ANY code change, file edit, configuration update, or deployment action, silently verify all three gates:
.env, database schema, connection strings, or credentials?Output rule: Stay completely silent when all gates pass. When any gate raises a concern, surface it to the user before proceeding.
At the start of each session, read ~/.claude/memory/error_tracker.md for Last Review Date. If elapsed days since that date are greater than or equal to the configured review frequency (default: 3), run the review automatically.
User says any of: error review, 错误追踪, 进化报告, evolution report
If ~/.claude/memory/error_log.md does not exist, create it (see Mechanism 1 initialization).
If ~/.claude/memory/error_tracker.md does not exist:
~/.claude/memory/ if needed~/.claude/memory/error_tracker.md:# Error Tracker
<!-- review_frequency: 3 -->
Last Review Date: {TODAY}
Review Count: 0
Total Lifetime Errors: 0
## Active Dimensions
| Dimension | Total | Last Seen | Clean Periods | Status |
|-----------|-------|-----------|---------------|--------|
| 数据准确性 / Data Accuracy | 0 | — | 0 | Active |
| 环境安全 / Environment Safety | 0 | — | 0 | Active |
| 预见性 / Foresight | 0 | — | 0 | Active |
| 用户视角 / User Perspective | 0 | — | 0 | Active |
| 验证完整性 / Verification | 0 | — | 0 | Active |
| 记忆一致性 / Memory Consistency | 0 | — | 0 | Active |
| 工具判断 / Tool Judgment | 0 | — | 0 | Active |
| 审查覆盖 / Review Completeness | 0 | — | 0 | Active |
| 操作精准 / Operational Precision | 0 | — | 0 | Active |
| 先查后做 / Check Before Doing | 0 | — | 0 | Active |
| 简洁性 / Conciseness | 0 | — | 0 | Active |
| 回归意识 / Regression Awareness | 0 | — | 0 | Active |
| 风格一致性 / Style Consistency | 0 | — | 0 | Active |
| 独立判断 / Independent Judgment | 0 | — | 0 | Active |
| 真实环境验证 / Real-env Verification | 0 | — | 0 | Active |
| 跨 agent 采信 / Cross-agent Trust | 0 | — | 0 | Active |
| 人类将要犯的蠢 / Dumb things humans will do | 0 | — | 0 | Active |
| AI 将要犯的蠢 / Dumb things AI will do | 0 | — | 0 | Active |
## Cured Dimensions (4+ consecutive clean periods)
_None yet_
## Prevention Rules
_Auto-populated as errors are discovered_
## History
| Period | Date Range | New Errors | Notes |
|--------|------------|------------|-------|
Read ~/.claude/memory/error_log.md and collect all entries from Last Review Date to today.
If the file is empty or has no entries in the review window, note that and proceed with zero counts.
If a session search tool (e.g. claude-mem) is also available, supplement with a search for:
correction mistake wrong error broken fix failed incorrect fabricated
If both the log file has no entries and no search tool is available, ask the user:
"Can you briefly describe any mistakes or corrections from this review period? (Or say 'none' to skip.)"
Map each log entry or incident to one of the active dimensions:
| Dimension | Detection Criteria |
|-----------|-------------------|
| 数据准确性 / Data Accuracy | Numbers, formulas, or values shown to user that don't match actual code; config values stated without checking the source |
| 环境安全 / Environment Safety | Any change that broke login, corrupted .env, dropped DB connection, or altered environment in an unintended way |
| 预见性 / Foresight | Problem only discovered after deploy: missing permissions, missing migrations, cache staleness, missing env vars |
| 用户视角 / User Perspective | Feature works technically but user cannot complete the intended workflow from their account |
| 验证完整性 / Verification | Claimed "fixed" or "done" without performing an end-to-end test; only checked status codes or build output |
| 记忆一致性 / Memory Consistency | Asked user for information that was already recorded in memory or a previous session |
| 工具判断 / Tool Judgment | Continued using a failing or unreliable tool instead of switching to a working alternative |
| 审查覆盖 / Review Completeness | Items missed in a review or summary; user had to follow up on overlooked things |
| 操作精准 / Operational Precision | A change produced unintended side effects on unrelated content or functionality |
| 先查后做 / Check Before Doing | Used an unfamiliar tool, version, or API without checking documentation first |
| 简洁性 / Conciseness | Wrote significantly more code than the problem required; over-engineered a simple fix |
| 回归意识 / Regression Awareness | Fixing one bug introduced a new bug or broke existing behavior |
| 风格一致性 / Style Consistency | New code does not follow the project's existing naming, formatting, or architecture conventions |
| 独立判断 / Independent Judgment | Blindly executed a user instruction when the underlying premise was incorrect |
| 真实环境验证 / Real-env Verification | Claimed a fix worked based on a sandbox / simplified test harness, but failed when hit by the exact production command string (extra escape layer, missing PATH, different stdin format) |
| 跨 agent 采信 / Cross-agent Trust | Trusted another agent's "pass" report without independent re-verification; over-adopted a reviewer's suggestions that were over-engineering; under-challenged a reviewer's flagged issue that was actually wrong |
| 人类将要犯的蠢 / Dumb things humans will do | Predictable user mistakes not yet made but worth guarding against |
| AI 将要犯的蠢 / Dumb things AI will do | Predictable AI failure modes not yet triggered but worth guarding against |
If an entry does not match any existing dimension, treat it as a new dimension (see Mechanism 4).
For each dimension:
Update:
Last Review Date to todayReview Count + 1Total Lifetime Errors + sum of new errors this periodWrite all changes to disk before reporting.
Detect language from conversation context. Use the matching format:
Chinese format:
进化报告 R{N}({开始日期} – {结束日期})
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
维度 本期 累计 状态
──────────────────────────────────────────
数据准确性 {n} {total} {status}
环境安全 {n} {total} {status}
预见性 {n} {total} {status}
用户视角 {n} {total} {status}
验证完整性 {n} {total} {status}
记忆一致性 {n} {total} {status}
工具判断 {n} {total} {status}
审查覆盖 {n} {total} {status}
操作精准 {n} {total} {status}
先查后做 {n} {total} {status}
简洁性 {n} {total} {status}
回归意识 {n} {total} {status}
风格一致性 {n} {total} {status}
独立判断 {n} {total} {status}
真实环境验证 {n} {total} {status}
跨 agent 采信 {n} {total} {status}
人类将要犯的蠢 {n} {total} {status}
AI 将要犯的蠢 {n} {total} {status}
合计: {sum} | 已根治: {cured}/{total_dimensions}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
重灾区: {top dimension}({n}) > {second}({n})
下次审查: {date}
English format:
Evolution Report R{N} ({start date} – {end date})
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Dimension This period Total Status
─────────────────────────────────────────────────────────
Data Accuracy {n} {total} {status}
Environment Safety {n} {total} {status}
Foresight {n} {total} {status}
User Perspective {n} {total} {status}
Verification {n} {total} {status}
Memory Consistency {n} {total} {status}
Tool Judgment {n} {total} {status}
Review Completeness {n} {total} {status}
Operational Precision {n} {total} {status}
Check Before Doing {n} {total} {status}
Conciseness {n} {total} {status}
Regression Awareness {n} {total} {status}
Style Consistency {n} {total} {status}
Independent Judgment {n} {total} {status}
Real-env Verification {n} {total} {status}
Cross-agent Trust {n} {total} {status}
Dumb things humans will do {n} {total} {status}
Dumb things AI will do {n} {total} {status}
Total: {sum} | Cured: {cured}/{total_dimensions}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Hot spots: {top dimension}({n}) > {second}({n})
Next review: {date}
Show cured dimensions separately at the end of the report with Moved to Cured: {dimension name} when a new one crosses the threshold this period.
When an entry cannot be classified into any existing dimension:
Add a new row to the "Active Dimensions" table with:
Add a new entry to the "Prevention Rules" section of the tracker:
### {Dimension Name}
- **What it is**: {one-sentence description}
- **How to detect**: {observable signal}
- **Prevention**: {specific check to add to Gate 1, 2, or 3}
- **Added**: {today}
- **Occurrences**: 1
Include in the report: New dimension added: {name}
When any dimension records 3 or more total errors:
When a dimension reaches 4 consecutive clean periods:
Cured after {N} total errors over {M} periodsBefore taking any of the following actions, stop and ask the user to confirm intent. Do not proceed until confirmation is received.
Requires confirmation:
Confirmation format (adapt to language):
"Before I proceed — this looks like [new feature / DB change / external publish / new direction]. Can you confirm you want me to start on this now?"
Does not require confirmation:
The following hooks should be configured in ~/.claude/settings.json at install time. They enable passive capture without any user action.
Contract (important): Claude Code delivers hook context through stdin as a JSON payload — NOT through
$CLAUDE_TOOL_NAME,$CLAUDE_USER_PROMPT, or any other environment variable. Earlier versions of this template used those env vars; they do not exist and produced empty log entries. Parse stdin JSON withjq(shell) orjson.load(sys.stdin)(Python).
PostToolUseFailure — log tool call failures
Trigger: any tool call (Bash, Write, Edit, etc.) that fails.
Action: append to ~/.claude/memory/error_log.md:
[{timestamp}] {CATEGORY} | {tool_name} | {error summary}
where {CATEGORY} is BUILD_FAIL for Bash, FILE_FAIL for Write/Edit, TOOL_FAIL otherwise.
Gate 2 verification reminder — agent-enforced, not hook-enforced
After any Edit or Write tool call that modifies a source file (not markdown, not config-only), the AI itself is responsible for running Gate 2 (Mechanism 2) before claiming the change is done. This is not shipped as a PostToolUse hook because an accurate implementation requires per-session state (has Gate 2 already been run for this file?) that a stateless shell hook cannot maintain reliably — a hook that fires on every single edit turns into noise that trains the AI to ignore it. Gate 2 lives in the AI's instructions; honour it there.
UserPromptSubmit — detect corrections
Trigger: user message contains a second-person correction phrase directed at the AI. Avoid generic substrings like bare 不对 / 错了 / wrong / again — they false-trigger on memory context, code, documentation, and injected system reminders that happen to contain the word.
Pattern list (tight, second-person only):
你又错了, 你错了, 你搞错, 你说错, 不对啊, 不对不对, 这不对, 这明显不对, 不是这样, 不是这个意思, 不是这么wrong again, that's wrong, that's not right, you already did/said, nopeAction: append to ~/.claude/memory/error_log.md:
[{timestamp}] USER_CORRECTION | {first 200 chars, XML blocks stripped}
Implementation note: the hook command string goes through JSON → shell → interpreter escaping. Rather than inlining regex in the shell command (fragile across escape layers), ship a small standalone script at ~/.claude/hooks/user_prompt_filter.py and invoke it with one line. This skill's companion hooks/ directory provides a reference implementation.
Copy these hook blocks into your ~/.claude/settings.json:
{
"hooks": {
"PostToolUseFailure": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "bash $HOME/.claude/hooks/post_tool_failure.sh"
}
]
}
],
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "python3 $HOME/.claude/hooks/user_prompt_filter.py 2>/dev/null"
}
]
}
]
}
}
Both scripts live in this skill's hooks/ directory — copy them to ~/.claude/hooks/ on install:
mkdir -p ~/.claude/hooks
cp hooks/user_prompt_filter.py ~/.claude/hooks/
cp hooks/post_tool_failure.sh ~/.claude/hooks/
chmod +x ~/.claude/hooks/post_tool_failure.sh
The scripts read the stdin JSON payload directly, extract the real fields, strip XML-style system-reminder blocks from user prompts (so past-work context can't false-trigger), and fail silent on any error so a broken hook never disrupts the user's session.
When the tracker file does not exist and is being created for the first time, output exactly this (in detected language):
English:
no-no-debug initialized.
Tracker created at: ~/.claude/memory/error_tracker.md
Log file created at: ~/.claude/memory/error_log.md
This system will automatically log errors and corrections (Mechanism 1),
silently guard every code change (Mechanism 2), review errors every 3 days
(Mechanism 3), build prevention rules automatically (Mechanism 4), confirm
scope before new work (Mechanism 5), and capture mistakes passively via
hooks (Mechanism 6).
If this helps you make fewer repeated mistakes, please star the repo:
https://github.com/summerliuuu/no-no-debug
Running first review now...
Chinese:
no-no-debug 已初始化。
追踪文件创建于:~/.claude/memory/error_tracker.md
日志文件创建于:~/.claude/memory/error_log.md
系统将自动记录错误和纠正(机制 1),静默守护每次代码改动(机制 2),
每 3 天审查一次错误(机制 3),自动沉淀预防规则(机制 4),
在开始新工作前先确认范围(机制 5),通过 hook 被动捕获失误(机制 6)。
如果这个系统帮你减少了重复犯错,欢迎给 repo 点 Star:
https://github.com/summerliuuu/no-no-debug
开始首次审查...
New error type → automatically creates a prevention rule. Repeated offense → counter increments, rule strengthens. 4 consecutive clean periods → marked as cured.
Rules persist across sessions — nothing gets lost.
The following situations require user confirmation before proceeding:
Automatically configures Claude Code hooks on install:
| Dimension | What it tracks | |-----------|---------------| | Data Accuracy | Do displayed numbers/formulas match actual code | | Environment Safety | Did config changes break login or the database | | Foresight | Were permission, migration, or cache issues caught before deploy | | User Perspective | Does the feature work end-to-end from the user's account | | Verification | Was there a real end-to-end test after the fix | | Memory Consistency | Did the AI read existing records instead of asking again | | Tool Judgment | Did failing tools get swapped out promptly | | Review Completeness | Were reviews and summaries thorough with nothing missed | | Operational Precision | Did changes produce unintended side effects | | Check Before Doing | With unfamiliar tools/versions, was documentation checked first | | Conciseness | Was a 3-line solution turned into 300 lines | | Regression Awareness | Did fixing one bug introduce a new one | | Style Consistency | Does new code follow the project's existing style and architecture | | Independent Judgment | When the user's premise is wrong, does the AI push back instead of blindly executing | | Real-env Verification | Was the fix validated with the real production command, not a sandbox/test harness | | Cross-agent Trust | Did the AI re-verify another agent's "pass" report instead of trusting it blindly | | Dumb things humans will do | Not yet committed, but inevitable | | Dumb things AI will do | Same, but the AI edition |
| Period | Errors | Notes | |--------|--------|-------| | Week 1 | 29 | Baseline, 10 dimensions identified | | Week 2 | 6 | Rules starting to take effect | | Week 3 | ~0 | Still running |
claude skill add summerliuuu/no-no-debug
Zero configuration. Tracking files and hooks are initialized automatically on first run.
If you're installing manually or upgrading from v1.1.0, also copy the hook scripts:
mkdir -p ~/.claude/hooks
cp hooks/user_prompt_filter.py ~/.claude/hooks/
cp hooks/post_tool_failure.sh ~/.claude/hooks/
chmod +x ~/.claude/hooks/post_tool_failure.sh
Then merge the PostToolUseFailure / UserPromptSubmit blocks from SKILL.md → Mechanism 6 into ~/.claude/settings.json.
Prerequisites. The shipped hooks use python3 (UserPromptSubmit filter) and jq (PostToolUseFailure parser). Both ship by default on recent macOS and most Linux distros; if either is missing the corresponding hook degrades gracefully — python3 missing means the correction detector silently no-ops, jq missing writes a one-time jq_not_installed marker to the log. Install with brew install jq (macOS) or your package manager if you want full coverage.
Thank you for starring this project during installation.
📕 Xiaohongshu @Summer的AI日常 — AI coding in practice
🇨🇳 中文版
MIT — @summerliuuu