PLUGIN brewtools / Skills

Manager Setup — opt-in HARD delegation wall

sonnet hard wall project only user-invoked

View README on GitHub (opens in a new tab)

Manager Setup installs a guard into your project that blocks Write, Edit and mutating Bash in the main chat, so Claude has to delegate the hands-on work to subagents. It is opt-in, per project, and off until you arm it.

Quick reference

FieldValue
Command/brewtools:manager-setup
Arguments[prompt] [status|install|upgrade|enable|disable|uninstall|purge] [level strict|balanced] [--unattended]
Modelsonnet
ScopeProject only; the wall has no global scope
Defaultstatus with no argument

What it does

The skill installs a self-contained PreToolUse guard into the project and registers it once in the personal, gitignored .claude/settings.local.json. A state.json flag decides at run time whether the guard is armed. While armed, the main session can read, search, plan, track tasks and delegate; every edit, write and mutating command goes to a subagent. Subagents keep full freedom.

On Claude Code 2.1.233 and later, install and upgrade also set env.CLAUDE_CODE_ENABLE_TODO_TOOLS="1" in .claude/settings.local.json, so TaskCreate, TaskUpdate, TaskGet and TaskList stay available. The key is written only when no settings layer already sets it; an explicit 0, false or empty value is kept and reported as kept off. uninstall keeps the key; purge removes it only when this skill added it (todoToolsAdded in state.json).

When to use

SituationWhat to type
Enforce delegation for a whole project session/brewtools:manager-setup install
Run one task under the wall, then auto-revertrefactor payment service in hard mode
Run a task as Manager, wall untouchedbuild release plan as manager
Check current state/brewtools:manager-setup status
Pick up the guard after a plugin update/brewtools:manager-setup upgrade

Commands

Canonical order, shared by every -setup skill: status | install | upgrade | enable | disable | uninstall | purge, then level <strict|balanced>. No argument = status.

CommandWhat it does
statusWall state, task-tools state, codewords pointer, override files. A leftover state.json alone is not an install: status recommends install, never upgrade
installInstall the guard; asks to confirm arming unless your prompt already said “enable the hard wall”. Declining installs it disarmed
upgradeRe-copy the guard and off-switch CLI, backfill what an older install lacks, preserve hard/level
enable / disableArm an installed wall / disarm it (state flip only, registration stays)
uninstallDeregister and delete the copied guard. State, overrides and the task-tools key are kept
purgeuninstall + delete state and helpers. The only destructive action
level <strict|balanced>balanced = read-only Bash allowed; strict = all Bash denied

Under --unattended, upgrade skips with nothing written when no wall is installed and never arms one; see how the flag works.

on, off and reset are not commands; as free text they route to enable, disable, purge. There is no edit command; change codeword text in the placeholders mod.

Codewords live in a mod

The codewords ++m, ++a, ++rr, ++r and +++ are provided by the brewmod-placeholders mod, not by this skill. The mod needs Claude Code 2.1.301+: run claude update, then restart Claude Code (type exit, then run claude), then claude plugin install brewmod-placeholders@claude-brewcode. The mod reads override files under .claude/brewtools/manager/prompts/; status lists them.

The wall in action

With the wall ON, Claude in the main chat cannot edit files, write, or run mutating commands. Subagents can do anything. Drop the wall with /brewtools:manager-setup disable.

You ask fix the bug in payment.ts. Claude tries Edit and is denied with an explanation and the exit command.

  1. Main session: delegate

    Claude spawns a developer subagent with the task.

  2. Subagent: do the work

    The subagent edits payment.ts and runs the tests; every tool is allowed inside a subagent.

  3. Main session: integrate

    Claude reads the result and reports back without touching the file.

In the MAIN chat (wall ON)Allowed?
Read, search, plan, delegate (Agent)Yes
Edit / Write filesNo — delegate
Mutating commandsNo — delegate (read-only Bash allowed at balanced)
Anything inside a subagentYes

The guard is a strict binary allowlist with exec-flag vetting. It fails closed on an unparseable payload, a missing or corrupt state.json, an unknown MCP tool token and a missing guard with onFailure: "block".

