Skip to content

fix(hooks): cover the PowerShell tool and skip searches the index cannot answer (v2.1.3) - #35

Merged
denfry merged 2 commits into
mainfrom
fix/hook-guard-scope
Nov 2, 2026
Merged

denfry merged 2 commits into
mainfrom
fix/hook-guard-scope

Conversation

@denfry

@denfry denfry commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Problem

  • The guard only read Grep and Bash. A codebase-index command run from Claude Code's PowerShell tool never turned it off, so Grep kept being intercepted for the whole session, and PowerShell searches were not guarded at all.
  • install-hooks skipped an installed guard, so a new matcher could not reach existing installs.
  • The guard intercepted searches the index cannot answer: .git internals, binaries and paths outside the repository.

Solution

  • Add PowerShell to the guard and to both matchers, skip here-string bodies, and read Select-String's named -Pattern, -Path and -LiteralPath.
  • install-hooks refreshes the matcher of an installed guard.
  • Searches over git internals, binaries and absolute paths outside the indexed repository pass, and the index lookup now comes before any search parsing.

Also bumps the version to 2.1.3 with every mirror synced.

Verification

New tests in tests/test_hooks_guard.py, the PowerShell ones failing before the fix. A test ties both matchers to the tools the guard reads. Full suite passes (coverage 86%), ruff and mypy clean, check_versions.py consistent.

Compatibility

Plugin users get the new matcher automatically. Users of install-hooks run it again after upgrading; until then their hook behaves as before for PowerShell.

…not answer

The guard only read Grep and Bash, so an index command run from PowerShell never turned it off and PowerShell searches went unseen. Add the tool to both matchers, skip here-string bodies, read Select-String's named parameters, and let install-hooks refresh an installed matcher.

Searches over git internals, binaries and paths outside the repository now pass, as does everything in a directory without an index.
Version bump with every mirror synced (plugin.json, requirements.lock, skill stamps) and the 2.1.3 release notes.
@denfry
denfry merged commit 03683cc into main Nov 2, 2026
11 checks passed
@denfry
denfry deleted the fix/hook-guard-scope branch November 2, 2026 06:12
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