What Claude Code does for security review
- Checks each change for injection, missing authorization, exposed data and secrets in code before it merges.
- Scans the whole repository on a schedule and reports findings with evidence, not bare warnings.
- Turns confirmed findings into patches or issues, most severe first.
- Checks a fix again to confirm it closes the hole.
Claude Code features for security review
| Feature | What it does | How to start |
|---|---|---|
/security-review | Reviews the diff between your branch and origin's default branch for injection, auth issues and data exposure | Run it in a session; needs an origin remote |
| Security guidance plugin | Reviews Claude's own changes for vulnerabilities and fixes them in the same session | /plugin install security-guidance@claude-plugins-official |
| Claude Security plugin | A multi-agent scan of a repository or diff, with verified findings, a SARIF file and patches | /plugin install claude-security@claude-plugins-official, then /claude-security |
| Code Review (managed) | Pull request reviews on GitHub, which catch security bugs as well | Team and Enterprise; @claude review |
How to set up Claude Code for security review
Connect the tools
/security-reviewworks in any session with anoriginremote. For full scans, install the Claude Security plugin from the official marketplace; it needs Python 3.9 or later and a paid plan or API access.# In a Claude Code session: install the scanner /plugin install claude-security@claude-plugins-official # Scan your branch before merging, at high effort /claude-security scan my branch at highWrite the rules in CLAUDE.md
Claude Code reads CLAUDE.md at the start of every session,
claude -pruns included. Put the job's rules there, or in a skill under.claude/skills/if they're long. See the CLAUDE.md guide.## Security review rules - Review every pull request that touches auth/, billing/ or SQL. Look for injection, missing authorization checks, secrets in code and data returned to the wrong user. - Rate each finding Critical, High, Medium or Low, with the file, the line and how it could be exploited. - Never run exploits against production or anything we don't own. Read the code and test locally. - Open fixes as pull requests; never push to main.Run it without the interactive interface
claude -pruns one task and exits, so cron, CI or another tool can start it. Choose what it may do without asking with--allowedToolsor--permission-mode;--output-format jsonreturns the result with its cost.# A security pass on the branch from CI or cron claude -p "Run /security-review on this branch and list findings by severity" \ --output-format json > security-review.jsonPut it on a schedule
Make it a cloud scheduled task with
/schedule(Pro, Max, Ultra, Team and Enterprise), a desktop scheduled task, or/loopwhile a session stays open. See how to make Claude Code proactive.
Limits and safety
- It reads the code in your checkout, not your running site, so it won't catch a misconfigured server.
- Scans are nondeterministic: two runs can surface different findings. Run them regularly, not once.
- It adds to your scanners and dependency alerts. It doesn't replace them or a penetration test.
- Since Claude Code v2.1.302,
claude -pstarts in Manual mode: an action that needs approval is denied unless a rule allows it. Allow only the tools the job needs.
Claude Code or Codex for security review?
The rules carry over. Write them once in AGENTS.md and put @AGENTS.md in CLAUDE.md, and both agents read the same file.
Step by step for the other agent: security review with Codex.
| Claude Code | Codex | |
|---|---|---|
| Rules file | CLAUDE.md | AGENTS.md |
| Connect tools | claude mcp add | codex mcp add or config.toml |
| Run without you | claude -p | codex exec |
| Schedule | /schedule, desktop scheduled tasks, /loop | Scheduled tasks in the ChatGPT app, cron |
| Built in for security review | /security-review, two security plugins | @codex security review, Codex Security |
Make security review someone's job
Commands run when someone remembers to run them. Crewmark turns your own Claude Code into an AI employee with a role, a goal in numbers, working hours and a heartbeat, so the work happens on schedule and shows up on a board.
Start from the role
The AI software engineer, with these rules in its brief.
Put the work on its board
Add the job as a recurring issue. The employee wakes on its heartbeat, does it and reports in a comment.
Related
For bugs that aren't security issues, see code review.
FAQ
Does Claude Code have a security review command?
Yes. /security-review reviews the changes on your current branch against origin's default branch for vulnerabilities such as injection, auth issues and data exposure.
How do I scan a whole repository with Claude Code?
Install the Claude Security plugin with /plugin install claude-security@claude-plugins-official and run /claude-security. It maps the code, builds a threat model, hunts for vulnerabilities and verifies each finding; the results include a SARIF file.
Can Claude Code fix the vulnerabilities it finds?
Yes. The Claude Security plugin turns the findings you pick into patches you review and apply, and the security guidance plugin fixes issues in Claude's own changes as it writes them.
Checked against Claude Code's and OpenAI's Codex documentation on November 13, 2026.