Skip to main content

---

title: "Configuration" component_type: hook version: "1.0.0" audience: contributor status: stable summary: " Proactive Error Suggester Hook - Anti-Forgetting System" keywords: ['database', 'error', 'proactive', 'review', 'suggester'] tokens: ~1500 created: 2025-12-22 updated: 2025-12-22

Proactive Error Suggester Hook - Anti-Forgetting System

Monitors tool output for errors and proactively suggests solutions from the knowledge base. Prevents repeating the same mistakes.

Hook Type: PostToolUse (runs after each tool call) Trigger: After Bash, Read, or Write tool executions

Usage in settings.json: { "hooks": { "PostToolUse": [ { "command": "python3 hooks/proactive-error-suggester.py", "timeout": 5000 } ] } }

Input: Receives tool output via stdin or environment Output: Suggestions printed to stdout (captured by Claude Code)

File: proactive-error-suggester.py

Functions

get_db()

Get database connection.

extract_errors_from_output(output)

Extract error signatures from tool output.

find_similar_errors(conn, error_sig, limit)

Find similar errors in the knowledge base.

format_suggestion(error, solutions)

Format a suggestion for display.

main()

Main hook entry point.

Usage

python proactive-error-suggester.py