Claude Code Options¶
Advanced Claude Code SDK options can be passed through API requests using unofficial extension parameters.
Unofficial Extensions
The parameters documented on this page are not part of the official Anthropic or OpenAI APIs. They are Claude Code SDK-specific extensions that provide additional control over Claude's behavior.
Overview¶
The CCProxy API supports passing all ClaudeAgentOptions parameters through API requests. This allows you to configure advanced Claude Code features like tool permissions, thinking tokens, MCP integrations, and more directly through API calls.
Available Parameters¶
Tool Management¶
allowed_tools¶
- Type:
arrayof strings - Description: List of tools that Claude is allowed to use
- Example:
["Read", "Write", "Bash", "Edit"]
disallowed_tools¶
- Type:
arrayof strings - Description: List of tools that Claude is explicitly forbidden from using
- Example:
["Bash", "Write"]
Thinking and Processing¶
max_thinking_tokens¶
- Type:
integer - Default:
8000 - Description: Maximum number of thinking tokens Claude can use for internal reasoning
max_turns¶
- Type:
integer - Description: Maximum number of conversation turns to allow
System Prompts¶
append_system_prompt¶
- Type:
string - Description: Additional system prompt text to append to the main system prompt
Conversation Management¶
continue_conversation¶
- Type:
boolean - Default:
false - Description: Whether to continue a previous conversation
resume¶
- Type:
string - Description: Conversation ID to resume from
MCP Integration¶
mcp_tools¶
- Type:
arrayof strings - Description: List of MCP (Model Context Protocol) tools to enable
- Example:
["filesystem", "database", "web_search"]
mcp_servers¶
- Type:
object - Description: MCP server configurations with connection details
- Example:
Environment¶
cwd¶
- Type:
string - Description: Working directory path for Claude's operations
- Example:
"/path/to/project"
Usage Examples¶
Basic Tool Configuration¶
{
"model": "claude-3-5-sonnet-20241022",
"messages": [
{
"role": "user",
"content": "Help me review this code file"
}
],
"max_tokens": 2000,
"allowed_tools": ["Read", "Edit"],
"cwd": "/home/user/project"
}
Advanced Configuration with MCP¶
{
"model": "claude-3-5-sonnet-20241022",
"messages": [
{
"role": "user",
"content": "Search for recent commits and analyze the codebase"
}
],
"max_tokens": 3000,
"max_thinking_tokens": 10000,
"allowed_tools": ["Read", "Bash", "mcp_git"],
"mcp_tools": ["git", "filesystem"],
"mcp_servers": {
"git": {
"command": "python",
"args": ["-m", "mcp_git"],
"env": {"GIT_REPO": "/home/user/project"}
}
},
"cwd": "/home/user/project"
}
Conversation Continuation¶
{
"model": "claude-3-5-sonnet-20241022",
"messages": [
{
"role": "user",
"content": "Continue where we left off"
}
],
"max_tokens": 1000,
"continue_conversation": true,
"resume": "conversation_id_12345",
"append_system_prompt": "Remember our previous discussion about the React components."
}
API Compatibility¶
These extended parameters work with all API endpoints:
- Anthropic API:
/v1/chat/completionsand/v1/messages - OpenAI API:
/openai/v1/chat/completions
The parameters are passed alongside standard API parameters and are processed by the Claude Code SDK internally.
CLI Configuration¶
Some of these options can also be configured via command-line arguments when starting the API server:
Best Practices¶
Security Considerations¶
- Tool Restrictions: Use
allowed_toolsanddisallowed_toolsto limit Claude's capabilities based on your security requirements - Working Directory: Set
cwdto restrict file operations to specific directories
Performance Optimization¶
- Thinking Tokens: Adjust
max_thinking_tokensbased on task complexity - Tool Selection: Only enable necessary tools to reduce overhead
- Conversation Limits: Use
max_turnsto prevent runaway conversations
MCP Integration¶
- Server Configuration: Properly configure MCP servers with appropriate environment variables
- Tool Coordination: Use
mcp_toolsto enable specific MCP capabilities - Resource Management: Consider resource usage when enabling multiple MCP servers
Troubleshooting¶
Common Issues¶
- Unknown Tool Names: Ensure tool names in
allowed_toolsmatch exactly with available tools - MCP Connection Failures: Check MCP server configurations and network connectivity
Validation Errors¶
The API will return validation errors for:
- Malformed mcp_servers configurations
- Non-existent tool names in allowed_tools/disallowed_tools