Skip to content

Claude Code

Anthropic's AI coding assistant with deep reasoning capabilities and a focus on safety.

Overview

Claude Code is a powerful AI coding assistant from Anthropic. It excels at:

  • Complex multi-step reasoning
  • Thorough code analysis and review
  • Safe and responsible AI assistance
  • Understanding context deeply

Installation

Install Claude Code from Anthropic:

# Verify installation
which claude
claude --version

Basic Usage

# Use Claude with clinvk
clinvk --backend claude "fix the bug in auth.go"
clinvk -b claude "explain this codebase"

Models

Model Description
claude-opus-4-5-20251101 Most capable, best for complex tasks
claude-sonnet-4-20250514 Balanced performance and speed

Specify a model:

clinvk -b claude -m claude-sonnet-4-20250514 "quick review"

Configuration

Configure Claude in ~/.clinvk/config.yaml:

backends:
  claude:
    # Default model
    model: claude-opus-4-5-20251101

    # Tool access (all, or comma-separated list)
    allowed_tools: all

    # Override unified approval mode
    approval_mode: default

    # Override unified sandbox mode
    sandbox_mode: default

    # Enable/disable this backend
    enabled: true

    # Custom system prompt
    system_prompt: ""

    # Extra CLI flags
    extra_flags: []

Environment Variable

export CLINVK_CLAUDE_MODEL=claude-sonnet-4-20250514

Approval Modes

Claude supports different approval behaviors:

Mode Description
default Let Claude decide based on action risk
auto Reduce prompts / auto-approve edits (backend-specific)
none Never ask for approval prompts (dangerous)
always Always ask for approval (when supported)

Set via config:

backends:
  claude:
    approval_mode: auto

Or per-command (in tasks/chains):

{
  "backend": "claude",
  "prompt": "refactor the module",
  "approval_mode": "auto"
}

Sandbox Modes

Control Claude's file system access:

Note

sandbox_mode is a unified setting. For the claude backend, clinvk does not currently map sandbox_mode to a Claude CLI flag, so it may have no effect.

Mode Description
default Let Claude decide
read-only Can only read files
workspace Can modify files in project
full Full file system access

Allowed Tools

Control which tools Claude can use:

backends:
  claude:
    # All tools
    allowed_tools: all

    # Specific tools only
    allowed_tools: read,write,edit

Session Resume

Claude Code stores sessions and supports resuming:

# Resume with clinvk
clinvk resume --last --backend claude
clinvk resume <session-id>

Internally uses Claude's --resume flag.

Extra Flags

Pass additional flags to the Claude CLI:

backends:
  claude:
    extra_flags:
      - "--add-dir"
      - "./docs"

Common flags:

Flag Description
--add-dir <path> Add additional directory to context
--print Print final response in non-interactive mode

Best Practices

Use Opus for Complex Tasks

Claude Opus is ideal for multi-step reasoning, code architecture, and thorough reviews.

Leverage Session Continuity

Claude excels at maintaining context across a conversation. Use clinvk -c to continue sessions.

Trust the Defaults

Claude's default approval and sandbox modes are well-tuned for safety while being useful.

Use Cases

Code Review

clinvk -b claude "review this PR for security issues and code quality"

Complex Refactoring

clinvk -b claude "refactor the authentication system to use JWT tokens"

Architecture Analysis

clinvk -b claude "analyze this codebase architecture and suggest improvements"

Bug Investigation

clinvk -b claude "investigate why the tests are failing in the CI pipeline"

Troubleshooting

Backend Not Available

# Check if Claude is installed
which claude

# Check clinvk detection
clinvk config show | grep claude

Rate Limits

If hitting rate limits, consider:

  • Using a different model
  • Spacing out requests
  • Running in sequential mode for comparisons

Next Steps