Why Claude?
- Deep reasoning - Excellent at understanding complex code patterns
- Detailed analysis - Provides thorough explanations and context
- Large context - Can analyze large codebases in a single request
- Safety-focused - Built with responsible AI principles
Claude is a paid service. Youโll need to add credits to your Anthropic account to use their API.
Get an API key
Create an account
Visit console.anthropic.com and sign up.
Add billing
Navigate to Plans & Billing and add payment information.
Create an API key
Go to API Keys and generate a new key.
Setup
Option 1: Environment variable (recommended)
Set the environment variable in your shell:Option 2: .env file
Create a.env file in your project directory:
.env
Option 3: Configuration file
Create avibrant.config.js file:
vibrant.config.js
Usage
Run Vibrant with Claude:Available models
Vibrant uses claude-3-haiku-20240307 by default for fast, cost-effective analysis.claude-3-haiku-20240307 (default)
claude-3-haiku-20240307 (default)
- Context: 200k tokens
- Cost: ~1.25 per 1M output tokens
- Speed: Very fast
- Quality: Excellent for code analysis
- Best for: Daily development, quick analysis
claude-3-5-sonnet-20241022
claude-3-5-sonnet-20241022
- Context: 200k tokens
- Cost: ~15.00 per 1M output tokens
- Speed: Fast
- Quality: Superior reasoning and analysis
- Best for: Complex codebases, architectural review
claude-3-opus-20240229
claude-3-opus-20240229
- Context: 200k tokens
- Cost: ~75.00 per 1M output tokens
- Speed: Medium
- Quality: Best-in-class for complex tasks
- Best for: Critical production code, security audits
Change the model
Set theCLAUDE_MODEL environment variable:
.env file:
.env
Pricing
Typical costs for analyzing a medium-sized project (100 files):| Model | Input Cost | Output Cost | Typical Total |
|---|---|---|---|
| claude-3-haiku | ~$0.004 | ~$0.010 | ~$0.02 per analysis |
| claude-3-5-sonnet | ~$0.05 | ~$0.12 | ~$0.20 per analysis |
| claude-3-opus | ~$0.25 | ~$0.60 | ~$1.00 per analysis |
Vibrantโs Smart Summarizer reduces token usage by 50-60%, significantly lowering your costs.
Example output
Troubleshooting
Error: API key not found
ANTHROPIC_API_KEY environment variable:
Error: Insufficient credits
Error: Rate limit exceeded
- Wait a few minutes before retrying
- Contact Anthropic support to increase your rate limits
- Use a different provider temporarily:
vibrant . --ai --provider gemini
Best practices
Use Haiku for daily development
Claude Haiku provides excellent quality at a reasonable cost, perfect for frequent analyses.
Use Sonnet for complex reviews
When reviewing large refactors or architectural changes, Claude Sonnet offers superior reasoning.
Reserve Opus for critical code
Use Claude Opus for security audits, production deployments, or complex debugging tasks.
Monitor your usage
Check your usage dashboard to track costs.
CI/CD integration
For GitHub Actions:.github/workflows/code-quality.yml
Add
ANTHROPIC_API_KEY as a secret in your repository settings.When to use Claude
Claude excels at:- Complex reasoning - Understanding intricate code patterns and dependencies
- Security analysis - Identifying subtle security vulnerabilities
- Architectural review - Evaluating system design and suggesting improvements
- Detailed explanations - Providing thorough context for issues
- Large codebases - 200k token context window handles big projects
Next steps
AI providers overview
Compare all available providers
OpenAI setup
Try GPT-4o for comparison