claude-code - 💡(How to fix) Fix Custom plugin subagents never receive Grep/Glob in their tool schema [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#52055Fetched 2026-04-23 07:37:45
View on GitHub
Comments
1
Participants
2
Timeline
9
Reactions
0
Author
Timeline (top)
labeled ×5closed ×1commented ×1cross-referenced ×1

Custom plugin subagents in Claude Code never receive Grep or Glob in their runtime function schema — regardless of whether the agent's frontmatter sets a tools: allowlist, omits it entirely, lists the tools explicitly, or uses array-form YAML.

Built-in subagents (Explore, Plan) do have Grep/Glob and they work there normally.

This contradicts the tools reference (which lists both as "Permission Required: No" and says "The tool names are the exact strings you use in subagent tool lists") and the subagents doc (which shows tools: Read, Grep, Glob, Bash as a canonical example and states "Inherits all tools if omitted").

Error Message

  • Observed: Error: No such tool available: Glob

Root Cause

In my parent (main) session, Grep and Glob are also absent from the function schema and do not appear in the deferred-tools list returned by ToolSearch. The only way I can reach Glob this session is by dispatching the built-in Explore subagent. Unclear whether this is the same underlying filter or a separate quirk — flagging it in case it's the same root cause.

Fix Action

Fix / Workaround

  1. Install any plugin that declares a custom subagent. Spawn that subagent. Ask it to list its function schema.
    • Observed: Grep/Glob absent.
  2. Edit the agent frontmatter to include tools: Read, Grep, Glob, Bash. Restart and re-dispatch.
    • Observed: schema reports Read, Bash only. Grep/Glob still absent.
  3. Try YAML array form:
    tools:
      - Read
      - Grep
      - Glob
    • Observed: same — only Read in schema.
  4. Remove tools: entirely, relying on default inheritance.
    • Observed: schema contains Bash, Edit, Read, Skill, ToolSearch, Write. Grep/Glob still absent.
  5. In the same session, dispatch the built-in Explore subagent and ask it to call Glob.
    • Observed: works — Glob is in its schema and returns a file list.
  6. Emit a direct Glob call from a custom subagent:
    • Observed: Error: No such tool available: Glob

In my parent (main) session, Grep and Glob are also absent from the function schema and do not appear in the deferred-tools list returned by ToolSearch. The only way I can reach Glob this session is by dispatching the built-in Explore subagent. Unclear whether this is the same underlying filter or a separate quirk — flagging it in case it's the same root cause.

Plugins whose subagents rely on native content search to implement their documented methodology (e.g. a knowledge-base researcher that greps frontmatter before reading) are effectively non-functional. The workaround — also granting Bash and falling back to rg/find via shell — defeats the security-narrowing intent of the tools: allowlist and reintroduces the permission-prompt churn that the allowlist was meant to avoid.

Code Example

tools:
     - Read
     - Grep
     - Glob
RAW_BUFFERClick to expand / collapse

Summary

Custom plugin subagents in Claude Code never receive Grep or Glob in their runtime function schema — regardless of whether the agent's frontmatter sets a tools: allowlist, omits it entirely, lists the tools explicitly, or uses array-form YAML.

Built-in subagents (Explore, Plan) do have Grep/Glob and they work there normally.

This contradicts the tools reference (which lists both as "Permission Required: No" and says "The tool names are the exact strings you use in subagent tool lists") and the subagents doc (which shows tools: Read, Grep, Glob, Bash as a canonical example and states "Inherits all tools if omitted").

Environment

  • Claude Code: 2.1.117
  • macOS 26.3 (build 25D125)
  • Plugin loaded via claude --plugin-dir <path>

Repro

  1. Install any plugin that declares a custom subagent. Spawn that subagent. Ask it to list its function schema.
    • Observed: Grep/Glob absent.
  2. Edit the agent frontmatter to include tools: Read, Grep, Glob, Bash. Restart and re-dispatch.
    • Observed: schema reports Read, Bash only. Grep/Glob still absent.
  3. Try YAML array form:
    tools:
      - Read
      - Grep
      - Glob
    • Observed: same — only Read in schema.
  4. Remove tools: entirely, relying on default inheritance.
    • Observed: schema contains Bash, Edit, Read, Skill, ToolSearch, Write. Grep/Glob still absent.
  5. In the same session, dispatch the built-in Explore subagent and ask it to call Glob.
    • Observed: works — Glob is in its schema and returns a file list.
  6. Emit a direct Glob call from a custom subagent:
    • Observed: Error: No such tool available: Glob

Expected

Custom plugin subagents should have Grep and Glob available in the same way built-in subagents do — either via default inheritance (per the docs' Inherits all tools if omitted) or via explicit tools: allowlist.

Evidence across multiple subagents

All from the compound-engineering plugin, same session:

Subagenttools: frontmatterActually registered
ce-learnings-researcherRead, Grep, GlobRead
ce-learnings-researcher(no tools: field)Bash, Edit, Read, Skill, ToolSearch, Write
ce-git-history-analyzerRead, Grep, Glob, BashRead, Bash
ce-issue-intelligence-analystRead, Grep, Glob, Bash, mcp__github__*Read, Bash, mcp__github__*
ce-framework-docs-researcherRead, Grep, Glob, Bash, WebFetch, WebSearchRead, Bash, WebFetch, WebSearch
Explore (built-in)(built-in default)Includes Glob, Grep

Consistent: every non-Grep/Glob entry registers. Grep/Glob never register for custom subagents. Built-ins unaffected.

Main-session note

In my parent (main) session, Grep and Glob are also absent from the function schema and do not appear in the deferred-tools list returned by ToolSearch. The only way I can reach Glob this session is by dispatching the built-in Explore subagent. Unclear whether this is the same underlying filter or a separate quirk — flagging it in case it's the same root cause.

Impact

Plugins whose subagents rely on native content search to implement their documented methodology (e.g. a knowledge-base researcher that greps frontmatter before reading) are effectively non-functional. The workaround — also granting Bash and falling back to rg/find via shell — defeats the security-narrowing intent of the tools: allowlist and reintroduces the permission-prompt churn that the allowlist was meant to avoid.

Notes

  • YAML format tested: both CSV (tools: Read, Grep, Glob) and array form exhibit the same behavior.
  • Frontmatter bytes verified clean ASCII (no hidden chars, no BOM).
  • User settings.json has no disabledTools, disallowedTools, or deny rule that would suppress Grep/Glob.
  • The compound-engineering plugin does not declare anything that would restrict tools globally.

extent analysis

TL;DR

The issue can be resolved by investigating and potentially modifying the plugin loading or tool registration mechanism in Claude Code to ensure custom subagents inherit or are granted access to Grep and Glob tools as expected.

Guidance

  1. Review Plugin Loading: Investigate how custom plugins are loaded and how their tool access is configured. Ensure that the tools: allowlist in the frontmatter is correctly parsed and applied.
  2. Tool Registration: Examine the tool registration process for custom subagents. Verify that Grep and Glob are correctly registered and made available to these subagents.
  3. Compare with Built-in Subagents: Compare the tool registration and access mechanisms for built-in subagents (like Explore) with those for custom subagents to identify any discrepancies.
  4. Check for Overriding Configurations: Ensure there are no overriding configurations (e.g., in settings.json or elsewhere) that might be restricting access to Grep and Glob for custom subagents.

Example

No specific code example can be provided without more details on the plugin or Claude Code's internal mechanisms. However, the fix might involve modifying how tool access is configured in the plugin's frontmatter or how tools are registered within Claude Code.

Notes

The issue seems to stem from a discrepancy in how tool access is handled for custom versus built-in subagents. Resolving this will require a deeper understanding of Claude Code's internal mechanics and how plugins interact with these mechanics.

Recommendation

Apply a workaround by explicitly granting Grep and Glob access to custom subagents through their frontmatter or by adjusting the plugin loading mechanism, as this seems to be a specific issue with how these tools are registered or inherited by custom subagents.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Custom plugin subagents never receive Grep/Glob in their tool schema [1 comments, 2 participants]