Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created December 10, 2025 17:51
Show Gist options
  • Select an option

  • Save johnlindquist/232aa407ca8b60190c07ce7795222aa0 to your computer and use it in GitHub Desktop.

Select an option

Save johnlindquist/232aa407ca8b60190c07ce7795222aa0 to your computer and use it in GitHub Desktop.
Claude Code Hooks: Auto-Refreshing Tools List Every 3 Prompts

CLAUDE.md Bundle

Generated: 2025-12-10T17:51:51.492Z Source: /Users/johnlindquist/.claude/CLAUDE.md Files included: 7


/Users/johnlindquist/.claude/CLAUDE.md

Core

@/.claude/root.md @/.claude/skills.md

Requirements

@/.claude/cli-preferences.md @/.claude/scripting-preferences.md @/.claude/git-preferences.md @/.claude/logging-preferences.md


/Users/johnlindquist/.claude/root.md

Root Cause Protocol

Surface fixes = debt. Root cause fixes = investment.

Forbidden Fixes

Symptom BANNED REQUIRED
Slow loading Skeleton/spinner Optimize the slow query
Stale data Frontend cache Fix data source
API timeout Retry logic Find why API is slow
Wrong display UI fallback Fix data corruption source
Intermittent failure Error boundary Find the race condition

Mental Translation

"Fix X" → "Find root cause of X"

  • "Fix slow table" → Find what makes it slow
  • "Add caching" → Why is this slow enough to need caching?

When Surface Fixes Are Acceptable

Only when:

  1. Root cause is in external code you cannot modify
  2. You've documented WHY root cause can't be addressed
  3. User explicitly approves the trade-off

/Users/johnlindquist/.claude/skills.md

Tools

Tool Routing

You are a tool router. Your task is to call cm tools.

Tools are listed in <tools> at session start. To call a tool:

  1. mcp__cm__get_tool_schema({ name: "category_tool" }) - get parameters
  2. mcp__cm__call_tool({ name: "category_tool", args }) - execute

Example: beads_addmcp__cm__call_tool({ name: "beads_add", args: { title: "..." } })


Beads Protocol

Banned Tools

CRITICAL: The TodoWrite tool is BANNED for destructive behavior, use the beads instead:

Task tracking uses beads_* tools. Session workflow:

  • Start: beads_ready → see what's unblocked
  • New task: beads_add
  • Done: beads_close
  • End session: beads_sync

For complex projects (games, apps): create epic → break into subtasks → show plan → get approval before coding.


Lazy-Load Skills (Only These)

Use Skill("name") ONLY for these methodology files:

Skill Purpose
review Persona references (Fowler, Linus, Carmack)
ts-testing Testing philosophy
diagram DDD methodology
frontend-design Design principles
github gh CLI reference files
tool-creator Guide for creating cm tools

Everything else uses cm tools from <tools> block.


/Users/johnlindquist/.claude/cli-preferences.md

CLI/UI Preferences

Interactive List Selection

  • Primary selection first (firm), then secondary actions second
  • Show selected item details before action menu to confirm choice
  • Always support "back" option to return to selection without taking action
  • Keyboard shortcut hints in action menus (e.g., "r=resume, e=expand, b=back")
  • Up/down arrows for list selection, then confirm action with up/down on action menu
  • Always prefer up/down arrows + autocompletion for list selection

/Users/johnlindquist/.claude/scripting-preferences.md

Scripting Preferences

Language Rules

  • Never use Python for scripting
  • Always use Bun + TypeScript
  • Default to creating a ./scripts directory in the project

/Users/johnlindquist/.claude/git-preferences.md

Git Preferences

Commit Messages (Conventional)

feat: | fix: | chore: | docs: | refactor: | test: | style:

Beads Integration

bd hooks install   # One-time per workspace (installs git hooks)
bd sync            # ALWAYS run before ending session

Worktree Caveat

When using git worktrees, disable beads daemon:

export BEADS_NO_DAEMON=1

/Users/johnlindquist/.claude/logging-preferences.md

Debugging Protocol

Logs FIRST, code SECOND. Never read source until you've read logs.

Rules

  1. Find logs: find . -name "*.log" -type f
  2. Trust hierarchy: Logs > Stack traces > Source code > Developer guesses
  3. Evidence required: No fix without citing specific log lines
  4. Gate: "Which log entry points to this file?" → If none, read more logs

Output

  • DO: Fix bug + add logging improvements
  • DON'T: Create DEBUG_REPORT.md files

Detailed workflow → Skill("investigate")


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment