This functionality was out of scope for the Claude Code provider PR.
The automatic updating of maxTokens values in config.json during
initialization is a general improvement that should be in a separate PR.
Additionally, Claude Code ignores maxTokens and temperature parameters
anyway, making this change irrelevant for the Claude Code integration.
Removed:
- scripts/modules/update-config-tokens.js
- Import and usage in scripts/init.js
This change makes the Claude Code SDK package optional, preventing installation failures for users who don't need Claude Code functionality.
Changes:
- Added @anthropic-ai/claude-code to optionalDependencies in package.json
- Implemented lazy loading in language-model.js to only import the SDK when actually used
- Updated documentation to explain the optional installation requirement
- Applied formatting fixes to ensure code consistency
Benefits:
- Users without Claude Code subscriptions don't need to install the dependency
- Reduces package size for users who don't use Claude Code
- Prevents installation failures if the package is unavailable
- Provides clear error messages when the package is needed but not installed
The implementation uses dynamic imports to load the SDK only when doGenerate() or doStream() is called, ensuring the provider can be instantiated without the package present.
Implements Claude Code as a new AI provider that uses the Claude Code CLI
without requiring API keys. This enables users to leverage Claude models
through their local Claude Code installation.
Key changes:
- Add complete AI SDK v1 implementation for Claude Code provider
- Custom SDK with streaming/non-streaming support
- Session management for conversation continuity
- JSON extraction for object generation mode
- Support for advanced settings (maxTurns, allowedTools, etc.)
- Integrate Claude Code into Task Master's provider system
- Update ai-services-unified.js to handle keyless authentication
- Add provider to supported-models.json with opus/sonnet models
- Ensure correct maxTokens values are applied (opus: 32000, sonnet: 64000)
- Fix maxTokens configuration issue
- Add max_tokens property to getAvailableModels() output
- Update setModel() to properly handle claude-code models
- Create update-config-tokens.js utility for init process
- Add comprehensive documentation
- User guide with configuration examples
- Advanced settings explanation and future integration options
The implementation maintains full backward compatibility with existing
providers while adding seamless Claude Code support to all Task Master
commands.