Manager — codeword-triggered Manager mode + HARD delegation wall

sonnet hook

Tip

What is Manager mode? You type a short codeword (++m, ++mp, ++rr, or ++r) anywhere in your message and Claude instantly activates a discipline contract — just for that one message. ++m makes Claude a pure orchestrator that delegates all hands-on work. ++mp adds a full task-graph planning pass. ++rr and ++r inject review discipline (anti-regression / two-phase double-check). No setup required. The codeword is stripped from your message; your actual text is preserved.

What actually happens

You type:

++m refactor the payment module

Claude actually receives (you never see this part — it is injected invisibly by a hook):

Note

[ INJECTED: Manager operating contract ]

You are a Manager, not an executor. Your job is orchestration only.

  1. Decompose the task — identify all pieces.
  2. Build a TaskGraph — every piece becomes a task with dependencies.
  3. Delegate — spawn the best specialist agent for each task.
  4. Run independent tasks in parallel — maximize fan-out.
  5. Integrate results — collect outputs, synthesize the answer.

Never implement, fix, or edit code yourself. Never run builds or tests yourself. If you catch yourself writing production code — stop and delegate instead.

refactor the payment module

Your single line becomes: the full Manager contract (highlighted above) + your original request. The codeword ++m is consumed; your text reaches Claude unchanged. Curious how injection works? See Prompt Injection.


Codewords

CodewordMeansWhat it does
++mManagerManager + delegation for the current task — Claude orchestrates, never codes by hand
++mpManager for PlanManager role for plan + delegation — writes the full task graph in English before starting, uses the tasks tool
++rrRegression ReviewRegression review with double-check — after each significant phase, run a review focused on no regression + project standard + correctness; two-phase (review → double-check → fix); mandatory final cross-review at task end
++rReviewReview with double-check — after each significant change, run a two-phase multi-agent review (review → double-check → fix); codeword-only, no ambient injection or wall state change

Detection order: ++mp++m++rr++r (longest-prefix first; ++rr is always tested before ++r).

Put the codeword anywhere: start, middle, or end of your message. Everything else is passed through unchanged.


Everyday commands

CommandWhat it does
/brewtools:manager statusShow what is currently on — codeword state, wall state, prompt source
/brewtools:manager onTurn on the HARD wall — Claude physically cannot write/edit files in this project until you turn it off
/brewtools:manager offTurn the HARD wall off
/brewtools:manager edit fullOpen the Manager prompt text so you can customize it

The HARD wall

Caution

With the HARD wall ON, Claude in the main chat physically cannot edit files, write, or run mutating commands. It is forced to delegate every hands-on step to a subagent. Subagents have full freedom — they can write, edit, run tests, push commits, anything. Turn the wall on and off with /brewtools:manager on / /brewtools:manager off. It is opt-in and per-project — nothing changes until you enable it.

The wall in action

The wall is ON. You ask:

fix the bug in payment.ts

Claude tries to edit the file directly — and is blocked:

Caution

Edit blocked — Manager HARD wall is ON. The main session cannot edit files, write, or run mutating commands. Delegate this to a subagent.

So Claude does the right thing — it spawns a subagent, which has full access:

  1. Main session: delegate

    Claude spawns a developer subagent with the task “fix the bug in payment.ts”.

  2. Subagent: do the work

    The subagent edits payment.ts, runs the tests — all tools allowed inside a subagent.

  3. Main session: integrate

    Claude reads the subagent’s result and reports back. It never touched the file itself.

What is allowed vs blocked (wall ON)

In the MAIN chat (wall ON)Allowed?
Read, search, plan, delegate (Task)Yes
Edit / Write filesNo — delegate
Run mutating commandsNo — delegate (read-only Bash allowed on the default level)
Anything inside a subagentYes — full freedom

This is what “delegate everything” means in practice — the wall makes it physically true, not just a suggestion. For the deep mechanics (tool buckets, strict vs balanced, the agent_id linchpin) see the technical spoiler below.


When to use

SituationWhat to type
Delegate one complex task as Manager, just this turndo X ++m
Start a full parallel plan with task breakdownplan Y ++mp
Enforce the delegation rule for a whole project session/brewtools:manager on
Run one task under the wall then auto-revertrefactor payment service in hard mode
Run task as Manager without changing any wall statebuild release plan as manager
Check current state/brewtools:manager status

