Skip to content

yigitkonur/hooks-claude-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-approves Claude Code's "ready to code?" plan dialog so you stop clicking a button 50 times a day. orchestrator mode injects a directive that makes Claude execute with precision and delegate complex tasks via subagents. pure bash, no dependencies beyond jq.

bash <(curl -fsSL https://raw.githubusercontent.com/yigitkonur/hooks-claude-code/main/install.sh)

bash platform license


the problem

Claude Code has a plan mode. when Claude finishes writing a plan and calls ExitPlanMode, it fires a PermissionRequest event and waits for you to click approve. every single time. this hooks into that event and returns {"behavior":"allow"} immediately.

two modes

the installer asks you to pick one:

mode what it does
1 — Classic approves every plan instantly. no frills, no extras. install and forget
2 — Orchestrator (recommended) approves instantly and injects an orchestrator directive into Claude's context — makes it execute step-by-step, spawn background subagents for complex tasks, and enforce strict BSV completion criteria

what the orchestrator directive does

when a plan is approved in orchestrator mode, Claude receives context that tells it to:

  • execute step-by-step with full precision, no shortcuts
  • act as an orchestrator for large/multi-file tasks — spawn background subagents with self-contained prompts
  • structure every subagent prompt with: context & rationale, strategic intent (outcomes not steps), and a BSV-compliant definition of done
  • enforce 100% completion — partial = incomplete, no handing back until every criterion is satisfied
  • never prescribe steps — define outcomes and let agents own the solution

this is particularly useful if you use Claude Code with background agents, teams, or complex multi-file refactors.

install

bash <(curl -fsSL https://raw.githubusercontent.com/yigitkonur/hooks-claude-code/main/install.sh)

or clone first:

git clone https://github.com/yigitkonur/hooks-claude-code.git /tmp/claude-plan-hook \
  && bash /tmp/claude-plan-hook/install.sh \
  && rm -rf /tmp/claude-plan-hook

requires jq (brew install jq / apt install jq). installer is idempotent — re-run to switch modes.

how it works

hooks into Claude Code's PermissionRequest event with matcher ExitPlanMode. the hook script:

  1. consumes stdin (required by hook protocol)
  2. prints the allow decision to stdout
  3. (orchestrator mode) includes an additionalContext field with the orchestrator directive
  4. Claude Code reads stdout, skips the dialog, starts implementing

what gets installed

~/.claude/hooks/claude-plan-hook.sh    — the active hook script (one of two modes)
~/.claude/settings.json                — hook registration merged via jq

the installer merges into settings.json without destroying existing hooks or settings.

project structure

hooks-claude-code/
  install.sh                        — interactive installer
  uninstall.sh                      — uninstaller
  hooks/
    auto-approve-plan.sh            — mode 1: classic auto-approve
    auto-approve-orchestrator.sh    — mode 2: auto-approve + orchestrator directive

uninstall

bash <(curl -fsSL https://raw.githubusercontent.com/yigitkonur/hooks-claude-code/main/uninstall.sh)

or manually:

rm ~/.claude/hooks/claude-plan-hook.sh
# then remove the ExitPlanMode entry from ~/.claude/settings.json

compatibility note

issue #1 reported a jq sub() regex bug in the old Craft integration. that code path no longer exists in this repository because Craft support was removed entirely. the current scripts do not use sub() or Craft payload generation.

license

MIT

About

auto-approve Claude Code plans instantly — optional Craft.do archiving

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages