A Practical Claude 4.5 Sonnet–First Setup (No Local Router Required)
Today, one of the most practical and powerful AI coding setups is combining Anthropic’s Claude Code CLI with multiple models, rather than relying on a single default.
In real-world usage, many developers now use Claude 4.5 Sonnet as their primary daily driver, while selectively pairing it with cost-efficient reasoning models like DeepSeek-Reasoner for deeper analysis and long-running sessions.
Previously, using DeepSeek with Claude Code required running a local proxy/router to translate API formats.
However, DeepSeek now provides an Anthropic API–compatible endpoint, allowing direct integration via environment variables, with no additional infrastructure.
This guide shows how to configure Claude Code on a personal local machine, using:
- Claude 4.5 Sonnet → default, general-purpose coding agent
- DeepSeek-Reasoner → cost-efficient, deep reasoning engine
1. Why Claude 4.5 Sonnet as the Primary Model?
Although many older guides still reference Claude 3.5 Sonnet, that is largely due to historical defaults and documentation lag.
In practice, Claude 4.5 Sonnet is now the more natural default for Claude Code.
What makes Claude 4.5 Sonnet different?
- Stronger codebase-level understanding
Better at navigating large projects and cross-file dependencies. - Improved agent-style workflows
More reliable when iterating, refactoring, or reasoning across multiple steps. - More consistent long sessions
Less degradation during extended coding or debugging sessions.
For day-to-day development, Claude 4.5 Sonnet is simply a generation ahead.
2. Why Add DeepSeek-Reasoner?
Claude 4.5 Sonnet is excellent—but it’s also expensive for long-running or highly iterative reasoning tasks.
This is where DeepSeek-Reasoner fits perfectly.
DeepSeek-Reasoner strengths
- Reasoning-first model
Excels at complex business logic, algorithms, and multi-step problem solving. - Excellent cost efficiency
Ideal for long Claude Code sessions where cost matters. - Anthropic API–compatible endpoint
Works directly with Claude Code by changing environment variables—no router required.
⚠️ Note
DeepSeek-Reasoner uses internal “thinking” steps. These are not always exposed in the Claude Code UI and may be partially hidden for internal reasoning.
3. Prerequisites
You’ll need:
- A DeepSeek API Key
- Claude Code CLI installed
npm install -g @anthropic-ai/claude-code
This guide assumes:
- A personal local machine
- Bash shell (
.bashrc) - Linux or WSL/macOS equivalent
4. Creating a Direct DeepSeek Launcher Script
Claude Code is configured entirely via environment variables.
The cleanest approach is to encapsulate everything in a single launcher script.
Create claude-ds.sh:
#!/bin/bash
# Claude Code + DeepSeek Reasoner launcher (Anthropic-compatible)
set -e
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
echo -e "${BLUE}==========================================${NC}"
echo -e "${GREEN} Claude Code + DeepSeek Reasoner${NC}"
echo -e "${BLUE}==========================================${NC}"
# API key check
if [ -z "$DEEPSEEK_API_KEY" ]; then
echo -e "${YELLOW}⚠️ DEEPSEEK_API_KEY is not set.${NC}"
echo -n "Enter your DeepSeek API Key: "
read -s API_KEY
export DEEPSEEK_API_KEY=$API_KEY
echo -e "\n${GREEN}✅ API Key temporarily set.${NC}"
fi
# Anthropic-compatible endpoint
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="$DEEPSEEK_API_KEY"
# Deep reasoning model
export ANTHROPIC_MODEL="deepseek-reasoner"
# Fast lightweight model
export ANTHROPIC_SMALL_FAST_MODEL="deepseek-chat"
echo -e "${BLUE}ℹ️ Reasoning Model:${NC} $ANTHROPIC_MODEL"
echo -e "${BLUE}ℹ️ Fast Model:${NC} $ANTHROPIC_SMALL_FAST_MODEL"
echo -e "${GREEN}🚀 Launching Claude Code...${NC}\n"
claude
5. Best Practice Setup (Personal Local Machine)
This setup follows standard Linux conventions and works cleanly with Claude Code.
5-1. Install the Script Globally
mkdir -p ~/.local/bin
mv claude-ds.sh ~/.local/bin/claude-ds
chmod +x ~/.local/bin/claude-ds
Now you can run it from anywhere:
claude-ds
5-2. Ensure ~/.local/bin Is in PATH
Add to ~/.bashrc if needed:
export PATH="$HOME/.local/bin:$PATH"
5-3. Store the DeepSeek API Key in .bashrc
# ~/.bashrc
export DEEPSEEK_API_KEY="sk-xxxxxxxxxxxxxxxx"
Apply:
source ~/.bashrc
chmod 600 ~/.bashrc
Why This Is Best Practice (for Personal Machines)
- No hardcoded secrets
- Centralized configuration
- Works in any directory
- Matches Claude Code’s env-based design
⚠️ This approach is intended for personal machines only.
On shared servers or public dotfile repos, use.envfiles or a secret manager.
6. Claude 4.5 Sonnet vs DeepSeek-Reasoner (Claude Code Perspective)
This is how the two models complement each other in practice:
| Category | Claude 4.5 Sonnet | DeepSeek-Reasoner |
|---|---|---|
| Primary role | Default daily driver | Cost-efficient reasoning engine |
| Codebase understanding | Excellent | Very strong |
| Agent-style workflows | Best-in-class | Strong |
| Multi-step reasoning | Very good | Excellent |
| Long sessions | ❌ Expensive | ✅ Affordable |
| Best use cases | General development, refactoring | Deep logic, validation, long analysis |
Recommended strategy
- Use Claude 4.5 Sonnet for most coding
- Switch to DeepSeek-Reasoner when:
- Logic gets complex
- Sessions get long
- Cost starts to matter
7. Final Thoughts
Instead of forcing a single “perfect” model, this setup embraces a multi-model workflow:
- Design → DeepSeek-Reasoner for architectural reasoning and trade-off analysis
- Development → Claude 4.5 Sonnet for accurate, context-aware implementation
- Code Review → DeepSeek-Reasoner for logical validation, Claude 4.5 Sonnet for code quality
- Testing → DeepSeek-Reasoner to identify edge cases, Claude 4.5 Sonnet to implement tests
By assigning each model to what it does best, Claude Code becomes both more powerful and more cost-efficient—without any proxies, routers, or glue code.
Thanks to DeepSeek’s Anthropic-compatible endpoint, this is now possible without proxies, routers, or custom glue code.
For developers using Claude Code seriously, this is one of the cleanest and most practical setups available today.