Technical: how the HARD wall works #

Install-once and state gate

install copies hardmode-guard.mjs to <cwd>/.claude/brewtools/manager/hardmode-guard.mjs and registers a PreToolUse * entry in <cwd>/.claude/settings.local.json. upgrade re-copies it without duplicates and without touching the arm state. Settings are watched, so the change applies live (/hooks confirms). install also copies lib/manager-state.mjs to <cwd>/.claude/brewtools/manager/manager-state.mjs, the off-switch CLI (get / set hard=<bool> level=<strict|balanced> mcpAllow=<mcp__srv__tool[,...]|> [--cwd DIR]), at a fixed path because resolving the plugin root needs shell operators the armed wall denies.

The guard reads state.json on every call. When hard !== true it exits immediately; disable only flips state.hard=false. uninstall is two Bash calls: the bare disarm first, then the deregistration.

The registration carries onFailure: "block" (Claude Code 2.1.295+; older versions ignore it and fail open). If the registered script is missing (the .claude/brewtools/ tree deleted by hand, the project moved), every tool call fails with blocking because onFailure is "block", Read included, even with the wall disabled. Recovery is outside the session: delete the brewtools-manager-guard entry from .claude/settings.local.json; settings are watched, so it drops live. Remove the wall with disable or uninstall, never by deleting files.

agent_id linchpin

The PreToolUse payload carries agent_id / agent_type only for subagent-internal calls. The guard denies mutations only when agent_id is absent, including for a session started with claude --agent <name>. The field is undocumented: re-verify on each major Claude Code upgrade.

Tool buckets

BucketToolsMain session
ALWAYS-ALLOWread: Read, Grep, Glob, LSP - delegate: Agent, Task, Skill, Workflow, ListAgents, SendMessage, SubagentHandback - worktrees: EnterWorktree, ExitWorktree - plan: EnterPlanMode, ExitPlanMode - discovery: ToolSearch, WaitForMcpServers - track: TaskCreate, TaskUpdate, TaskList, TaskGet, TodoWrite, ReportFindings - timers: CronCreate, CronList, CronDelete, ScheduleWakeup - TaskStop, ListMcpResourcesTool, ReadMcpResourceTool, AskUserQuestionAllowed
ALWAYS-BLOCKWrite, Edit, NotebookEdit, WebFetch, Artifact, every unlisted tool, MCP-write toolsDenied
LEVEL-gatedBash, Monitor, WebSearch, MCP-read toolsDecided by level

strict vs balanced

