Feature request: suppress skill_listing/agent_listing_delta for a subagent spawn whose declared tools don't include Skill/Agent
Summary
Every session — including narrowly-scoped, non-interactive -p spawns using a custom subagent whose frontmatter (tools:) declares a small, fixed tool set with no Skill or Agent tool — receives the full skill_listing and agent_listing_delta system-prompt attachments unconditionally. There's currently no way to suppress them for a spawn that structurally cannot act on either.
Context
I run Claude Code programmatically as part of an automated multi-role pipeline: a "classifier", "planner", "implementor", and "reviewer" role, each defined as a .claude/agents/*.md subagent with frontmatter restricting its tool set (e.g. the reviewer's frontmatter grants only Read, Bash, Grep, Glob — no Agent, no Skill).
Inspecting real session transcripts for each role, every single one receives, as pre-first-turn attachments:
skill_listing: the full skill/slash-command catalog (~25 entries in our project), ~4.4-4.5KB, byte-identical across every role regardless of whether that role's frontmatter grants theSkilltoolagent_listing_delta: the full subagent roster, ~2.5-3.1KB, present even for thereviewerrole whose frontmatter has noAgenttool at all — it cannot ever spawn another agent, yet still receives the full roster
Together these add ~1.9-2.3K tokens of fixed, unusable overhead per spawn. Across a pipeline with dozens of scoped subagent spawns per unit of work (our review phase alone fans out to ~9 spawns per review round), this compounds to a meaningful, structurally-unnecessary tax.
What I checked already
skillListingBudgetFraction/skillListingMaxDescChars/skillOverrides(settings.json) — these only truncate description text to fit a budget. Per Claude Code's own docs: "The listing always contains every skill name." They shrinkskill_listing, they don't eliminate it, and they don't touchagent_listing_deltaat all.- Subagent frontmatter's
tools:field — restricts what the spawn can invoke, but does not gate what catalog attachments get sent to it. --baremode — skips loading skills/agents from disk, but doesn't stop the model from being told what's available in the running session.
Feature request
A mechanism — CLI flag, settings.json key, or subagent frontmatter key — that suppresses skill_listing and/or agent_listing_delta entirely for a spawn whose own tool set doesn't include Skill/Agent. Concretely, either:
- Derive it automatically: if a subagent's frontmatter
tools:list omitsSkill, never sendskill_listing; if it omitsAgent, never sendagent_listing_delta. This would require no new configuration surface — it falls out of information already declared. - Or an explicit opt-out, e.g. a subagent frontmatter key (
suppressCatalogs: true) or a-pflag (--strict-tools) that a caller can set when it knows the spawn is single-purpose and non-interactive.
Option 1 seems like the more elegant fix since it can't drift out of sync with the tool set a subagent actually has.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