Urgent.News

What's breaking now, across thousands of outlets.

Tech

A bug in my own branch-guard hook, caught by typing one extra space

A bug in my own branch-guard hook, caught by typing one extra space Context: Last week I shipped a set of 4 Claude Code hooks that catch common agent mistakes — no-op edits, pushes to the wrong branch, out-of-scope writes, and unverified claims at the end of a turn. I wrote about them in article #1 and the testing in #2 . This piece is the small, embarrassing follow-up: a bug I found by…

A bug in the branch-guard hook of Claude Code was discovered by an engineer who accidentally typed an extra space in a test case. The hook, block-wrong-branch.sh, checks the git push command and compares the target branch against a policy file. However, when the engineer fed a command with extra whitespace to the hook, it reported an incorrect branch name instead of blocking the push.

This happened because the shell parameter expansion and word-splitting operations do not collapse extra whitespace, unlike the read command. The engineer fixed the issue by normalizing runs of whitespace in the command string before processing. The fix also included adding a regression test to ensure the correct branch name is reported when a bad push attempt occurs.

The engineer emphasized the importance of accurate error messages and thorough testing for hook scripts used with LLMs, as vague or incorrect feedback can mislead the AI model in subsequent interactions.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

PunyGuard: A Chrome Extension That Blocks Every Internationalized Domain

аррӏө.com and apple.com . Put them side by side: can you tell which one is real? All five letters in the first one are Cyrillic. Even so, Chrome 154's address bar displayed it exactly as-is.

  • PunyGuard Chrome extension blocks all internationalized domain names (IDNs)
  • Blocks domains starting with Punycode prefix "xn--"
  • Creator has bias against Japanese domain names

Receive SMS in n8n and Auto-Reply From Your Own Number

Text HELP to your number. An n8n workflow picks up the incoming SMS, checks the keyword, and sends an acknowledgement from the same phone.

  • n8n workflow receives HELP keyword in SMS
  • SimGate app forwards SMS event to n8n
  • Acknowledgment reply sent from same phone number

ScopeNote: Turning Client Conversations into a Clear Freelance Scope

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle What I Built A client says, “We need a small website.

  • ScopeNote tool clarifies client conversations for freelancers
  • Converts briefs or recordings into structured project scopes
  • Offers free and premium plans with private workspace option

# 🔐 Gitleaks: Detect Secrets Before They Reach Git

Have you ever accidentally committed an API key, database password, or access token to Git? 😬 A single mistake can expose sensitive credentials in a repository.

  • Gitleaks scans source code and Git history for exposed sensitive information.
  • Detects secrets early to prevent security incidents before they occur.
  • Integrates with CI/CD pipelines to fail the pipeline if a secret is detected.

More from Friday 16 October →