> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corridor.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Integrate Corridor with Claude Code for real-time security guardrails via MCP and hooks.

Corridor integrates with Claude Code via MCP and hooks, ensuring that code generated by Claude Code is checked against your security guardrails.

## Prerequisites

* [Claude Code](https://claude.ai/code) installed (`claude` command)
* A Corridor account with a team created

## Setup

There are two ways to set up Corridor with Claude Code, depending on how you use it.

### Option 1: VS Code / Cursor Extension

If you use Claude Code within VS Code or Cursor, the Corridor extension handles setup automatically.

<Steps>
  <Step title="Install the Corridor extension">
    Install the Corridor extension in VS Code or Cursor. See [VS Code & Cursor setup](/ide-setup/vscode-cursor) for installation instructions.
  </Step>

  <Step title="Sign in to Corridor">
    Click the Corridor icon in the activity bar and sign in to your Corridor account.
  </Step>

  <Step title="Verify the plugin">
    Restart Claude Code if it's currently running. The extension automatically configures Claude Code's MCP settings. You can verify the plugin is connected by running `/mcp` in Claude Code.
  </Step>
</Steps>

### Option 2: CLI

If you use Claude Code as a standalone CLI (without VS Code or Cursor), install the Corridor CLI directly.

<Steps>
  <Step title="Install the Corridor CLI">
    Install the Corridor CLI with a single command:

    ```bash theme={null}
    curl -fsSL https://app.corridor.dev/cli/install.sh | bash
    ```

    The CLI auto-updates on startup, so you'll always have the latest version.

    The installer will run `corridor install` automatically to set up the Corridor plugin, MCP server, and hooks.
  </Step>

  <Step title="Verify the plugin">
    Restart Claude Code if it's currently running. You can verify the plugin is connected by running `/mcp` in Claude Code.
  </Step>
</Steps>

Once configured, Claude Code will invoke Corridor's security checks as it writes code, catching vulnerabilities and enforcing your security policies automatically.

## Hooks

Hooks are deterministic scripts that run at specific points in the code generation process, enabling real-time security reviews and policy enforcement. Hooks are automatically set up by the Corridor CLI.

### MCP compliance

Corridor tracks which MCP servers are active and enforces your team's policies. To configure, navigate to the **Compliance** tab in the Corridor dashboard and choose **Allowlist Mode** or **Blocklist Mode**.

### Stop hooks (experimental)

When Claude Code generates code, Corridor can automatically evaluate the diff, identify potential security issues, and guide Claude to remediate problems iteratively—all in the background.

By default, hooks run in monitoring mode and won't block code generation. To enable blocking behavior:

1. Open `~/.corridor/config.env` in a text editor
2. Set `CORRIDOR_BLOCKING_STOP_HOOKS=true`
3. Hooks will now prevent code with critical security issues from being applied

### Troubleshooting hooks

If hooks are not running:

* Run `corridor install --force` to reinstall hooks
* Check that `~/.corridor/config.env` exists and contains a valid `CORRIDOR_ACCESS_TOKEN`
* Verify the plugin is registered in `~/.claude/settings.json` (in the `enabledPlugins` field)

## Uninstalling

To remove the Corridor CLI and all its configuration:

1. If you have the Corridor extension installed in VS Code or Cursor, uninstall it from the Extensions panel.
2. Run the uninstall script:

   ```bash theme={null}
   curl -fsSL https://app.corridor.dev/cli/uninstall.sh | bash
   ```

   The script removes the Corridor plugin, MCP server, hooks, and the `corridor` binary from `~/.corridor` and `~/.local/bin`.

## Next steps

<CardGroup cols={2}>
  <Card title="Guardrails" icon="shield-check" href="/features/guardrails">
    Learn how guardrails protect your code
  </Card>

  <Card title="Corridor MCP" icon="plug" href="/features/corridor-mcp">
    Explore Corridor's MCP tools
  </Card>
</CardGroup>
