Skip to content

feat: Add Claude Code subscription mode support#382

Merged
edenreich merged 8 commits intomainfrom
feat/claude-code-adapter
Jan 26, 2026
Merged

feat: Add Claude Code subscription mode support#382
edenreich merged 8 commits intomainfrom
feat/claude-code-adapter

Conversation

@edenreich
Copy link
Copy Markdown
Contributor

@edenreich edenreich commented Jan 25, 2026

Adds support for Claude Code CLI integration, allowing users to use their Claude Max/Pro subscriptions instead of pay-per-token API pricing. This provides cost predictability for heavy Claude users with a fixed monthly cost. The feature includes new commands for setup/testing and automatically switches between gateway and subscription modes.

Key changes:

  • New Claude Code configuration section in config.yaml
  • CLI commands for authentication and testing (infer claude-code setup/test)
  • ClaudeCodeClient adapter that wraps the official Claude CLI
  • Static model service for Claude subscription models
  • Updated documentation with cost comparison and setup instructions

Files changed:

  • .infer/config.yaml - Added Claude Code configuration section
  • README.md - Updated with Claude Code documentation
  • cmd/agent.go - Added Claude Code command integration
  • cmd/claude_code.go - New Claude Code CLI commands
  • cmd/config.go - Updated configuration handling
  • cmd/root.go - Added Claude Code command to root
  • cmd/status.go - Updated status display
  • config/config.go - Added Claude Code config structs
  • internal/agent/agent_streaming.go - Updated agent streaming
  • internal/agent/agent_utils.go - Updated agent utilities
  • internal/agent/tools/todowrite.go - Updated tool handling
  • internal/app/chat.go - Updated chat application
  • internal/container/container.go - Updated dependency injection
  • internal/infra/adapters/claude_code_client.go - New Claude Code client adapter
  • internal/services/model_claude_code.go - New Claude Code model service
  • internal/ui/components/conversation_view.go - Updated UI components
  • internal/ui/components/model_selection_view.go - Updated model selection

Benefits:

  1. Cost predictability - Fixed monthly cost instead of variable API usage
  2. Automatic switching - Seamlessly switches between gateway and subscription modes
  3. Easy setup - Simple CLI commands for authentication and testing
  4. Full integration - Works with all existing features and UI components

Testing:

  • Run infer claude-code setup to authenticate with Claude CLI
  • Run infer claude-code test to verify connectivity
  • Models will automatically appear in model selection when configured

NOT RECOMMENDED

It's essentially infer -> claude-code -> response - essentially invoking claude-code in non-interactive mode and displaying the results in the infer chat - that means you need claude-code installed + probably the javascript runtime.
Better approach would be to use anthropics API by setting ANTHROPIC_API_KEY - then we only use the inference and we can use any tools from the tool box - it's more expensive because of pay-as-you-go model but it provides faster results.

@edenreich edenreich merged commit a04504e into main Jan 26, 2026
5 checks passed
@edenreich edenreich deleted the feat/claude-code-adapter branch January 26, 2026 00:05
ig-semantic-release-bot bot pushed a commit that referenced this pull request Jan 26, 2026
## [0.100.0](v0.99.2...v0.100.0) (2026-01-26)

### 🚀 Features

* Add Claude Code subscription mode support ([#382](#382)) ([a04504e](a04504e))
@ig-semantic-release-bot
Copy link
Copy Markdown

🎉 This PR is included in version 0.100.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant