A stop hook for Claude Code that prevents the agent from stopping prematurely. When the agent finishes a response and is about to stop, Taskmaster intercepts and prompts it to re-examine whether all work is truly done.
- Agent tries to stop — the stop hook fires.
- Transcript check — the hook scans recent transcript for incomplete tasks or errors.
- Agent is prompted to verify: original requests addressed, plan steps completed, tasks resolved, errors fixed, no loose ends.
- If work remains, the agent continues working. If truly done, the agent confirms and the hook allows the stop on the next cycle.
The prompt respects user intent — if the user explicitly changed their mind, withdrew a request, or said to skip something, those items are treated as resolved.
git clone https://github.com/blader/taskmaster.git
cd taskmaster
bash install.shThis will:
- Copy the skill to
~/.claude/skills/taskmaster/ - Register the stop hook in
~/.claude/settings.json
Restart your coding agent after installing.
If you prefer to install manually:
- Copy
SKILL.mdto~/.claude/skills/taskmaster/SKILL.md - Copy
check-completion.shto~/.claude/skills/taskmaster/hooks/check-completion.sh - Make it executable:
chmod +x ~/.claude/skills/taskmaster/hooks/check-completion.sh - Add this to your
~/.claude/settings.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "$HOME/.claude/skills/taskmaster/hooks/check-completion.sh",
"timeout": 10
}
]
}
]
}
}cd taskmaster
bash uninstall.shControl the maximum number of continuation cycles via the TASKMASTER_MAX environment variable:
# Default: 10 continuations before the hook stops blocking export TASKMASTER_MAX=20 # allow up to 20 export TASKMASTER_MAX=0 # infinite — never cap (relies on transcript analysis only) export TASKMASTER_MAX=1 # minimal — one review pass then allow stop
On each stop attempt, the hook evaluates two things:
- Counter — how many times it has already blocked in this session (capped at
TASKMASTER_MAX, or uncapped if0). - Transcript signals — scans the last 50 lines of the session transcript for pending/in-progress tasks or tool errors.
The hook allows the agent to stop when:
- The counter reaches
TASKMASTER_MAX(hard cap), OR - The hook already fired once (
stop_hook_active=true) AND no incomplete signals are found in the transcript (the agent reviewed its work and there's nothing left).
The hook blocks (forces continuation) otherwise, sending the agent a checklist prompt to re-examine its work.
- Claude Code with hooks support
jq(for the install script and the hook itself)bash
MIT