Skip to content

fix(claude-plugin): restrict docs-researcher to Context7 tools#2795

Open
fahreddinozcan wants to merge 1 commit into
masterfrom
fix/docs-researcher-tools-allowlist
Open

fix(claude-plugin): restrict docs-researcher to Context7 tools#2795
fahreddinozcan wants to merge 1 commit into
masterfrom
fix/docs-researcher-tools-allowlist

Conversation

@fahreddinozcan

@fahreddinozcan fahreddinozcan commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Adds a tools: allowlist to the bundled docs-researcher Claude Code agent so it can only call the two Context7 MCP tools.

  • Without tools:, the agent inherits the full main-thread toolset, including the Agent/Task tool, allowing recursive subagent spawning (observed in [Bug]: (Claude Code) docs-researcher inherits the Agent tool and recursively spawned 100+ subagents — the run never terminated #2790 climbing past 100 agents with no self-termination).
  • Restricting the allowlist removes Agent/Task (plus unnecessary Bash/Write/Edit), making recursive spawning structurally impossible.
  • Both identifier forms are listed: plugin MCP tools resolve as mcp__plugin_<plugin>_<server>__<tool> on a marketplace install, but as mcp__<server>__<tool> when loaded via --plugin-dir. Unmatched entries are harmless no-ops, so listing both keeps the agent working under either load path.

Verified: with the allowlist, a spawned docs-researcher no longer has the Agent/Task tool and loads without error under both load paths; without it, the agent reports Agent in its toolset.

Fixes #2790

Without a tools allowlist the agent inherits the full main-thread
toolset, including the Agent/Task tool, so it can recursively spawn
subagents (observed in #2790 climbing past 100 with no self-termination).

Restrict it to the two Context7 MCP tools, which removes Agent/Task and
makes recursive spawning structurally impossible. Both identifier forms
are listed: plugin MCP tools resolve as mcp__plugin_<plugin>_<server>__<tool>
on a marketplace install but mcp__<server>__<tool> when loaded via
--plugin-dir; unmatched entries are harmless no-ops, so listing both keeps
the agent working under either load path.

Fixes #2790
@fahreddinozcan fahreddinozcan force-pushed the fix/docs-researcher-tools-allowlist branch from 36ad0c1 to c15b860 Compare June 18, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: (Claude Code) docs-researcher inherits the Agent tool and recursively spawned 100+ subagents — the run never terminated

2 participants