Skip to content

feed: the agent searches untouched — no hook before or after a read or search - #1871

Merged
swapnilpaliwal-sd merged 2 commits into
apps/integration-0.1.9from
feed/directive-moves-post
Oct 9, 2026
Merged

swapnilpaliwal-sd merged 2 commits into
apps/integration-0.1.9from
feed/directive-moves-post

Conversation

@swapnilpaliwal-sd

@swapnilpaliwal-sd swapnilpaliwal-sd commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What

No hook speaks around the agent's own reads and searches any more. Both halves of the search feed are removed:

  • Before a search: the PreToolUse directive on Read / Grep / Glob / Bash (direct.py).
  • After a search or read: the PostToolUse block on Read / Grep / Glob / Bash / Edit (enrich.py), in the Claude and Gemini hooks files.

The agent searches and reads untouched; the graph answers when it is asked, through the MCP tools and the CLI.

Why

Measured offline before removing the post-search block: 111 real agent greps from 38 discovery tasks replayed through the hook, with grep graded on its full file list. The shipped block named no fix-site file the search had not already found, and a widened version named none either. On TypeScript and Python (issue-text patterns) it found one each, and one of those was a false lead. The fix-site files contain the word the agent grepped, so the search never misses them. The pre-search directive's own audit had found it acted on 0% of the time.

Kept

  • changes.py: a signature edit's blast radius before it lands, and every change reported on the next prompt. A body-only edit is now reported on the next prompt rather than right after the edit.
  • orient.py and refresh.py.

Tests

  • Deleted with their subjects: directive.py, enrich_budget.py, enrich_lines.py.
  • hook_languages.py: the C# abstract-test-base checks move to the tests verb.
  • hook_rebase.py: keeps the changed and pre-edit checks, and calls changed through the dispatcher (the trimmed front door no longer routes it, which had the suite failing 16 checks at the branch tip).
  • hooks_from_path.py: proves the path-to-graph lookup through changes.py.
  • hosts.py: drops its enrich cases.
  • mcp_first.py: pins that no PreToolUse hook is wired on search tools.
  • validate.py: checks the pre-edit block only.

The agent docs (AGENTS.md, rules, SKILL.md, README) no longer promise a block after a grep.

Verified locally

hook_rebase 8/8, hook_languages 7/7, hooks_from_path 12/12, hosts ok, mcp_first 24/24, validate.py on a case 5 facts / 0 wrong. Pre-existing on the base and unchanged here: mcp_docs (4) and surfaces (1) from the context tool, the SKILL.md copies drift, and one python_names placeholder check.

The plugin no longer speaks before a Read, Grep, Glob or Bash call.
What the graph adds around a search comes after it, from the grep's own
result (enrich.py's grep aid): only what the search missed — which
declaration each match reaches when several fit, the callers whose line
never spells the name, a declaration nothing in the code calls that the
runtime enters — and nothing when the grep was complete.

The pre-search directive asked the agent to come to the tools before it
had seen any output, and the evidence never favored that shape: the
feed audit found the generic form acted on 0% of the time, and the
depth ablation found injecting answers moves an agent where naming
tools does not. direct.py and its suite go; mcp_first pins that no
PreToolUse hook is wired on search tools; python_names keeps its
launcher checks on enrich.py (its failing placeholder check fails
identically on the base tip with direct.py restored — pre-existing,
environment-dependent, not this change).

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
enrich.py — the PostToolUse block after a Read, Grep, Glob or shell
command — is removed, the counterpart of the pre-search directive this
branch already removed. The agent searches and reads untouched; the
graph speaks when it is called, through the MCP tools and the CLI.

Measured offline before removing it: replaying 111 real agent greps
from 38 discovery tasks through the hook, grep graded on its full file
list, the shipped block named no fix-site file the search had not
already found, and a widened version named none either (TypeScript and
Python, issue-text patterns: one hit each, one of them a false lead).
The fix-site files contain the word the agent grepped, so a grep never
misses them.

Kept: changes.py (a signature edit's blast radius before it lands, and
every change reported on the next prompt), orient.py, refresh.py. A
body-only edit is now reported on the next prompt instead of right
after the edit.

Wiring: the Claude and Gemini hooks files drop enrich.py. Tests:
enrich_budget and enrich_lines go with it; hook_languages moves its
C# abstract-test-base checks to the `tests` verb; hook_rebase keeps the
`changed` and pre-edit checks (and calls `changed` through the
dispatcher, which the trimmed front door no longer routes);
hooks_from_path proves the path lookup through changes.py; hosts drops
its enrich cases; validate.py checks the pre-edit block only. The agent
docs no longer promise a block after a grep.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd swapnilpaliwal-sd changed the title feed: the search runs untouched — the pre-search directive is removed feed: the agent searches untouched — no hook before or after a read or search Oct 9, 2026
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 3652330 into apps/integration-0.1.9 Oct 9, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the feed/directive-moves-post branch October 9, 2026 19:48
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