> Graphify: shared context of codebase for agents and developers. Canonical: https://graphify.com/blog/claude-code-security-review · Full index: https://graphify.com/llms-full.txt

# Claude Code security review, step by step

*December 5, 2026 · Syed Fahad*

A Claude Code security review is a pass over the changes on your current branch, or an automated pass on a pull request, that looks for security issues rather than general review comments. This post walks through both official paths, the limits Anthropic documents, and one follow up step once something is flagged: asking for the callers of that function. We make Graphify, so that last step uses our graph. The official options come from Anthropic's docs, checked on 5 December 2026.

If you want the wider picture of Claude Code review, including `/code-review` and the managed pull request service, start with [Claude Code review](https://graphify.com/blog/claude-code-review). This page stays on security review.

## How do you run /security-review in a session?

Open a Claude Code session in the project, in the terminal or in the Code tab of Claude Desktop, and run:

```text
/security-review
```

Anthropic's [commands reference](https://code.claude.com/docs/en/commands), read on 5 December 2026, says this command analyzes the changes on your current branch. It reviews the diff between your branch and origin's default branch and looks for risks such as injection, auth issues and data exposure. It needs an `origin` remote. If the review fails with an "ambiguous argument" error, the [error reference](https://code.claude.com/docs/en/errors) explains why: Git has no `origin/HEAD` ref in that clone.

The [Claude Help Center article](https://support.claude.com/en/articles/11932705-automated-security-reviews-in-claude-code) describes the same command as a check you can run before you commit. It lists the kinds of issues the reviews look for: SQL injection risks, XSS, authentication flaws, insecure data handling, and dependency vulnerabilities.

`/security-review` covers the changes on the current branch. It is not a scan of the whole repository, and it is not the same as the [security-guidance plugin](https://code.claude.com/docs/en/security-guidance) or the [Claude Security plugin](https://code.claude.com/docs/en/claude-security), which the Claude Code review guide tells apart.

## How do you run the official GitHub Action on a pull request?

For a review that comments on the pull request, Anthropic publishes [`anthropics/claude-code-security-review`](https://github.com/anthropics/claude-code-security-review). The README, checked on 5 December 2026, shows this workflow:

```yaml
name: Security Review

permissions:
  pull-requests: write
  contents: read

on:
  pull_request:

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: ${{ github.event.pull_request.head.sha || github.sha }}
          fetch-depth: 2

      - uses: anthropics/claude-code-security-review@main
        with:
          comment-pr: true
          claude-api-key: ${{ secrets.CLAUDE_API_KEY }}
```

The action reviews the changed files and can post comments on the pull request. Anthropic says the Claude API key needs to be enabled for both the Claude API and Claude Code usage.

## What is the limit to know before you use it?

Anthropic's README says the action is not hardened against prompt injection attacks and should only be used to review trusted pull requests. They recommend turning on "Require approval for all external contributors" so the workflow runs only after a maintainer has reviewed the pull request.

The Help Center article is just as direct about scope: automated security reviews should complement your existing security practices and manual code reviews, not replace them. Treat a comment as a lead to check, not as a verdict.

## What do you do after a finding?

When a comment names a function, the next question is who else calls it. The diff only shows part of the answer, and official setup guides tend to stop before this step.

Graphify is shared codebase context for coding agents and for the people working with them, whether that is a team or one developer on a side project. Connect your repository at [app.graphify.com](https://app.graphify.com) and wait for its status to read Indexed. Then connect Claude Code to the hosted MCP server, which the [Graphify with Claude](https://graphify.com/blog/graphify-with-claude) guide walks through, and ask:

```text
Use Graphify on my repository: what calls sanitize_input?
```

Graphify's [documentation](https://docs.graphify.com/concepts/follow-calls) says the agent answers through the `graphify_callers` tool, from the call edges in the indexed graph, and each answer carries a source location. If the name matches more than one definition, the tool lists the candidates and you pick one. An empty result means no call edge was indexed. It does not prove that nothing calls the function, for example when code is called dynamically or the index is behind.

Use the callers as a starting list for your own check of the fix. The graph does not replace reading the code.

The hosted Graphify [pull request review](https://graphify.com/pr-reviews) reads the same graph when a pull request opens, so a later review can mention dependents the diff does not show.

## Try it

Run `/security-review` on a branch you trust, or add the official Action to a repository where pull requests come from people you already review. When a finding names a function, ask for its callers before you settle on the fix. Sign in at [app.graphify.com](https://app.graphify.com).

If you would rather keep the graph on your own machine, the open-source Graphify CLI is also available: `uv tool install graphifyy`.

## FAQ

### How do I run a security review in Claude Code?

Open a Claude Code session in the project and run /security-review. It reviews the diff between your current branch and origin's default branch, looking for risks such as injection, authentication issues and data exposure. You need an origin remote.

### How do I run Claude Code security review on a pull request?

Add the official anthropics/claude-code-security-review GitHub Action to a workflow that runs on pull_request. It analyzes changed files and can post comments on the pull request. Anthropic says the action is not hardened against prompt injection, so use it on trusted pull requests only.

### Is /security-review the same as Claude Code review?

No. /security-review is a security pass on the current branch. Claude Code review is a separate set of tools for general pull request review. The security-guidance plugin and the Claude Security plugin are different again. Our Claude Code review guide covers those differences.

### Does a security review replace a human review or a scanner?

No. Anthropic's own help article says automated security reviews should complement your existing security practices and manual code reviews, not replace them.

### What should I do after Claude flags a function?

Read the finding against the code, then ask your agent for the callers of that function to see where else it is reached. With Graphify connected, the agent answers from the call edges in the indexed graph, with file and line. An empty answer means no call edge was indexed, not that nothing calls it.
