Repository navigation
feat(hooks): name the graph follow-up tools in every search augmentation - #2714
Merged
Merged
Conversation
When an agent greps for a symbol that the graph knows, the PreToolUse augmentation (Grep, Glob and Bash searches) lists the matching symbols. It now closes with one line that is cbm's own statement, outside the untrusted symbol block, naming the graph tools for the usual next question: [codebase-memory] For these symbols, trace_path lists callers and callees, get_code_snippet returns the exact source, and search_graph finds related symbols by name. The line carries no repository-derived value and is stated as facts, as Claude Code asks of hook context. It is appended at the string's real end into reserved room: the list loop's offset can run past its cap when a row is truncated, so appending at that offset could have written past the buffer. Searches without a hit, errors and non-search events are unchanged. Refs #509 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
When an agent greps, globs or runs a shell search for a symbol the graph knows, the PreToolUse augmentation lists the matching symbols. It now closes with one line naming the graph tools for the usual next question:
Proof on real output
Isolated cache, one-file repo, warm daemon, default deadline:
create_stripe_checkoutrg -n create_stripe_checkout .Tests
cli_hook_augment_context_names_graph_follow_ups. It checks that the line follows the symbol list and contains no repository value.src/cli/hook_augment.c, exactly this test fails (follow is NULL); with the change, it passes.cli363 passed / 0 failed,daemon_application74 / 0,agent_clients38 / 0.Refs #509