You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Subagents don't receive the codebase-memory-mcp code-discovery reminder #631
The installer registers a SessionStart reminder hook for Claude Code (matchers startup/resume/clear/compact) that tells the agent to prefer codebase-memory-mcp tools (search_graph, trace_path, get_code_snippet, …) over grep/file-read for code discovery.
But subagents spawned via the Agent tool do not fire SessionStart — only SubagentStart/SubagentStop fire for them. So every subagent starts CMM-unaware and falls back to grep/file-read, exactly the behavior the SessionStart reminder exists to prevent. On agents that lean on subagents for exploration, much of the code navigation happens in precisely the contexts the reminder never reaches.
Proposal
Register a Claude Code SubagentStart hook (matcher *, all agent types) that injects a leaner variant of the same code-discovery guidance via hookSpecificOutput.additionalContext. Leaner = it omits the "run index_repository first" step, since the parent session has already indexed the project.
Notes:
SubagentStart injects context only via a JSON object on stdout (not the plain-text form SessionStart accepts), so the generated hook script emits a static JSON literal — no runtime escaping, no python3/jq dependency.
SubagentStart is Claude-Code-specific (added in Claude Code 2.0.43, command-type hooks only). It belongs in the Claude installer path only; Codex/Gemini/etc. have no equivalent subagent-start event. The guidance text stays tool-neutral, so the agent-agnostic boundary is preserved (only the plumbing is Claude-specific).
Advisory, non-blocking. Older Claude Code (< 2.0.43) simply ignores the unknown event key (fail-open).
Scope
Small, self-contained: a sibling to the existing SessionStart reminder in the Claude installer, plus a unit test (~80 LOC).
Thanks. I’ve accepted this as an editor integration enhancement and linked it under #395. The right shape is Claude-specific SubagentStart plumbing with tool-neutral guidance and fail-open behavior for older clients.
Activity
DeusData commentedon Jun 29, 2026
Thanks. I’ve accepted this as an editor integration enhancement and linked it under #395. The right shape is Claude-specific
SubagentStartplumbing with tool-neutral guidance and fail-open behavior for older clients.