currentLineCountOf() swallows a read failure as current=0. A relative file_path resolving against the wrong cwd would silently collapse the ratchet back to a flat gate (Write) or disable enforcement entirely (Edit). The Write/Edit tool contracts require an absolute file_path, so this can't happen in practice -- noted advisor concern, verified against the tool schemas, recorded in the hook's own comment so a future change doesn't harden this without re-reading why it was never needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0186kZGKddxfA9N84HqMLbb2 |
||
|---|---|---|
| .. | ||
| scripts | ||
| hooks.json | ||