By carlet0n
Token-efficient multi-agent workflows for Claude Code. Compresses agent-to-agent channels: compact subagents with minimal tool whitelists, tool-output compression, and measurement hooks. Inspired by caveman, but for the orchestrator-to-subagent channel where prose is wasted.
Focused code-change agent. Makes specific edits in specific files per caller's plan. Not for research or design — caller must hand over exact paths + what to change.
Codebase exploration agent. Finds files, traces symbols, answers "where/how does X work" questions. Read-only — cannot edit. Use instead of general-purpose when the question is about code in this repo.
Web + docs research agent. Terse reports. No code changes. Use when you need facts from the web, Anthropic docs, or prior art — not codebase exploration (use grunt-explorer for that).
Use when spawning subagents, delegating research, or calling WebFetch. Picks the right specialized subagent over general-purpose, and forces tight extraction prompts on web fetches. Triggers on "multi-agent workflow", "delegate", "spawn subagent", "research this", "fetch", "summarize this URL", "look up".
Invoke before spawning subagents, or have subagents invoke before returning their final report. Forces caveman-style compact output for agent↔agent handoffs to cut tokens on inter-agent channel. Use when orchestrating multi-agent workflows, delegating research tasks, or when a subagent is about to summarize findings back to the caller.
Matches all tools
Hooks run on every tool call, not just specific ones
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Runs pre-commands
Contains inline bash commands via ! syntax
Runs pre-commands
Contains inline bash commands via ! syntax
Bash prerequisite issue
Uses bash pre-commands but Bash not in allowed tools
Bash prerequisite issue
Uses bash pre-commands but Bash not in allowed tools
Token-efficient multi-agent workflows for Claude Code.
Agent Caveman reduces token spend on the orchestrator-to-subagent channel that multi-agent workflows consume invisibly.
Multi-agent workflows in Claude Code (subagents spawned via Agent/Task) incur three token costs that compound quickly:
Agent Caveman addresses each at the source: subagent definitions with minimal tool whitelists, a strict output contract in each subagent's system prompt, and a skill that routes the lead agent to the appropriate specialist and enforces tight WebFetch prompts. A PreToolUse hook rewrites loose WebFetch and Agent prompts before execution, appending extraction discipline when the prompt lacks it. A PostToolUse hook trims bloated GitHub MCP responses. Measurement hooks record per-call cost to local JSONL so the effect is auditable.
Built-in tool output is not rewritten: Claude Code's hook contract permits mutation only of MCP responses (updatedMCPToolOutput). Savings on built-in tools come from generating less in the first place.
claude plugin marketplace add carlet0n/agent_caveman
claude plugin install agent-caveman@agent-caveman
No configuration. The grunt-* subagents become available to the orchestrator, hooks register automatically, and prompt rewriting is on by default (set GRUNT_REWRITE=off to disable).
git clone https://github.com/carlet0n/agent_caveman.git
cd agent_caveman
claude --plugin-dir ./agent-caveman
The system operates on four automatic layers.
1. Specialized subagents. Three focused alternatives to general-purpose:
| Agent | Role | Tools |
|---|---|---|
grunt-researcher | Web + docs research | WebFetch, WebSearch, Read, Grep, Glob |
grunt-explorer | Read-only codebase survey | Read, Grep, Glob, Bash (inspection only) |
grunt-coder | Execute scoped code edits | Read, Edit, Write, Bash, Grep, Glob |
Each subagent declares a RESULT / FINDINGS / FILES / NEXT output contract in its system prompt. The tool whitelists reduce the schema payload: Claude Code does not ship descriptions for tools the subagent cannot invoke.
2. Orchestrator and subagent skills.
grunt-orchestrator — activates when the lead agent spawns a subagent or calls WebFetch. Supplies a task-to-subagent routing table and extraction-prompt patterns.grunt-terse — invoked by a subagent before returning its final report to enforce the RESULT / FINDINGS / NEXT format.3. Prompt rewriter. A PreToolUse hook appends an extraction contract to WebFetch and Agent/Task prompts that lack one. Each rewrite is recorded to .grunt/rewrites.jsonl with the full before/after.
4. Measurement. A PreToolUse/PostToolUse pair writes one JSONL record per tool call to .grunt/metrics.jsonl within the active project. In-session report:
/agent-caveman:grunt-stats
Or run the underlying script directly:
python3 "$CLAUDE_PLUGIN_ROOT/hooks/grunt_report.py"
Sample output:
sessions rows: 194 total in≈14571 tok out≈236823 tok
tool calls in_tok out_tok avg_out
WebFetch 28 1009 200843 7172
Edit 11 3317 20071 1824
Agent 9 2428 2285 253
Bash 17 1449 1805 106
subagent return cost (tok per call):
general-purpose n=4 avg=432 max=679
claude-code-guide n=4 avg=308 max=374
noisy Bash (>1000 tok out):
2341 tok find . -name "*.py"
full-file Reads (>2000 tok, no offset/limit):
4621 tok /path/to/big_file.txt
repeated Reads (≥3× same file):
n= 3 /path/to/README.md
oversized subagent returns (>500 tok):
679 tok general-purpose Build grunt-orchestrator skill
prompt rewrites applied: 2
WebFetch n=1
Agent n=1
Filter by session with --session <id>. Token counts are len(s)//4 estimates intended for cross-session comparison, not billing reconciliation.
agent-caveman/agents/*.md defines each subagent with a tools: frontmatter whitelist enforced by Claude Code. The subagent's system context carries schemas only for tools it can invoke.
Each subagent's system prompt enforces a compact report format:
npx claudepluginhub carlet0n/agent_caveman --plugin agent-cavemanSub-agent runner — runs agent definitions on Codex, Claude Code, Cursor CLI, or Gemini CLI from any host AI tool.
Multi-agent collaboration plugin for Claude Code. Spawn N parallel subagents that compete on code optimization, content drafts, research approaches, or any problem that benefits from diverse solutions. Evaluate by metric or LLM judge, merge the winner. 7 slash commands, agent templates, git DAG orchestration, message board coordination.
This skill should be used when the model's ROLE_TYPE is orchestrator and needs to delegate tasks to specialist sub-agents. Provides scientific delegation framework ensuring world-building context (WHERE, WHAT, WHY) while preserving agent autonomy in implementation decisions (HOW). Use when planning task delegation, structuring sub-agent prompts, or coordinating multi-agent workflows.
Repowire mesh usage skills for AI coding agents: cross-agent review and planning, delegate, usage patterns, and install/update. Backend-agnostic and parameterised on the agent you choose.
Multi-agent orchestration framework for Claude Code. Routes tasks to specialized Haiku/Sonnet subagents while Opus orchestrates — inspired by speculative decoding. Includes 10 specialized heads, environment preflight checks, and ~50% API cost reduction.
Claude Code の SubAgent(agents/*.md)を正しく定義するためのベストプラクティスガイド。 YAML frontmatter、ツール選択、3-Phase 構造、コンテキスト受け渡し、アンチパターンを網羅。 Use when: agents/*.md を書く、SubAgent 定義を改善する、エージェントの動作が想定外、 コンテキストが渡らない、ツール選択に迷う。 Triggers: "subagent", "agent definition", "agents/*.md", "エージェント定義", "サブエージェント", "3-Phase", "context passing", "コンテキスト渡し", "tool selection", "ツール選択", "subagent_type", "bypassPermissions"