Technical: how the HARD wall works (tool buckets, strict vs balanced, agent_id linchpin)

The HARD wall is an optional, project-scoped guard that physically blocks the main Claude session from writing or editing files. Subagents always stay fully free — delegation is never blocked.

Install-once + state-gate

/brewtools:manager on copies hardmode-guard.mjs from the plugin cache into <cwd>/.claude/brewtools/manager/hardmode-guard.mjs and registers a PreToolUse * entry in <cwd>/.claude/settings.local.json (personal, gitignored). The guard is registered once; subsequent on calls overwrite it (so plugin updates propagate) without adding duplicates. A /reload or session restart is required after first install.

The guard reads <cwd>/.claude/brewtools/manager/state.json on every PreToolUse call. When hard !== true, the guard exits immediately — no denial. off flips state.hard=false without touching settings.local.json; the guard stays registered but becomes a no-op. This split exists because editing settings while the wall is armed would be blocked — the state flip is self-exempt and always succeeds.

agent_id linchpin — main session blocked, subagents free

The PreToolUse payload carries agent_id / agent_type only for subagent-internal tool calls. Main-session calls have no agent_id. The guard denies mutations only when agent_id is absent. Subagents pass through freely — delegation itself is never blocked.

Tool buckets

BucketToolsMain session while wall ON
ALWAYS-ALLOWRead, Grep, Glob, Task, Agent, Skill, TaskCreate, TaskUpdate, TaskList, TaskGet, TodoWrite, AskUserQuestionAlways allowed — delegate / read / track
ALWAYS-BLOCKWrite, Edit, NotebookEdit, WebFetch, MCP-write toolsAlways denied — hands-on mutation
LEVEL-gatedBash, WebSearch, MCP-read toolsDecided by level (see below)

Strict vs balanced

Aspectstrictbalanced (default)
BashFully OFF — every command deniedRead-only classifier — allow inspection, deny mutation
Allowed Bash (balanced)git status/log/diff/show/branch, ls, cat, pwd, which, echo, head, tail, wc, gh ... list/view, grep/rg, find (no -delete/-exec)
Denied Bash (balanced)>, >>, rm, mv, cp, git commit/push/reset, npm install, pnpm, yarn add, pip install, mkdir, touch, chmod, sed -i, tee, kill, $(...), node -e
WebSearchOFFON
MCP-readExplicit-allow list onlyHeuristic allow (read-shaped tool names)
MCP-writeDeniedDenied

The balanced Bash classifier is an allowlist of known-safe read-only commands, NOT a shell evaluator. Command substitution $(...) and node -e / --eval are denied even in balanced mode.

Off-switch safety

GuaranteeMechanism
/brewtools:manager off is never blockedSkill tool is ALWAYS-ALLOW; state writer is self-exempt by path anchor
Works even at level strictwriteState target path (.claude/brewtools/manager/state.json) is exempt from Bash denial
Every denied tool call shows the exit commandDeny reason: Manager HARD wall is ON -- delegate via Task/Agent, or run /brewtools:manager off to exit.
Technical: prompt resolution + scopes (where the Manager text comes from)

How the codeword injection works

On every user message, manager-prompt.mjs scans the prompt text. Detection order follows longest-prefix first: ++mp++m++rr++r. This ensures ++mp is never mis-matched as ++m, and ++rr is never mis-matched as ++r. If no codeword is present (and the wall is not armed), the hook exits immediately — no file I/O, zero overhead.

The hook resolves the prompt text for the detected mode (full or planmode) via three-level fallback:

  1. Project override: .claude/brewtools/manager/prompts/<mode>.md
  2. Global override: ~/.claude/manager/prompts/<mode>.md
  3. Plugin default: plugin references/<mode>.md

Project and global overrides survive plugin updates because they live outside the plugin cache.

When the HARD wall is armed, the Manager (full) block is also ambient-injected every turn with no codeword needed — codewords and wall injection are independent channels.

Scope table

ThingScopeFiles
Wall flags {"{"}hard, level{"}"}PROJECT ONLY<cwd>/.claude/brewtools/manager/state.json
Wall registration (guard)PROJECT ONLY<cwd>/.claude/settings.local.json + <cwd>/.claude/brewtools/manager/hardmode-guard.mjs
Soft mode field (informational)project statesame state.json
Prompt-text overrides (edit/reset)project or globalproject: <cwd>/.claude/brewtools/manager/prompts/<mode>.md — global: ~/.claude/manager/prompts/<mode>.md

