Hey HN, I built Squawk because I kept noticing Claude Code falling into repetitive or unnecessary loops, e.g., editing tests without reading the source, retrying the same failing command, oscillating between code states.
These patterns waste tokens, time, and context window, but no single-event hook can catch them (since it needs to be detected by monitoring multiple events).
Squawk runs as a lightweight daemon that receives Claude Code hook events and tracks state over time.
It uses counter-based, hash-based, and diff-based rules to detect cross-event patterns like:
- Test-only modifications without reading corresponding source
- Repeated identical edits or failing commands
- Edit oscillation (file content reverting to a previous state)
- Error handling removal or test assertion weakening
When a pattern is detected, Squawk can block the action, inject corrective context, or just notify.
It's fail-open — if Squawk is down, your agent continues normally.
Setup is one command: squawk setup in your project directory.
Ships with 12 built-in rules and you can write custom ones in YAML.
Built in Go with only cobra and yaml.v3 as dependencies.
Would love feedback on the rule design!
Also, what patterns you've seen in your own AI coding sessions?
jack-lin•7h ago
Squawk runs as a lightweight daemon that receives Claude Code hook events and tracks state over time. It uses counter-based, hash-based, and diff-based rules to detect cross-event patterns like:
- Test-only modifications without reading corresponding source - Repeated identical edits or failing commands - Edit oscillation (file content reverting to a previous state) - Error handling removal or test assertion weakening
When a pattern is detected, Squawk can block the action, inject corrective context, or just notify. It's fail-open — if Squawk is down, your agent continues normally.
Setup is one command: squawk setup in your project directory. Ships with 12 built-in rules and you can write custom ones in YAML.
Built in Go with only cobra and yaml.v3 as dependencies. Would love feedback on the rule design! Also, what patterns you've seen in your own AI coding sessions?