# Taskmaster

> Stop hook that keeps the agent working until all plans and user requests are 100% complete. Fires when the agent tries to stop, re-examines the plan and task list, and forces continuation if anything is unfinished. Prevents premature stopping on multi-step tasks.

- Skill: `barkleesanders/taskmaster` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add barkleesanders/taskmaster`
- Raw SKILL.md: https://api.skillmd.com/api/skills/barkleesanders/taskmaster/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: barkleesanders (https://skillmd.com/u/barkleesanders)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/barkleesanders/taskmaster

---


# Taskmaster

A stop hook that prevents the agent from stopping prematurely. When a response
finishes and the agent is about to stop, this hook intercepts and prompts it
to re-examine whether all work is truly done.

## How It Works

1. **Agent tries to stop** — the stop hook fires.
2. **The hook checks** for incomplete signals (pending tasks, recent errors, blind spots in infra/config work — see reason text in check-completion.sh).
3. **Agent is prompted** to verify: original requests addressed, plan steps
   completed, tasks resolved, errors fixed, no loose ends.
4. **If work remains**, the agent continues. If truly done, it confirms and
   the hook allows the stop on the next cycle.

## Loop Protection

A session-scoped counter limits continuations to **10 by default**. Set
`TASKMASTER_MAX` environment variable to change:

```bash
export TASKMASTER_MAX=20  # allow up to 20 continuations
export TASKMASTER_MAX=0   # infinite — never cap (relies on stop_hook_active check only)
```

## Setup

The hook must be registered in `~/.claude/settings.json`:

```json
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "$HOME/.claude/skills/taskmaster/hooks/check-completion.sh",
            "timeout": 10
          }
        ]
      }
    ]
  }
}
```

## Disabling

To temporarily disable, either:
- Remove or comment out the Stop hook in `~/.claude/settings.json`
- Set `TASKMASTER_MAX=1` to allow only one continuation check

## Lighter Alternative: `/goal` (Claude Code 2.1.139+)

For one-shot autonomous loops where you don't need taskmaster's full
plan + task list + beads + worktree + AI-verify gating, use the built-in
`/goal` command instead:

```
/goal all CI checks green and all worktrees pushed
```

`/goal` sets a single completion condition and Claude keeps working across
turns until it's met. Useful when:

- You want a *specific* exit criterion, not "no incomplete signals"
- The work is bounded (one feature, one bug, one cleanup) and beads/worktree
  state doesn't matter
- You want the agent to stop the moment the goal is met, even if other
  in_progress beads exist

Use **taskmaster** (this skill, always-on Stop hook) when:

- Multi-step plans, multiple beads, multiple worktrees in flight
- You want adjacent-safety gating (WORKTREE_BLOCK, AI_VERIFY_BLOCK, BEADS_BLOCK)
- The "done" condition is fuzzy ("ship the feature properly")

The two compose: a `/goal` session still runs through taskmaster's Stop hook,
so worktree/AI-verify safety still applies even when goal-driven.