The wall flags (hard/level) are resolved project-only. Passing --scope global to on/off/level is silently ignored (wall has no global scope); the flag only applies to prompt-text override scope in edit/reset.

Prompt resolution chain

PriorityState sourcePrompt override source
1 (highest).claude/brewtools/manager/state.json.claude/brewtools/manager/prompts/<mode>.md
2~/.claude/manager/state.json~/.claude/manager/prompts/<mode>.md
3 (lowest)Hardcoded {"{"}enabled:true, mode:"full"{"}"}Plugin references/<mode>.md

Global paths (~/.claude/*) are protected from direct Write/Edit tool access (Claude Code v3.4.70+). The skill writes them via bundled Node helpers using atomic lock+tmp+rename.

Plan Mode addon (++mp)

When ++mp is detected, the hook injects both the full Manager block and the Plan Mode addon. The addon instructs the model to: write the full TaskGraph in English into the plan before starting; mark tasks with parallel / critical-path indicators; output all task and plan text in English regardless of user prompt language.

Full command and intent reference (all actions, hard-one-shot vs manager-run)

The skill also understands natural-language Russian (e.g. on/off, hard mode, status). The complete RU+EN trigger list lives in the skill’s SKILL.md.

Actions

ActionCommand / natural languageEffect
on/brewtools:manager onINSTALL guard + ARM the HARD wall (project). /reload on first install only
off/brewtools:manager offDISARM the wall (state flip only — registration kept, guard no-ops)
uninstall/brewtools:manager uninstallDEREGISTER guard from settings.local.json, then /reload
level strict/brewtools:manager level strictWall strictness = strict (Bash fully off)
level balanced/brewtools:manager level balancedWall strictness = balanced (read-only Bash allowed)
status/brewtools:manager statusFull explainer: codewords + wall state + effective prompt sources
mode full/brewtools:manager mode fullSet prompt-text mode to full (informational only)
mode planmode/brewtools:manager mode planmodeSet prompt-text mode to planmode (informational only)
edit [full|planmode]/brewtools:manager editCopy plugin default into project override for editing
reset [full|planmode]/brewtools:manager resetDelete project override, revert to plugin default
hard-one-shot<task> in hard modeWall ON — run task as Manager — auto-revert wall OFF when done (reverts even on failure or abort)
manager-run<task> as managerRun task as Manager with wall UNTOUCHED (discipline via injected prompt only — no wall toggle)
inline-run/brewtools:manager <task>Prepend Manager block, execute — no state change

Expected status output (wall off)

# Manager -- status

## Codewords (ALWAYS active -- hook-driven, independent of this skill)
Type `++m` anywhere   -> injects the Manager (full) block for that one turn.
Type `++mp` anywhere  -> injects the Manager + Plan Mode block for that one turn.
Type `++rr` anywhere  -> injects the Regression Review contract for that one turn.
Type `++r` anywhere   -> injects the Review contract for that one turn.

--- injected by ++m (full) ---
<full Manager block text>

--- injected by ++mp (planmode) ---
<planmode block text>

## HARD wall (this project) -- registered=no  armed=OFF  level=balanced  (state source: default)
Enable:    /brewtools:manager on
Disable:   /brewtools:manager off
Uninstall: /brewtools:manager uninstall
Level:     /brewtools:manager level strict | balanced

hard-one-shot vs manager-run

hard-one-shot (<task> in hard mode) actually toggles the guard: wall ON — task runs — wall auto-reverts OFF when done, even on failure or abort. The guard never silently persists.

manager-run (<task> as manager) does NOT touch the wall state at all. Manager discipline is enforced via the injected prompt only. Use this when you want Manager behavior without arming or changing the guard.

⚙️

Think Short

Companion output-control skill — inject brevity directives via SessionStart and per-agent PreToolUse rather than per-prompt codewords.

Prompt Injection

How the ++m / ++mp / ++rr / ++r codewords inject the Manager / review contract into the model — the full mechanism explained.

📄

Brewtools overview

All brewtools skills and agents in one place.

🔗

GitHub source

Source code — skill, manager-prompt.mjs hook, hardmode-guard.mjs, prompt references, and state helpers.

Updating plugins

Use /brewtools:plugin-update to check and update the brewcode plugin suite in one command. See the FAQ for details.