OctopusOctopus/Docs/Claude Code Integration
CLI / Claude Code

Claude Code Integration

Bring Octopus code reviews directly into Claude Code. Review PRs, auto-fix findings, and explore your codebase without leaving the terminal.

Overview

The Octopus plugin for Claude Code adds AI-powered code review as a native capability. It wraps the Octopus CLI so you can trigger reviews, fix findings, and interact with your codebase using natural language or slash commands.

Slash Commands
Type /review to trigger a PR review instantly.
Natural Language
Say "review my code" or "find security issues" and the plugin activates.
Autofix
Scan open PRs for Octopus review comments, apply fixes, and push updates.

Prerequisites

You need the Octopus CLI installed and authenticated before using the plugin.

1. Install the CLI

# macOS / Linux (x64 & ARM)
curl -fsSL https://octopus-review.ai/install.sh | sh

# Windows (PowerShell)
irm https://octopus-review.ai/install.ps1 | iex

# Windows ARM
npm install -g @octp/cli

2. Authenticate

octopus login

# Or with a token
octopus login --token oct_your_token_here

3. Verify

octopus whoami

Install the Plugin

Install from the Claude Code Plugin Marketplace:

claude plugin install octopus

Or from within a Claude Code session:

/plugin install octopus

Review a Pull Request

Use the /review slash command to trigger a review on a pull request.

# Review current branch's PR (auto-detected)
/review

# Review by PR number
/review 42

# Review by URL
/review https://github.com/owner/repo/pull/42

The review runs asynchronously. Once complete, findings appear as comments directly on the PR with severity levels:

CriticalSecurity vulnerabilities, data loss risks
HighBugs, logic errors, performance issues
MediumCode quality, maintainability concerns
LowStyle, naming, minor improvements
InfoSuggestions, best practices, tips

Natural Language

You don't need to remember slash commands. Just ask Claude naturally and the plugin activates:

"Review my code"
"Check this PR for security issues"
"Find bugs in my changes"
"What's wrong with my code?"
"Octopus review my changes"

Autofix

The autofix skill scans your open PRs for unresolved octopus-review[bot] comments, presents them with a summary, and helps you fix them. Comments from other review tools (CodeRabbit, Greptile, etc.) are ignored.

# Trigger autofix
"Octopus autofix"
"Octopus fix"

How it works

  1. Lists your open PRs and checks for octopus-review[bot] comments
  2. Skips PRs where the latest review shows 0 findings
  3. Presents a summary of actionable feedback and asks for confirmation
  4. Checks out each PR branch, applies fixes, and commits
  5. For valid suggestions: reacts with a thumbs up and replies with the fix
  6. For false positives: reacts with a thumbs down and explains why
  7. Pushes changes and posts a summary comment tagging @octopus

Autonomous Review-Fix Cycle

Combine the review and autofix skills for a fully autonomous workflow:

  1. Implement your feature or fix
  2. Ask: "review my code"
  3. Review findings are posted on the PR
  4. Ask: "octopus fix"
  5. Fixes are applied, pushed, and summarized on the PR
  6. Ask: "review again" to verify

Repeat until the review comes back clean.

Other Capabilities

The plugin also supports these Octopus CLI commands:

octopus repo status

Check indexing progress, analysis results, and auto-review status.

octopus repo index

Trigger code indexing for better review context.

octopus repo analyze

Run AI analysis to generate a codebase summary.

octopus repo chat

Interactive Q&A about your codebase.

octopus usage

Check monthly token usage, spend limits, and credit balance.

Plugin Structure

The plugin is entirely Markdown-based with no compiled code. Claude Code reads these files and uses them as instructions.

.claude-plugin/
  plugin.json              # Plugin manifest
agents/
  code-reviewer.md         # Specialized code review agent
commands/
  review.md                # /review slash command
skills/
  autofix/
    SKILL.md               # Autofix skill (scan PRs, fix review comments)
  code-review/
    SKILL.md               # Code review skill (natural language triggers)

Source Code

The plugin is open source. Contributions are welcome.

View on GitHub