# Stop Paying for Claude Code! Use it for FREE

Source: https://www.youtube.com/watch?v=kRS7DSDzo-c
Recap page: https://rapidrecap.app/video/kRS7DSDzo-c
Generated: 2026-02-06T14:37:12.46+00:00

---
## Quick Overview

Users can run Anthropic's Claude Code locally for free by installing Ollama and then using the `ollama pull` command to download compatible open-source models like gpt-oss:20b, which bypasses the high cost associated with directly using paid Claude API models.

**Key Points:**
- The primary method to use Claude Code for free involves running it locally via Ollama, which serves as a local, Anthropic-compatible API.
- Users must first download Ollama from ollama.com and then install Claude Code using the curl command: `curl -fsSL https://claude.ai/install.sh | bash` (01:47).
- After installation, the user selects a local model via `ollama launch claude --config` (02:11) or `ollama launch claude` (01:57), with `gpt-oss:20b` being demonstrated as a viable option (01:15).
- The video contrasts the free local setup with the high cost of the official Claude API, showing that Opus 4.6 costs $5/MTok for base input tokens (02:50).
- Claude Code successfully generated and edited an `index.html` file for an 'AI Agency' website after confirming the model selection (02:42).
- The current local configuration for the Anthropic base URL is set to `http://localhost:11434` within the `~/.claude/settings.json` file (04:15).
- The creator advises viewers to watch a follow-up video for a guide on running Claude Code with more advanced models (04:33).

![Screenshot at 01:17: The terminal confirms successful installation of Claude Code version 2.1.32 via the curl script, providing the user with the next command to run for getting started.](https://ss.rapidrecap.app/screens/kRS7DSDzo-c/00-01-17.jpg)

**Context:** This tutorial explains how developers can leverage Anthropic's Claude Code, an agentic coding tool, without incurring the high costs of its official API by configuring it to use open-source Large Language Models (LLMs) running locally via the Ollama framework. The video demonstrates the necessary installation steps for both Ollama and Claude Code, and shows how to select and run a local model to perform coding tasks directly within the IDE environment.

## Detailed Analysis

The video demonstrates how to use Claude Code for free by running it locally using Ollama, which emulates the required Anthropic API locally. The process begins by downloading and installing Ollama from its website (00:06). Next, Claude Code itself is installed using a curl command in the terminal: `curl -fsSL https://claude.ai/install.sh | bash` (01:47), which successfully installs version 2.1.32 (01:53). Following installation, the user interacts with Ollama to pull a model; specifically, `ollama pull gpt-oss:20b` is run, downloading the 13GB model (01:15). The high cost of using the official Claude Opus 4.6 model via API (starting at $5/MTok for input tokens) is shown for contrast (02:50). To begin using Claude Code locally, the command `ollama launch claude --config` (02:04) prompts the user to select a local model from the list, such as `gpt-oss:20b` (02:22). Upon launching, Claude Code starts using the local model (02:27) to fulfill a request: 'create a one page website, with basic information about AI Agency' (02:39). The tool searches for patterns, opens changes in Visual Studio Code, and prompts for confirmation to edit `index.html` (02:42). After accepting the edits, the HTML file is generated with basic styling and content for the AI Agency website (02:58). Finally, the video shows how to check the configuration file, `~/.claude/settings.json` (04:12), confirming that the `ANTHROPIC_BASE_URL` points to `http://localhost:11434`, which directs Claude Code to the local Ollama instance.

### Setup Prerequisites

- Download Ollama from ollama.com
- Install Claude Code via curl script
- Check Claude API pricing to understand cost savings

### Model Acquisition

- Pull a local model using `ollama pull <model_name>`, demonstrating the download of `gpt-oss:20b` (13 GB) (01:15)

### Launching Claude Code

- Use `ollama launch claude --config` to select a locally pulled model (02:04)
- Demonstrated selecting `gpt-oss:20b` (02:22)

### Code Generation Demonstration

- Requested Claude Code to 'create a one page website, with basic information about AI Agency' (02:39)
- Model executed the task, creating and editing `index.html` (02:42)

### Configuration Verification

- Check settings via `cat ~/.claude/settings.json` (04:12)
- Verified environment variables like `ANTHROPIC_BASE_URL` point to `localhost:11434` (04:15)

### Model Status Check

- Use `/status` command to view active model (Model: gpt-oss:20b) and connection details (03:54)

![Screenshot at 00:00: The initial terminal screen showing Claude Code v2.1.32 welcoming user Praison, running Opus 4.6 context.](https://ss.rapidrecap.app/screens/kRS7DSDzo-c/00-00-00.jpg)
![Screenshot at 00:06: The Ollama homepage showing the slogan "What will you build?" and the download button, emphasizing local model usage.](https://ss.rapidrecap.app/screens/kRS7DSDzo-c/00-00-06.jpg)
![Screenshot at 01:17: Terminal output confirming successful download and installation of Claude Code \(Version: 2.1.32\).](https://ss.rapidrecap.app/screens/kRS7DSDzo-c/00-01-17.jpg)
![Screenshot at 02:42: Claude Code interface within VS Code, showing the prompt to accept changes to index.html generated by the AI.](https://ss.rapidrecap.app/screens/kRS7DSDzo-c/00-02-42.jpg)
![Screenshot at 03:54: Output of the /status command in the terminal, confirming the active model is gpt-oss:20b and the Anthropic base URL is set to localhost.](https://ss.rapidrecap.app/screens/kRS7DSDzo-c/00-03-54.jpg)