Aspectstrictbalanced (default)
Bash, MonitorAll deniedAllowlist classifier: inspection only
Allowed binaries—ls cat pwd which head tail wc date whoami basename dirname realpath test [ jq echo grep rg find git gh node, bare names only (/bin/ls, VAR=x ls, env ls never match)
WebSearchOFFON
MCP-readOnly mcp__semble_code__* search toolsRead-shaped names plus the mcpAllow state key
MCP-writeDeniedDenied

Any >, <, $(...) or backtick denies the whole command. env is absent on purpose: it is a universal exec wrapper.

Exec-flag vetting

An unlisted binary is denied by default. For listed binaries the guard denies a fixed set of known exec and write flags (below); it does not allowlist flags, so an unknown flag on rg, grep or find passes, and ls, cat, jq and similar accept any arguments.

BinaryVetted how
gitstatus/log/diff/show/rev-parse/describe bare; remote -v; tag -l; stash list; branch bare or listing flags only. -c, --config-env, --exec-path, --upload-pack, --receive-pack, --ext-diff, -C, --output, --textconv deny on any subcommand
ghPositional read verbs only: list, view, status
grep / rgDenied on --pre, --pre-glob, --hostname-bin, --search-zip, -z
findDenied on -exec, -execdir, -ok, -okdir, -delete, -fprint, -fprint0, -fprintf, -fls
nodeOnly node --check <file>

The guard also denies the main session on an unparseable payload, a missing or corrupt state.json, and an internal error. Only two pass-throughs remain: the manager was never installed in this project, and a genuine subagent call.

Off-switch safety

Exactly one Bash shape survives an armed wall, at every level:

node <ABS project root>/.claude/brewtools/manager/manager-state.mjs set hard=false

disable runs precisely that (Skill is always allowed). The command must start with node , be the only segment (no &&, ||, ;, |, &), carry no $, backtick, >, <, no evaluator flag (-e, --eval, -p, --print, --input-type, -r/--require, --import, --loader, --experimental-loader), and the script node executes, resolved with realpath, must be the helper installed in this project or the plugin’s own hooks/lib/manager-state.mjs. Appending && echo or a BT_ROOT= prelude makes the guard deny it. The remaining tokens must be the helper’s CLI. To repair a false MCP denial at balanced, quote the value: set 'mcpAllow=mcp__semble_code__*,mcp__github__get_file' (replaces the list; set 'mcpAllow=' clears it). Anything else: delegate to a subagent.

Installed the wall before v5.0.0? Run /brewtools:manager-setup upgrade once: the disarm command needs the project-local manager-state.mjs, otherwise it fails with Cannot find module. If the wall is armed, delegate the upgrade to a subagent.

Version and ownership

Writes to state.json stamp version, content_version, generated_by ("brewtools:manager-setup") and last_updated; upgrade refreshes them and preserves hard and level. setup-status reads content_version first. If the plugin version cannot be resolved, writeState deletes the version key and warns instead of aborting, so a user is never locked behind an armed wall.

Technical: scopes, state and natural-language prompts #
ThingScopeFiles
Wall flags {"{"}hard, level{"}"}Project only<cwd>/.claude/brewtools/manager/state.json
Registration and guardProject only<cwd>/.claude/settings.local.json, hardmode-guard.mjs, manager-state.mjs in <cwd>/.claude/brewtools/manager/
Informational modeProject state, then globalsame state.json, else <config dir>/manager/state.json (CLAUDE_CONFIG_DIR, default ~/.claude)
Codeword overridesNot managed hereprompts/<mode>.md under the project and global manager dirs: listed by status, kept by uninstall and purge

<cwd> is CLAUDE_PROJECT_DIR, else the git top level. Defaults: hard: false, level: "balanced", mode: "full". Wall enforcement reads project state only; --scope global is ignored. The project .claude/ is a protected path, so the skill writes through bundled Node helpers via Bash.

Free text resolves to a command (Russian too; ambiguity triggers AskUserQuestion):

PhraseResolves to
install manager, install the wallinstall
update the guardupgrade
enable manager, manager on, arm wallenable
turn off manager, manager off, disarm walldisable
remove hook, uninstalluninstall
reset, restore defaults, remove everythingpurge
level strict, strict mode, level balanced, balanced modelevel <name>
manager statusstatus
<task> in hard modehard-one-shot: confirm, arm, run, auto-disarm (even on failure)
<task> as managermanager-run: Manager role, wall untouched; the full contract is the mod’s ++m block
Expected status output (wall off) #
# Manager -- status

## Codewords
codewords: provided by brewmod-placeholders (Claude Code 2.1.301+) -- ++m, ++a, ++rr, ++r, +++.
Install:   claude plugin install brewmod-placeholders@claude-brewcode
Overrides: <legacy override paths, one per line, or "none found">

## HARD wall (this project) -- registered=no  armed=OFF  level=balanced  (state source: default)
State version: <none>  plugin: <X.Y.Z>

## Task graph (TaskCreate/TaskUpdate/TaskGet/TaskList) -- <ON|OFF|UNKNOWN>

Exit:      node <ABS project root>/.claude/brewtools/manager/manager-state.mjs set hard=false

Prompt placeholders

The brewmod-placeholders mod: ++m / ++rr / ++r / ++a / +++ codewords and /placeholders.

Task Board Setup

Domain methodology, work plans and session anti-drift timers.

Setup Status

Dashboard across every -setup skill; upgrade brings the stale ones current.

Brewtools overview

Every brewtools skill and agent.

Update: /brewtools:plugin-update, /reload-plugins, then /brewcode:setup-status upgrade - FAQ