From 06cb5b86ff96ed3540299c78e45f65edbfc0cf59 Mon Sep 17 00:00:00 2001 From: Oleks Date: Wed, 29 Jul 2026 21:50:18 +0300 Subject: [PATCH] offload-analyst: stop recursively re-delegating the whole audit to itself MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commands/offload-audit.md tells a heavy-target caller to hand the work to Agent(offload-analyst). Nothing told the analyst it IS that delegation target, so on a large plugin it re-judged the target heavy by the same criteria and spawned another offload-analyst instance, which did the same again — observed live against the cluster plugin (11 agents, ~27 skills), 3-4 levels deep, each restarting the same early measurement steps with no forward progress. Fixed by making the analyst explicit that its only Agent calls are the fixed filing chain, and scoping the command's delegation guidance to the top level only. --- .claude-plugin/plugin.json | 2 +- agents/offload-analyst.md | 13 +++++++++++++ commands/offload-audit.md | 6 +++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index cd5354b..b67cd2f 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "inference-arbitrage", - "version": "0.4.0", + "version": "0.4.1", "description": "Audits a Claude Code plugin's definitions and usage transcripts to find steps that should be a deterministic script instead of raw LLM inference, and files the well-evidenced ones as issues on the target repo.", "author": { "name": "oleks" diff --git a/agents/offload-analyst.md b/agents/offload-analyst.md index 37373af..d7d8ddc 100644 --- a/agents/offload-analyst.md +++ b/agents/offload-analyst.md @@ -31,6 +31,19 @@ ${CLAUDE_PLUGIN_ROOT}/bin/offload-scan --plugin --days N --json # dynami ## What you never do +- **You are the delegation target — never re-delegate the whole audit.** If you + were spawned via `Agent(subagent_type="inference-arbitrage:offload-analyst")` + because a caller judged the target heavy, that call already happened. Reading + a large target's inventory/scan output, or the `offload-audit` skill's own + "for a heavy target, hand the work to `Agent(offload-analyst)`" line, is not a + reason to spawn another instance of yourself — that line describes what a + *caller* does before reaching you, not what you do once you are the one doing + the work. The only `Agent` calls you ever make are the fixed filing chain + (`Agent(anxious:issuer-agent)` → `cluster:gitea-agent`, §7 below) — never + another `offload-analyst`, and never another `offload-audit` skill invocation + once you have already loaded it once. A target being large (many skills or + agents) is a reason to work through it methodically, not a reason to hand it + to a fresh copy of yourself with no memory of what you've already measured. - **Never edit the plugin you audit.** Read-only, always. This separation is what preserves your ability to conclude "no offload here" — an auditor that writes the code it recommends cannot credibly decline to recommend. diff --git a/commands/offload-audit.md b/commands/offload-audit.md index 6d49101..2d525ee 100644 --- a/commands/offload-audit.md +++ b/commands/offload-audit.md @@ -18,7 +18,11 @@ Run the full audit on **$ARGUMENTS**. previous window, FR-4.5) and the marker search. For a heavy target, or when the report should not consume this session's context, hand the work to `Agent(subagent_type="inference-arbitrage:offload-analyst")` instead — one - agent for the whole audit, never one per skill (spec §7). + agent for the whole audit, never one per skill (spec §7). **This delegation + happens at most once, from this top-level command to the analyst.** The + analyst instance you spawn is the delegation target, not another decision + point — it never re-delegates the whole audit to a further `offload-analyst` + instance, however large the target looks from inside. Filing is implicit: a candidate that clears the rubric gate and the value threshold is filed without asking. Everything below the gate is reported as a