A stop hook for Claude Code that prevents premature stopping and emits a deterministic, parseable completion signal.
Taskmaster blocks every stop attempt until the transcript contains an explicit done token:
TASKMASTER_DONE::<session_id>
When the token is missing, Taskmaster returns a blocking hook response with a completion checklist and the exact signal line the agent must emit only when truly done.
git clone https://github.com/blader/taskmaster.git
cd taskmaster
bash install.shThis will:
- Copy skill files to
~/.claude/skills/taskmaster/ - Install the hook script at
~/.claude/skills/taskmaster/hooks/check-completion.sh - Register the stop hook in
~/.claude/settings.json
Restart your coding agent after installing.
- 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 hook entry to
~/.claude/settings.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "$HOME/.claude/skills/taskmaster/hooks/check-completion.sh",
"timeout": 10
}
]
}
]
}
}TASKMASTER_MAX(default0)0: infinite blocking until done token appears>0: max block count before forced allow
TASKMASTER_DONE_PREFIX(defaultTASKMASTER_DONE)- done token becomes
<prefix>::<session_id>
- done token becomes
cd taskmaster
bash uninstall.sh- The done token is session-specific, so external automation can parse completion deterministically.
- For details, see
docs/SPEC.md.
- Claude Code with hooks support
jq(for installer and hook)bash
MIT