Skip to content

install: SubagentStart reminder points agents without MCP tools at tools they don't have #2837

Closed

Description

@halindrome

Summary

The SubagentStart context tells every subagent to use search_graph / trace_path / get_code_snippet. Many agent types are defined with an explicit tool list that has no MCP tools (e.g. tools: Read, Grep, Glob, Bash). Those agents can still use the graph through codebase-memory-mcp cli <tool>, but the reminder never says so, so they either ignore it or try tools they don't have.

Details

The installed SubagentStart hook uses matcher "*" (src/cli/cli.c:6320-6365, cbm_upsert_claude_subagent_hooks_with_binary). Claude Code's SubagentStart input carries agent_type and agent_id but not the agent's tool list, and hook_augment.c:1642 already reads agent_type (only to choose a tier). Proposed fix (PR to follow): since the hook can't know the tool list, add one sentence to the Subagent context: when the mcp__codebase-memory-mcp__* tools are not available, run the same tools through codebase-memory-mcp cli <tool> --help / cli <tool> --flag value. That works for every agent type with no detection.

Alternatives considered: (a) settings only: SubagentStart matchers are JS regexes, so the installer could write a negative lookahead such as ^(?!statusline-setup$|claude-code-guide$).* instead of "*". Fuller option: in the hook, resolve agent_type to its definition (.claude/agents/*.md, ~/.claude/agents/*.md) and, when its tools: frontmatter is an explicit list without mcp__codebase-memory-mcp__*, emit CLI-form guidance (codebase-memory-mcp cli search_graph …) instead of MCP tool names. Built-in types with restricted tools (e.g. statusline-setup) can be a small static skip-list.


Investigated and written by Claude Opus 5.5 (Anthropic) in Claude Code, at the request of @halindrome.

Activity

  1. DeusData commented on Oct 31, 2026

    @DeusData
    Owner

    Fixed on main by #2839 (merge commit 85a38ed): the SubagentStart hook context now tells subagents that the codebase-memory tools are also available from the shell via codebase-memory-mcp cli <tool> --help, so subagents without MCP tools have a working route to the graph. Thank you, Shane, for the report and the fix!

  2. added a commit that references this issue on Oct 31, 2026
    7f2fd10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    editor/integrationEditor compatibility and CLI integrationparsing/qualityGraph extraction bugs, false positives, missing edges

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions