Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add kochetkov-ma/claude-brewcode/plugin install brewtoolsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/agent-return-setup)<a href="https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/agent-return-setup"><img src="https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/agent-return-setup/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/agent-return-setup"><img src="https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/agent-return-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00057 | $0.10785 |
| Opus 5.5 | $0.00023 | $0.04314 |
| Sonnet 5.5 | $0.00011 | $0.02157 |
| Haiku 4.5 | $0.00006 | $0.01078 |
Grade B, and why
agent-return-setup scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
> Current state: agent-return is not installed anywhere. Plan: copy the 3 hook files into `<repo>/.claude/hooks/`, write `<repo>/.claude/agent-return.json`, and merge three entries into `<repo>/.claude/settings.json` (Su How it starts
The opening of the file, as written. The whole thing — 478 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Return
Installer for a size budget on every subagent's final report. Three hook files (SubagentStart contract, return guard, shared module) and a JSON config hold all runtime behavior; this skill only decides mode, scope and the two thresholds, then a
brewcode:hook-creatoragent does the file work by the runbook.
Subagent reports are the largest context cost of a delegating session, and a prose rule loses to whatever the agent just did. So the budget is stated at spawn and enforced at return: the report is sized (chars/4) against two integers, no LLM judge.
Prompt contract
$ARGUMENTS is one free-form RU/EN prompt; mode tokens and flags (--unattended) may sit anywhere in it.
- Mode: strip
--unattendedfirst: a flag, never a mode, scope or name (Modes, Unattended). Then an explicit mode token wins outright; else the most distinct whole-word keyword hits (table in Step 2). Tie with a destructive mode (purge) or ofinstallwith a removal mode (uninstall) ->AskUserQuestion; withstatus->status; of two other mutating modes -> the keyword that comes first. No hit or empty ->status. - Scope: prose that is not a mode/id/path is still input: take the id, path or target from it.
- Ask: at most ONE
AskUserQuestion(max 4 questions) to resolve mode and scope, before any work, only when the answer changes what gets written. A read-only run asks nothing.--unattendedasks nothing: an open question there ends inRESULT skipped(Modes, Unattended).
Print once, before the first action (labels literal, values in the conversation language):
PLAN — brewtools:agent-return-setup
INPUT: <arguments verbatim, or "(empty)">
MODE: <resolved> — <explicit | matched keyword: X | default>
SCOPE: <resolved paths / target / level / flags>
DO: <2-5 imperative bullets>
RESULT: <what the user ends up holding>
What the hooks do (informational — skill does NOT implement)
| File | Registered on | Behavior |
|---|---|---|
agent-return-budget.mjs |
never — imported by the other two | config, thresholds, read-only list, estimateTokens, contract text |
agent-return-contract.mjs |
SubagentStart, no matcher | injects the budget as additionalContext; advisory. A readOnlyAgentTypes type gets the text without the write-to-file step |
agent-return-guard.mjs |
SubagentStop, no matcher | classic path: sizes last_assistant_message, challenges with decision:"block" |
| the same guard | PreToolUse, matcher SubagentHandback |
auto-mode path: sizes tool_input.message, challenges with permissionDecision:"deny" |
What ships with it
8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed · +22 lines b0692b3ce042
- 1mo ago Changed · +7 lines a89a042a1266
- 1mo ago Changed · +33 lines 42c609099cfd
- 2mo ago Changed · +17 lines 53cba5c1e978
- 3mo ago First seen · 399 lines · 57 tokens per session scan B b88e2aa78e40
agent-return-setup is a skill published in the GitHub repository kochetkov-ma/claude-brewcode (41 stars, last pushed yesterday), licensed MIT. It adds 57 tokens to every session and 10,785 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
agent-return-setup compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| agent-return-setupkochetkov-ma/claude-brewcode | Skill | 41 | yesterday | MIT | B | 57 | Claude Code |
| doc-digestegorfedorov/claude-context-optimizer | Skill | 137 | 7d ago | MIT | A | 75 | Claude Code |
| token-checkegorfedorov/claude-context-optimizer | Skill | 137 | 7d ago | MIT | A | 66 | Claude Code |
| sharpen-promptegorfedorov/claude-context-optimizer | Skill | 137 | 7d ago | MIT | A | 47 | Claude Code |
| skill-creator-plusyaniv-golan/skill-creator-plus | Skill | 8 | 19d ago | MIT | A | 147 | Claude Code |
| cpp-reinforcement-learningAznatkoiny/zAI-Skills | Skill | 10 | 23d ago | MIT | A | 131 | Claude Code |
| deep-researchyachi/claude-skills | Skill | 3 | 1mo ago | MIT | A | 164 | Claude Code |