Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Manually teach error pattern and solution to learning database.
.claude/skills/notque-learn/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 126% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 302% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 243% | 0% |
| case-07 | ✓→✗ | ▼ Worse | 376% | 0% |
Parse a user-provided "error -> solution" pair, classify it, store it in the cross-session learning database at high confidence, and confirm back. One pattern per invocation. All database operations go through the learning-db.py CLI.
Extract two fields from the user's input:
error_pattern: The error message or symptom textsolution: The fix or resolution textAccepted input formats:
/learn "error pattern" -> "solution"/learn "error pattern" => "solution"Both fields must be non-empty. If either is missing, ask the user for the missing part before proceeding. If the error pattern is vague (e.g., "it broke") or the solution is non-actionable (e.g., "fix it"), ask the user to provide the specific error message and concrete fix steps — vague patterns fail to match future errors and waste database space.
Determine fix_type and fix_action from the solution text by applying these rules in order:
pip install, npm install, apt install) -> fix_type=auto, fix_action=install_dependencyreplace_all -> fix_type=auto, fix_action=use_replace_allfix_type=skill, fix_action=<skill-name>fix_type=agent, fix_action=<agent-name>fix_type=manual, fix_action=apply_suggestionExecute the learning-db.py CLI to persist the pattern. Always pass user-provided strings as CLI arguments exactly as shown — never inline them into Python code via f-strings or string concatenation, because quotes or special characters in error text will break the script and create injection risk.
bashpython3 ~/.claude/scripts/learning-db.py record \ "<error_type>" \ "<error_signature>" \ "<error_pattern> → <solution>" \ --category error \ --confidence 0.9
<error_type>: The classified type (e.g., "missing_file", "multiple_matches")<error_signature>: A kebab-case key derived from the error patternExample:
bashpython3 ~/.claude/scripts/learning-db.py record \ "multiple_matches" \ "edit-tool-multiple-matches" \ "Edit tool fails with 'found N matches' → Use replace_all=True parameter" \ --category error \ --confidence 0.9
The script must exit 0 and print confirmation. If it fails, see Error Handling below.
Always display what was stored so the user can verify correctness — silently storing without confirmation hides typos and misclassifications:
Learned pattern:
Error: "<error_pattern>"
Solution: "<solution>"
Type: <fix_type> (<fix_action>)
Confidence: 0.9Cause: scripts/learning-db.py not found or not synced to ~/.claude/scripts/ Solution: Verify working directory is the repo root, or use ~/.claude/scripts/learning-db.py for cross-repo access.
Cause: Another process holds the SQLite lock Solution: Retry after 2 seconds. If persistent, check for hung processes with lsof ~/.claude/learning/learning.db.
Cause: Incomplete input Solution: Ask the user explicitly for the solution text. Do not guess or fabricate solutions.
hooks/lib/learning_db_v2.py: Unified learning database modulescripts/learning-db.py: CLI for recording, querying, and managing learningshooks/error-learner.py: Automatic error learning hook (complementary system)| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-12 | pass→pass | 9,758 | 5,678 | -42% | 1 | 1 | 0% | 1,766 | 2,002 | +13% | 0 | 0 | — |
case-01 | fail→fail | 6,125 | 6,233 | +2% | 1 | 1 | 0% | 959 | 1,427 | +49% | 0 | 0 | — |
case-06 | fail→fail | 2,259 | 6,986 | +209% | 1 | 1 | 0% | 280 | 1,505 | +438% | 0 | 0 | — |
case-02 | fail→fail | 2,603 | 6,384 | +145% | 1 | 1 | 0% | 442 | 1,549 | +250% | 0 | 0 | — |
case-03 | fail→fail | 5,704 | 6,642 | +16% | 1 | 1 | 0% | 868 | 1,468 | +69% | 0 | 0 | — |
case-04 | fail→pass | 4,379 | 2,551 | -42% | 1 | 1 | 0% | 640 | 1,445 | +126% | 0 | 0 | — |
case-05 | fail→pass | 2,657 | 3,483 | +31% | 1 | 1 | 0% | 382 | 1,535 | +302% | 0 | 0 | — |
case-07 | pass→fail | 1,948 | 7,613 | +291% | 1 | 1 | 0% | 305 | 1,451 | +376% | 0 | 0 | — |
case-08 | fail→fail | 1,852 | 7,271 | +293% | 1 | 1 | 0% | 308 | 1,494 | +385% | 0 | 0 | — |
case-09 | fail→fail | 2,014 | 7,117 | +253% | 1 | 1 | 0% | 275 | 1,474 | +436% | 0 | 0 | — |
case-10 | pass→pass | 11,007 | 5,711 | -48% | 1 | 1 | 0% | 2,182 | 2,026 | -7% | 0 | 0 | — |
case-11 | fail→pass | 15,977 | 10,634 | -33% | 1 | 1 | 0% | 3,155 | 3,001 | -5% | 0 | 0 | — |
case-13 | fail→fail | 1,668 | 7,038 | +322% | 1 | 1 | 0% | 255 | 1,548 | +507% | 0 | 0 | — |
case-14 | fail→fail | 2,344 | 7,078 | +202% | 1 | 1 | 0% | 357 | 1,565 | +338% | 0 | 0 | — |
case-15 | pass→fail | 1,758 | 8,277 | +371% | 1 | 1 | 0% | 259 | 1,554 | +500% | 0 | 0 | — |
case-16 | pass→fail | 2,003 | 8,036 | +301% | 1 | 1 | 0% | 312 | 1,562 | +401% | 0 | 0 | — |
case-17 | fail→fail | 1,690 | 7,481 | +343% | 1 | 1 | 0% | 289 | 1,475 | +410% | 0 | 0 | — |
case-18 | fail→fail | 2,395 | 10,328 | +331% | 1 | 1 | 0% | 255 | 1,875 | +635% | 0 | 0 | — |
case-19 | fail→pass | 2,839 | 2,977 | +5% | 1 | 1 | 0% | 427 | 1,466 | +243% | 0 | 0 | — |
case-20 | fail→fail | 2,014 | 6,425 | +219% | 1 | 1 | 0% | 273 | 1,479 | +442% | 0 | 0 | — |
case-21 | fail→fail | 3,200 | 7,415 | +132% | 1 | 1 | 0% | 459 | 1,418 | +209% | 0 | 0 | — |
case-22 | fail→fail | 1,931 | 7,498 | +288% | 1 | 1 | 0% | 280 | 1,542 | +451% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 6 counted toward the lift figure. The other 16 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +5 percentage points is the difference between those two pass rates over the 6 comparable cases. 5 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.