Claude Code is powerful but tokens add up fast. Run it 100 percent free with Ollama and Gemma4 for 80 percent of tasks — then save paid Claude Sonnet or Opus calls for the complex work. Anthropic officially supports this via the ANTHROPIC_BASE_URL env var. Drop your token bill 80 percent with this smart split.

— What You Will Learn —
0:02 Hook — Claude Code for free forever
0:12 The Smart Split (Gemma4 vs Sonnet work)
0:23 Install in 60 seconds
0:34 One-shot launch command
0:45 Gemma4 sizes — switch /model anytime
0:56 Free Guide + Subscribe

— Key Points —
— Gemma4 handles renames, formatting, docstrings, commits, small refactors
— Claude Sonnet or Opus handles architecture, debugging, migrations, big features
— One command install: ollama launch claude –model gemma4:e4b
— CRITICAL: set OLLAMA_CONTEXT_LENGTH=131072 (128K) or Claude Code breaks
— Manual env: ANTHROPIC_AUTH_TOKEN=ollama, ANTHROPIC_API_KEY= empty, ANTHROPIC_BASE_URL=http://localhost:11434
— Gemma4 sizes: e2b, e4b (recommended), 26b, 31b vision
— Switch models inside Claude Code with /model command
— Fully offline, private, no cloud dependency for local tasks

— Links —
— Ollama + Claude Code Docs: https://docs.ollama.com/integrations/claude-code
— Gemma4 Model Page: https://ollama.com/library/gemma4
— Claude Code: https://www.anthropic.com/claude-code
— Ollama Download: https://ollama.com/download
— Anthropic Pricing: https://www.anthropic.com/pricing
— Free Guide: https://drive.google.com/file/d/1xoLyoLdKWR2NZrVC40rSpRaaJjbGmSsf/view?usp=drivesdk

— Recommended Channels —
3Blue1Brown, Two Minute Papers, freeCodeCamp, Matt Wolfe, Matthew Berman, DeepLearning.AI, Krish Naik, Sentdex, Yannic Kilcher, Nate Herk

#ClaudeCode #Ollama #Gemma4 #Anthropic #LocalLLM #OpenSourceAI #AICoding #FreeAI #AIDeveloper #DevTools #TokenSaving #AIProductivity #shorts