Describe the bug
codegraph_explore's cross-call dedup replaces already-served source with an "Already sent earlier in this conversation … Use it from your context; do NOT Read this file" pointer. The already-sent record is kept per MCP connection, but one connection is not always one agent context:
- Subagents (Claude Code): subagents dispatch tool calls over the parent's MCP connection. A fresh subagent exploring a file the parent already received gets the pointer instead of the source — wrong on both counts: the source is not in its context, and it's told not to Read the file. There is no in-tool recovery; re-querying hits the same suppression, so the subagent falls back to Read/grep (or worse, answers without the source).
- Compaction: after the host compacts the conversation, the context no longer holds the already-sent source, but the server's record still does — subsequent explores return pointers to text that is gone until the connection restarts.
Reproduction
- In Claude Code, run any
codegraph_explore that returns a file's source.
- Spawn a subagent (Task tool) and have it explore the same symbols.
- The subagent's very first explore returns
> **Already sent earlier in this conversation:** … Do NOT Read this file.
Compaction variant: explore, /compact, explore the same symbols again — same pointer, source no longer in context.
Why it matters
The pointer is designed to be trusted ("that copy is still exact"). When it points at source the current context never had, the agent either reads the file anyway (defeating dedup and teaching it to distrust codegraph) or proceeds without source it believes it has.
Codex is unaffected on the subagent side (each thread gets its own MCP server process), but the compaction case applies to every host whose connection outlives a compact.
Describe the bug
codegraph_explore's cross-call dedup replaces already-served source with an "Already sent earlier in this conversation … Use it from your context; do NOT Read this file" pointer. The already-sent record is kept per MCP connection, but one connection is not always one agent context:Reproduction
codegraph_explorethat returns a file's source.> **Already sent earlier in this conversation:** … Do NOT Read this file.Compaction variant: explore,
/compact, explore the same symbols again — same pointer, source no longer in context.Why it matters
The pointer is designed to be trusted ("that copy is still exact"). When it points at source the current context never had, the agent either reads the file anyway (defeating dedup and teaching it to distrust codegraph) or proceeds without source it believes it has.
Codex is unaffected on the subagent side (each thread gets its own MCP server process), but the compaction case applies to every host whose connection outlives a compact.