Prompt Injection
hookTip
Type a short codeword — ++mp, ++m, ++rr, or ++r — anywhere in your message. A UserPromptSubmit hook intercepts the message before the model sees it and appends the matching operating contract as a hidden system-reminder. You see only what you typed; the model receives your text plus the full contract for that one turn.
The injection point
+---------------------------+
| You type: |
| "++m fix the login bug" |
+---------------------------+
|
v
+----------------------------------+
| UserPromptSubmit hook fires |
| (manager-prompt.mjs) |
| - detects "++m" codeword |
| - resolves prompt text |
| - emits additionalContext |
+----------------------------------+
|
v
+---------------------------------------------+
| Model receives: |
| [system-reminder header line] |
| [full Manager operating contract] |
| [your original text: fix the login bug] |
+---------------------------------------------+
What you type vs what the model receives
++m fix the login bug >> system-reminder (additionalContext) <<
User typed ++m -- Manager mode is active for this turn:
[ full Manager operating contract: decompose -> build TaskGraph
-> delegate to expert agents -> integrate; never hand-implement ]
fix the login bug The injected block is a system-reminder — invisible in the user’s transcript but fully part of the model’s context for that turn.
How it works
- You include a codeword anywhere in your message
The codeword can appear at the start, middle, or end. Your surrounding text is preserved unchanged. No special formatting is required.
- The UserPromptSubmit hook fires before the model
manager-prompt.mjsruns on every user message. It tests codewords longest-prefix first:++mp→++m→++rr→++r, to avoid prefix collisions. The review codewords (++rr,++r) are codeword-only — there is no ambient HARD-wall equivalent for review mode. If no codeword is found (and the HARD wall is off), the hook exits immediately — zero file I/O, zero overhead. - The hook resolves the prompt text
Three-level fallback: project override (
.claude/brewtools/manager/prompts/<mode>.md) -> global override (~/.claude/manager/prompts/<mode>.md) -> plugin default (references/<mode>.md). Project and global overrides survive plugin updates because they live outside the plugin cache. - The resolved text is emitted via additionalContext
The model receives a system-reminder containing a header line plus the full prompt block, followed by your original message. The contract applies for that turn only — the next message starts clean unless you type a codeword again.
Codewords and injected prompts
| Trigger | Means | When it fires | What gets injected |
|---|---|---|---|
++mp | Manager for Plan | any message containing it (checked first) | full Manager block + Plan Mode addon (TaskGraph in English, parallel indicators) |
++m | Manager | any message containing it (checked after ++mp) | full Manager block — delegate-everything orchestrator contract |
++rr | Regression Review | any message containing it (checked after ++m) | anti-regression review discipline — review each significant phase for NO regression + project standard + correctness; two-phase review->double-check->fix; final cross-review at task end |
++r | Review | any message containing it (checked last; ++rr tested first) | two-phase review discipline — multi-agent review after each significant change, review->double-check->fix; codeword-only, no ambient |
| HARD wall ON | (state) | every turn, no codeword required | full Manager block (ambient injection alongside any codeword) |
The prompt text is editable and update-proof. Use /brewtools:manager edit to copy the plugin default into a writable project or global override, and /brewtools:manager reset to revert to the plugin default.
Where this is used
The /brewtools:manager skill is the control plane for the entire mechanism. It lets you inspect the current effective prompt source (status), customize the Manager or Plan Mode text (edit/reset), arm the HARD delegation wall (on/off), and run one-shot manager tasks (inline-run, hard-one-shot, manager-run).
The codeword hook itself (manager-prompt.mjs) is always on — it cannot be toggled by the skill. The skill manages text and state; the hook fires unconditionally on every turn.
Manager skill
The control plane for these prompts — customize text, arm the HARD wall, check status, and run manager-mode tasks.
Brewtools overview
All brewtools skills and agents in one place.
Hook source
The UserPromptSubmit hook that performs the injection on every turn.
Updating plugins
/brewtools:plugin-update to check and update the brewcode plugin suite in one command.
See the FAQ for details.