Skip to content

Re-tighten subagent tools: allowlists once anthropics/claude-code#52004 is resolved #652

@tmchow

Description

@tmchow

Context

Custom plugin subagents in Claude Code 2.1.117+ do not receive the Grep or Glob tools in their runtime function schema — regardless of whether the agent frontmatter sets tools: explicitly or omits the field. This is an upstream bug, tracked at anthropics/claude-code#52004. Duplicate filed at #52055 was closed in favor of it.

Workaround applied in this repo

Two subagents whose documented methodology depends on content search were becoming non-functional under the bug:

  • plugins/compound-engineering/agents/ce-learnings-researcher.agent.md
  • plugins/compound-engineering/agents/ce-spec-flow-analyzer.agent.md

To keep them working, Bash was added to their tools: allowlists so they can fall back to rg / find via shell. The body prompts were updated to document this fallback. Grep, Glob remain listed in tools: as documented intent — they register as no-ops today but will start working automatically once the upstream bug ships.

The other 5 agents in this branch (ce-best-practices-researcher, ce-framework-docs-researcher, ce-git-history-analyzer, ce-issue-intelligence-analyst, ce-repo-research-analyst) already had Bash for other reasons, so no workaround was needed — they still register Read, Bash, WebFetch, WebSearch, mcp__* correctly; only Grep, Glob silently drop out.

What to do when the upstream fix lands

  1. Verify with a new Claude Code release that Grep / Glob are actually registering on custom subagents (probe one via a diagnostic prompt — see the PR discussion for the pattern, or just call Glob from the subagent and confirm no "No such tool available" error).
  2. Remove Bash from the tools: field of ce-learnings-researcher if no other part of its body has come to depend on Bash in the meantime. Same check for ce-spec-flow-analyzer.
  3. Revert the fallback wording in the body prompts (remove "if Grep isn't in your schema, fall back to Bash rg" style guidance) so the agents return to the clean, tool-specific methodology they were designed around.
  4. Re-run the 7-agent diagnostic to confirm all 7 have the intended tool set and no regressions.

Links

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions