Skip to content

fix: SLM's Claude Code sub-agents get the memory tools they ask for - #330

Merged
varun369 merged 2 commits into
mainfrom
fix/agent-tool-names
Nov 20, 2026
Merged

varun369 merged 2 commits into
mainfrom
fix/agent-tool-names

Conversation

@varun369

Copy link
Copy Markdown
Member

What this changes

The four SLM sub-agents shipped in the Claude Code plugin (memory advisor, optimize advisor, governance advisor, loop runner) now receive SLM's memory tools. Before, they got only Read and Bash.

Why

Each agent's tools: line named SLM tools bare (recall, remember, slm_compress, ...). Claude Code resolves a sub-agent's tools by full name only: mcp__<server>__<tool> for a directly added MCP server, mcp__plugin_<plugin>_<server>__<tool> for a server bundled in a plugin (sub-agents, MCP). A bare name matches nothing, so the agents could not call the tools they were written around.

The fix is in the generator, not in plugin/ by hand:

  • plugin-src/agents/*.md stays host-neutral (bare names). Codex, Antigravity, Hermes and Copilot read it directly and are unchanged.
  • New scripts/agent-tool-names.mjs holds the spelling rules. scripts/build-plugin.mjs uses it to write both full names for every SLM tool into plugin/agents/ (mcp__superlocalmemory__<t> and mcp__plugin_superlocalmemory_superlocalmemory__<t>), so one file works for a plugin install and a direct MCP install. The plugin name comes from the manifest. Built-ins (Read, Bash) are untouched. Entries that do not resolve are ignored as long as one resolves.
  • muse-plugin/ and vscode-agent-plugin/ are built from plugin/, so their builders now convert back: Muse keeps only mcp__superlocalmemory__<t>, the VS Code plugin keeps the bare names. Their generated output is byte-for-byte what it was.
  • tests/test_packaging/test_what_we_ship_describes_what_we_built.py strips the SLM prefixes before checking that a declared tool exists, so a made-up name with a prefix still fails.

How it was tested

New tests/test_plugin/test_claude_agent_tool_names.py (7 tests): no bare SLM name in plugin/ or muse-plugin/ agents; every tool appears in both forms with prefixes derived from plugin.json and .mcp.json; built-ins unchanged; plugin-src stays bare; build-plugin.mjs --check in sync; the transforms are idempotent and round-trip.

  • With the four plugin/agents/*.md files reverted to main: 3 failed, 4 passed. With the fix restored: 7 passed.
  • pytest tests/test_plugin tests/test_plugin_src tests/test_packaging: 540 passed, 11 skipped.
  • node --test scripts/__tests__/*.mjs: 51 passed.
  • node scripts/build-all-plugins.mjs run; git status shows only plugin/agents/ changed among the generated trees.
  • claude plugin validate ./plugin: passed.
  • ruff check on the two test files: clean; scripts/check-no-internal-leaks.sh: clean.

Not covered: the skills' allowed-tools: lines also use bare names. They only pre-approve tools (they do not decide whether an agent can see them), so they are left for a separate change.

  • Bug fix (non-breaking)
  • Plugin copies regenerated (node scripts/build-all-plugins.mjs)

AI assistance

Written with Claude Code (Claude Opus 5.5). The behaviour was checked by running the builders and tests above.

🤖 Generated with Claude Code

varun369 and others added 2 commits November 20, 2026 14:55
The memory advisor, optimize advisor, governance advisor and loop runner
listed their SLM tools by short name (recall, remember, ...). Claude Code
matches an agent's tools by full name, so none of them matched and the
agents received only Read and Bash. Each tool is now listed under both
full names, so the agents work with the Claude Code plugin and with SLM
added as a plain MCP server. Other hosts keep the names they use today.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tests now require every SLM tool in the Muse agents to be exactly
mcp__superlocalmemory__<tool> and a tool the server really registers.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@varun369

Copy link
Copy Markdown
Member Author

Audit finding to fix to test (e69834c)

  • MINOR, Muse build accepted a broken tools line: tests now require every SLM entry in muse-plugin/agents/*.md to be exactly mcp__superlocalmemory__<tool>, with no nested prefix, and a tool registered in the MCP profiles. Tests: test_muse_agents_name_each_slm_tool_exactly_once_as_a_real_direct_tool, test_claude_plugin_tools_are_real_registered_tools_in_both_spellings.
  • Proof: with the previous Muse builder restored and muse-plugin rebuilt (output had mcp__superlocalmemory__mcp__plugin_...__recall), the first new test fails and the other 8 still pass; with the fix restored, 9 pass.
  • Checks: plugin, plugin_src and packaging suites 542 passed, 11 skipped; build-all-plugins --check in sync; node tests 51/51.

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.

1 participant