Skip to content

fix: guard hook recognizes lane stated via SendUserMessage or "Lane is X" (0.6.1) - #8

Merged
sofus-common merged 1 commit into
mainfrom
fix/lane-guard-detection
Oct 15, 2026
Merged

sofus-common merged 1 commit into
mainfrom
fix/lane-guard-detection

Conversation

@sofus-common

Copy link
Copy Markdown
Contributor

Summary

  • Fix: the guard hook (hooks/edit_guard.py) denied file changes with "State the lane" after the lane was stated. Two causes:
    • Brief mode: the lane was stated through SendUserMessage (alias Brief). The hook read only assistant text blocks, so it never saw it. It now also reads the message of those tool calls.
    • Phrasing: "Lane is Fast" or "Lane for this: Fast" did not match; only punctuation was allowed between "lane" and the lane name. Up to 20 characters on the same line are now allowed.
  • The denial now gives an accepted example ("Lane: Fast"), so a retry does not depend on guessing the pattern.
  • Version bumped to 0.6.1; changelog entry is Unreleased.

Verification

  • New test_edit_guard.py cases fail on the old hook ("The lane is Fast." denied; SendUserMessage statement denied) and pass on the new one.
  • check_version.py (+ self-test), test_behavior_check.py, test_edit_guard.py pass.
  • Not run: the cross-host behavior suite required before dating 0.6.1.
  • The originating blocked session was not found on this machine, so which cause hit it is not confirmed; the fix covers both.
  • Known limit: "Lane is not Fast" would now count as stating Fast.

🤖 Generated with Claude Code

…s X" (0.6.1)

The PreToolUse guard denied writes with "State the lane" after the lane
was stated. It read only assistant text blocks, so brief-mode messages
sent through SendUserMessage were invisible, and it allowed only
punctuation between "lane" and the lane name. The denial now gives an
accepted example.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sofus-common
sofus-common merged commit b116117 into main Oct 15, 2026
2 checks passed
@sofus-common
sofus-common deleted the fix/lane-guard-detection branch October 15, 2026 15:03
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