Repository navigation
Description
This was generated by AI during attend-queue.
Summary
On Claude Code 2.1.258 (Windows, Git Bash), a hook if file rule never matches an absolute path outside the working directory. Every anchor form was probed (~/, //, drive letter, //**/, bare *.json), and each was skipped on a Write to the user-global settings file and on a Write to the managed-settings file, while the unconditioned row fired and returned ask for both. Only a settings file inside the working directory matched.
Correction (2026-09-30 probe, Claude Code 2.1.285, Windows; see the resolution comment): the path is not the cause. In a hook if, an Edit(...) rule does not match a Write tool call at any path; Write(...) and Edit(...) rules each match absolute paths outside cwd for their own tool.
Impact
Any hook that guards a user-global or managed file (the context-budget settings checkpoint is the case in this repo) cannot carry an if gate without silently dropping those checks. The hook-performance program left that row unconditioned and recorded the probe in plugins/context-budget/README.md and the program's DEVIATIONS log.
Evidence
Probe logs: hook-probe/logs/stub-userlocal.log and stub-managed.log under the session temp directory (2026-09-02). The permissions doc says //c/**/.env and //**/.env match anywhere on the drive or filesystem; the observed behaviour contradicts that for hook if rules specifically.
Ask
File upstream with a minimal reproduction (one PreToolUse hook with if: Edit(//**/settings.json) and a Write to ~/.claude/settings.json), then re-probe on each new Claude Code release; when it matches, the context-budget row can take the gate.
Split to #8985: the owner files the corrected report upstream, pastes the URL, and the per-release re-probe (owner decision 2026-10-01, option A). A one-line follow-up then adds the URL to both sections below.
Done when (this issue: the doc correction, which does not wait on the upstream URL)
Targets: plugins/context-budget/README.md (Hook section, the paragraph starting "The registration carries no if filter", around :149-158) and docs/conventions/hook-precision/README.md "Platform gap" section (around :92-108, including its Claim and Recheck bullets).
- Both sections name Claude Code 2.1.285 and Windows.
- Both sections state that an
Edit(...)rule in a hookifdoes not match a Write tool call, and thatWrite(...)andEdit(...)rules each match absolute paths outside cwd for their own tool. - Neither section still attributes the skip to the absolute path: the phrase "do not match an absolute path outside the working directory" is gone from both files. Check: the reviewer confirms it in the diff.
- The Recheck bullet names the tool-name gap and context-budget: file the corrected hook if tool-name report upstream and re-probe each release #8985.
- The context-budget row stays unconditioned. Splitting it into gated Write/Edit rows is out of scope (separate PR, needs its own probe). Check: the PR diff touches no
hooks.json. - A
.changes/context-budget/fragment exists, made withscripts/new-changelog-fragment.sh context-budget patch, andscripts/check-changelog-fragments.sh --checkpasses. - The PR's CI runs the markdown lint and it passes.
Activity
docs(hooks): prune the hook-performance-levers contract slice
kyle-sexton commentedon Sep 23, 2026
This was generated by AI during triage.
Human-gated. Open decision: file the repro upstream (anthropics/claude-code) and re-probe each release
docs(hook-precision): park Windows if-file absolute-path gap (#3680) (#…
kyle-sexton commentedon Sep 29, 2026
Reopened from the 2026-09-29 audit of the Cursor agent run. PR #4950 closed this as completed, but the issue's Ask was not done.
What was asked and what exists. The acceptance was a repro filed on
anthropics/claude-codeplus a re-probe on each Claude Code release. Neither exists. The only record is the probe inplugins/context-budget/README.md(Hook section: 2026-09-02, Claude Code 2.1.258, Windows Git Bash) and the note in the hook-precision convention.What the repo already holds, so nobody redoes it. The
Write|Edithook row stays unconditioned (noif), because every anchor form was skipped for an absolute path outside the working directory. The README Hook section holds the probe. Nothing more is needed in code.Operator steps. These need a Windows host and an
anthropics/claude-codeaccount, so an autonomous lane cannot do them. This staysneeds-human(operator action, not a decision).anthropics/claude-codeissues for "hook if Edit absolute path outside cwd Windows". If one exists, comment the repro there and go to step 3.Hookiffile rules never match an absolute path outside the working directory on Windows. Body:Write|Editandif: "Edit(//**/settings.json)"that appends a line to a log file, then a Write to~/.claude/settings.json. Expected: the hook fires. Actual: the rule is skipped in the hook log, while the same hook withoutiffires.~/,//, drive letter,//**/, bare*.json.//c/**/.envand//**/.envmatch anywhere.Fix PR #5267 refs this issue and does not close it. Closing needs step 3 done.
docs(conventions): point hook probes at their single record
fix(context-budget): setup passes the reported scope; audit docs and …
3 remaining items
kyle-sexton commentedon Oct 1, 2026
Owner decision (2026-10-01): approved the recommendation ("go with recommended", the owner's reply to the batch decision page that listed this question and its recommendation).
Question: should the corrected upstream report ("Hook
ifruleEdit(...)does not match Write tool calls") be filed on anthropics/claude-code?Chosen option A: the owner files the corrected draft (from the 2026-09-29 resolution comment) upstream from their own account. No Windows host is needed because the 2.1.285 probe already ran. The owner pastes the URL here.
Next: owner files and pastes the URL. An agent then opens one PR that corrects
plugins/context-budget/README.md(Hook section) and thedocs/conventions/hook-precision/README.md"Platform gap" section so the cause is tool-name matching, not path, adds the URL, and closes this issue. The optional split of theWrite|Editrow into gated rows goes in a separate PR. Stays open withneeds-human.melodic-automation-lanes commentedon Oct 24, 2026
Not admitted to the issue lane yet: open pull request #4950 is for it.
kyle-sexton commentedon Oct 24, 2026
Removed
admission-deferred, which the Issue Triage session added at 16:30Z to make this issue a wave-1 canary. #4950 parked this gap until an upstream Claude Code fix, so it is not lane work. Admission waited only because it read the merged #4950 as an open closing pull request, a defect fixed separately.melodic-automation-lanes commentedon Oct 29, 2026
This records a re-fire of an earlier refusal, not a new refusal. The lanes kill switch stopped run 40790190262, the work-resolve-issue run that
agent-readystarted, before it did any work; that run ended at 2026-10-29T01:31:17Z. work-unblock has now removed and addedagent-readyback to start a fresh run. A kill-switch refusal is no fault in this issue or the lanes, so it never counts against later re-fires; after limits.limit-stops-per-issue of them since a person last addedagent-readyor a run last reported, work-unblock waits longer before each one, up to 24 hours.