Skip to content

hooks: pre-search directive only names what this search is for, once per session - #1753

Merged
swapnilpaliwal-sd merged 1 commit into
0.1.8from
loop/to-p0-presearch-hint-noise
Sep 29, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
0.1.8from
loop/to-p0-presearch-hint-noise

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

The PreToolUse directive (hooks/direct.py) printed the same generic text before the first Read, Grep or Bash. It was repeated per repository, or before every search when .axiomcode/ was read-only, and agents rarely acted on it.

  • Speaks only before a search whose pattern names a class or callable that the graph declares in ≤5 places. It names that declaration and its file:line, and gives the impact call for it.
  • Stays silent for prose words, constants, fields, piped greps (… | grep), non-source files, Reads and Globs.
  • Said once per session: the stamp lives in the temp directory and is keyed by session, or by cwd when the host sends no session id.
  • Tests: tests/directive.py has 24 promises, including controls: TODO/prose, field, lowercase word, string inside code, a name declared 8 times, piped grep. hosts.py, mcp_first.py (43/43) and hooks_from_path.py (26/26) pass on the VM.
  • Replay of past loop sessions, old vs new: numbers in the comment below.

…n the search names a declaration

The generic block before the first Read, Grep or Bash was rarely acted on, and
was said again per repository, or before every search where .axiomcode/ was not
writable. It now names the declaration the grep pattern spells, where it is and
the impact call for it; stays silent for prose, constants, fields, names
declared in many places, piped greps and Reads; and is stamped once per session
in the temp directory.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit db22230 into 0.1.8 Sep 29, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the loop/to-p0-presearch-hint-noise branch September 29, 2026 03:50
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