Skip to main content
Claude Code

How it works

VibeKit runs Anthropic’s Claude Code in headless mode, with the --dangerously-skip-permissions flag enabled. This means that the agent will automatically create, edit and delete files if it’s in code mode. The Claude Code CLI runs in the configured environment and has access to the network, which means it could be used to connect to the outside world. This is a powerful feature that can be used to build powerful applications and should be used with caution. Read more about Claude Code

Authentication

Claude Code agent supports OAuth and API key authentication. Authentication is now handled by the separate @vibe-kit/auth package.

Installation

Authenticate with your Claude Pro/Max account for better rate limits.
Security Note: OAuth tokens are stored locally at ~/.vibekit/claude-oauth-token.json with restricted permissions (600). For production environments, consider using environment variables or a secrets manager.

Using OAuth in Code

Get an OAuth token and pass it as the API key:

Using OAuth Token via Environment Variable

You can also provide the OAuth token directly via environment variable:

Multi-Instance Usage

For using OAuth tokens across multiple instances (CI/CD, containers, etc.):
  1. Quick sharing: Set CLAUDE_CODE_OAUTH_TOKEN environment variable
  2. With auto-refresh: Copy ~/.vibekit/claude-oauth-token.json between instances
  3. Production: Use a secrets manager or API keys

Library API Usage

You can use OAuth authentication programmatically with the auth package:

Web OAuth Usage

For web applications, OAuth authentication works the same way as CLI - users copy and paste the authentication code:

2. API Key Authentication

Use your Anthropic API key directly:
Both OAuth tokens and API keys are passed the same way to VibeKit - as the providerApiKey parameter.