Search past reasoning for relevant decisions and approaches
Search through previous sessions to find relevant decisions, approaches that worked, and approaches that failed. Queries two sources:
uv run python scripts/core/artifact_query.py "<query>" [--outcome SUCCEEDED|FAILED] [--limit N]
This searches handoffs with post-mortems (what worked, what failed, key decisions).
bash "$CLAUDE_PROJECT_DIR/.claude/scripts/search-reasoning.sh" "<query>"
This searches .git/claude/commits/*/reasoning.md for build failures and fixes.
# Search for authentication-related work
uv run python scripts/core/artifact_query.py "authentication OAuth JWT"
# Find only successful approaches
uv run python scripts/core/artifact_query.py "implement agent" --outcome SUCCEEDED
# Find what failed (to avoid repeating mistakes)
uv run python scripts/core/artifact_query.py "hook implementation" --outcome FAILED
# Search build/test reasoning
bash "$CLAUDE_PROJECT_DIR/.claude/scripts/search-reasoning.sh" "TypeError"
Artifact Index (handoffs, plans, ledgers):
Reasoning Files (.git/claude/):
From Artifact Index:
✓ = SUCCEEDED outcome (pattern to follow)✗ = FAILED outcome (pattern to avoid)? = UNKNOWN outcome (not yet marked)From Reasoning:
build_fail = approach that didn't workbuild_pass = what finally succeededArtifact Index empty:
uv run python scripts/core/artifact_index.py --all to index existing handoffsReasoning files empty:
/commit after builds to capture reasoning.git/claude/ directory exists