Skip to main content

Claude Code Setup

Enable Claude Code to use Paragon CLI commands by adding context to your project.

Why Add Context?

Claude Code works best when it knows what tools are available. By adding the Paragon CLI reference to your project’s CLAUDE.md file, Claude Code can:
  • Automatically use paragon run for code analysis
  • Pipe diffs and code through Paragon for review
  • Use semantic search with paragon context
  • Manage branches and stacks efficiently

Setup

  1. Open or create CLAUDE.md in your project root
  2. Copy the CLI reference below and paste it into the file
  3. Claude Code will now have access to all Paragon commands

CLI Reference

Copy the content below into your CLAUDE.md file:
# Paragon CLI Commands

> Use Paragon CLI for enhanced code analysis, reviews, and git workflows.

## Quick Start

```bash
# Analyze code with a prompt
paragon run -q "Review this code for security issues"

# Pipe code for analysis
git diff | paragon run -q "Review these changes"

Code Analysis Commands

paragon run

Run a prompt in non-interactive mode. Accepts input via arguments or stdin.
# Basic usage
paragon run "Explain the authentication flow in this codebase"

# Quiet mode (hide spinner)
paragon run -q "Find potential bugs in the error handling"

# Feature implementation mode
paragon run --feature "Add input validation to the API endpoints"

# JSON output for structured parsing
paragon run --json "List all security issues"

# Pipe stdin
cat src/auth.go | paragon run "Explain this code"
git diff HEAD~3 | paragon run -q "Review these changes"

# Select model
paragon run -m paragon-max "Complex architectural analysis"
Flags:
FlagDescription
-q, --quietHide spinner/progress output
--featureUse feature implementation mode (vs code review)
--jsonOutput structured JSON findings
--conciseResults-only, no reasoning
-m, --modelModel selection (paragon-max, paragon-high, paragon-fast)

paragon context

Specialized context-aware queries using semantic search and AI analysis.

paragon context issue

Diagnose and find root causes of problems.
paragon context issue "Database updates not persisting"
paragon context issue "Memory leak in worker threads"
paragon context issue -q "API returning 500 errors intermittently"
Semantic code search across the codebase.
paragon context search "authentication logic"
paragon context search "where are API routes defined"
paragon context search "error handling patterns"

paragon context knowledge

Query project architecture and documentation.
paragon context knowledge "How does the caching layer work?"
paragon context knowledge "What's the database schema?"
paragon context knowledge "Deployment process"

Git Workflow Commands

paragon submit

Push branch and create/update GitHub PR with AI-generated description.
# AI-generated title and description
paragon submit --ai

# With custom title
paragon submit --title "Add user authentication"

# As draft PR
paragon submit --draft --ai

paragon branch create

Create a new stacked branch with optional AI naming.
# AI-generated branch name based on changes
paragon branch create --ai

# Explicit name
paragon branch create feature/auth

Stack Navigation

paragon stack      # Show branch stack tree
paragon sync       # Rebase current branch on parent
paragon next       # Move to child branch
paragon prev       # Move to parent branch
paragon top        # Jump to top of stack
paragon bottom     # Jump to bottom of stack

Global Flags

Available on all commands:
FlagDescription
-q, --quietHide spinners and progress output
-y, --yoloAuto-approve all permission requests (dangerous)
-d, --debugEnable debug logging
-c, --cwdSet working directory

Integration Examples

Code Review on Diff

git diff main | paragon run -q "Review for bugs and security issues"

Automated PR Review

gh pr diff 123 | paragon run -q --json "Comprehensive code review"

Find Root Cause

paragon context issue "Tests failing after recent merge"

Pre-commit Analysis

git diff --staged | paragon run -q "Check for issues before commit"

Explain Complex Code

cat src/complex-algorithm.go | paragon run "Explain this step by step"

Output Formats

Text Output (default)

Streaming markdown response to stdout.

JSON Output (--json)

{
  "issues_found": 3,
  "tasks": [
    {
      "title": "SQL Injection Risk",
      "description": "User input not sanitized in query",
      "severity": "critical",
      "file": "src/db/queries.go",
      "line": 42
    }
  ]
}

Tips

  1. Use -q flag for cleaner output in scripts
  2. Pipe code via stdin for targeted analysis
  3. Use --json when parsing results programmatically
  4. Use context issue for debugging problems
  5. Use context search to find code patterns