agent-return-setup

agent-return-setup is a skill for Claude Code from kochetkov-ma/claude-brewcode. It costs 57 tokens per session (10,785 once invoked), scanned B, original, MIT.

A skill for installing, configuring, or removing agent-return hooks, which limit the size of each subagent’s final response.

In plain words
What is it for?
Use it when setting up agent-return behavior or fixing problems with subagent return limits.
Why use it?
It helps control oversized subagent reports and configure the related response-size setting.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; mentions .claude-plugin.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the brewtools plugin — 9 skills, 3 agents shipped together

Good fit Use it when setting up agent-return behavior or fixing problems with subagent return limits.

Compare 6 skills from other repositories ↓
Install

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.

Claude Code
/plugin marketplace add kochetkov-ma/claude-brewcode
Claude Code
/plugin install brewtools

Made for: Claude Code.

Or install brewtools, the plugin that ships this one along with the rest of its 9 skills, 3 agents.

Wrote 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.

agentmods badge for agent-return-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/agent-return-setup/github.svg)](https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/agent-return-setup)
Your own site
<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.

agentmods 80×15 button for agent-return-setup

Your own site · 80×15
<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>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 10,785 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 1mo ago against content hash b0692b3ce042, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

The scan reads SKILL.md. This mod also ships 6 executable files (assets/agent-return-budget.mjs, assets/agent-return-contract.mjs, assets/agent-return-guard.mjs, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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
brewtools/skills/agent-return-setup/SKILL.md · 478 lines

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-creator agent 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.

  1. Mode: strip --unattended first: 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 of install with a removal mode (uninstall) -> AskUserQuestion; with status -> status; of two other mutating modes -> the keyword that comes first. No hit or empty -> status.
  2. Scope: prose that is not a mode/id/path is still input: take the id, path or target from it.
  3. 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. --unattended asks nothing: an open question there ends in RESULT 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"

Read the full file on GitHub · 478 lines

Files

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.

Changes

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.

  1. 1mo ago Changed · +22 lines b0692b3ce042
  2. 1mo ago Changed · +7 lines a89a042a1266
  3. 1mo ago Changed · +33 lines 42c609099cfd
  4. 2mo ago Changed · +17 lines 53cba5c1e978
  5. 3mo ago First seen · 399 lines · 57 tokens per session scan B b88e2aa78e40

Subscribe to this mod's changes

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.

Related

agent-return-setup compared with skills from other repositories

agent-return-setup next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
agent-return-setupkochetkov-ma/claude-brewcodeSkill41yesterdayMITB57Claude Code
doc-digestegorfedorov/claude-context-optimizerSkill1377d agoMITA75Claude Code
token-checkegorfedorov/claude-context-optimizerSkill1377d agoMITA66Claude Code
sharpen-promptegorfedorov/claude-context-optimizerSkill1377d agoMITA47Claude Code
skill-creator-plusyaniv-golan/skill-creator-plusSkill819d agoMITA147Claude Code
cpp-reinforcement-learningAznatkoiny/zAI-SkillsSkill1023d agoMITA131Claude Code
deep-researchyachi/claude-skillsSkill31mo agoMITA164Claude Code