Back to feed
Dev.to
Dev.to
5/12/2026
Run Claude code locally for

Run Claude code locally for

Original: Run Claude Code Locally for Free with Docker Model Runner

Short summary

Run Claude Code locally with Docker Model Runner to cut API costs and protect proprietary code. Set ANTHROPIC_BASE_URL to localhost, pull models like Phi4 via docker model pull, and configure context sizes for project complexity.

  • Use Docker Model Runner to run local LLMs instead of Anthropic's cloud API, eliminating token costs
  • Configure Claude Code with ANTHROPIC_BASE_URL environment variable and specify models via --model flag
  • Pull and customize open models (Phi4, GPT-oss) with adjustable context windows for larger codebases

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Explore more