brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: /security-review in Claude Code checks your branch for security holes

Claude
~/tips/tip-claude-security-review-branch

/security-review

Reviews the diff between your branch and the main branch for injection, auth and data leaks.

Before you open a pull request, a second pair of eyes on the risky parts helps. Claude Code has a command for exactly that review.

/security-review

It looks at the diff between your current branch and the default branch on origin, so only your changes, not the whole codebase. Claude goes through them for issues like injection, broken authentication or authorisation, and data that ends up where it shouldn’t, and reports what it finds with an explanation.

Since it only sees the diff, it fits right before a pull request. Commit your work on a feature branch first, because the review compares branches.

It needs an origin remote. In a local-only repository, or one where origin/HEAD isn’t set, it fails with an “ambiguous argument” error. The Claude Code error reference has an entry for exactly that case, so look there before fiddling with git.

A clean result doesn’t mean the code is secure. It’s a review of the lines you changed, so a hole that comes from how your change interacts with old code elsewhere can be missed, and so can anything in config that isn’t in the diff. I see it as a useful checklist pass, not as a security audit.

Further reading: Commands: /security-review, Error reference

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link