Skip to content

JohnnyFoulds/claude-code-free

Repository files navigation

Claude Code — Free

A full AI pair programmer in VS Code, running locally in a container, connected and ready in 2 minutes — at zero cost.

License: MIT Docker Pulls Docker Image Size

This is Claude Code — Anthropic's own coding agent — running against free models via OpenRouter. No Anthropic subscription. No credit card. One free API key and one command.

Claude Code Free demo


Install

Platform Command
Mac / Linux curl -fsSL https://raw.githubusercontent.com/JohnnyFoulds/claude-code-free/main/install.sh | bash
Windows (PowerShell) irm https://raw.githubusercontent.com/JohnnyFoulds/claude-code-free/main/install.ps1 | iex

The installer checks that Docker is running, walks you through getting a free OpenRouter API key, pulls the container, and configures VS Code Remote SSH.

Requirements: Docker Desktop · VS Code · Remote - SSH extension


Usage

Connect from VS Code:

  1. Cmd+Shift+PRemote-SSH: Connect to Hostclaude-code-free
  2. Open a terminal and run:
cd /workspace
claude

Your /workspace directory persists across container restarts. You can also connect via SSH directly:

Note: Claude Code runs in bypassPermissions mode inside this container — it will not prompt before reading, writing, or deleting files. This is intentional for a development container where you control the workspace. Do not mount directories you are not comfortable giving Claude Code full access to.

ssh -p 2223 coder@localhost

Start and stop

Mac / Linux

docker compose -f ~/.claude-code-free/docker-compose.yml up -d   # start
docker compose -f ~/.claude-code-free/docker-compose.yml down    # stop

Windows (PowerShell)

docker compose -f "$env:USERPROFILE\.claude-code-free\docker-compose.yml" up -d   # start
docker compose -f "$env:USERPROFILE\.claude-code-free\docker-compose.yml" down    # stop

Switching models

The installer prompts you to choose a model. Change it any time by editing ~/.claude-code-free/.env:

OPENROUTER_MODEL=qwen/qwen3-coder:free

Then restart the container:

docker compose -f ~/.claude-code-free/docker-compose.yml down
docker compose --env-file ~/.claude-code-free/.env -f ~/.claude-code-free/docker-compose.yml up -d

Note: Claude Code's built-in /model command is designed for Anthropic's model roster and does not work with OpenRouter model IDs. Use .env as shown above.

Models worth trying

The default model is chosen for rate-limit headroom, not peak quality. For the best coding results with occasional use, try qwen/qwen3-coder:free. For private code, avoid the gpt-oss and gemma free tiers — their providers train on your prompts.

Model Context Req/min Notes
stepfun/step-3.5-flash:free 256K 50 Default — best availability; SWE-bench 74%
qwen/qwen3-coder:free 262K 8 Best coding quality; privacy-safe (Venice)
openai/gpt-oss-120b:free 131K ⚠ Free provider trains on your prompts
openai/gpt-oss-20b:free 131K ⚠ Free provider trains on your prompts
nvidia/nemotron-3-super-120b-a12b:free 262K ⚠ NVIDIA logs all prompts (trial use only)
meta-llama/llama-3.3-70b-instruct:free 65K 8 Simple tasks; context halved on free tier
google/gemma-3-27b-it:free 131K ⚠ No tool use on free tier — incompatible with Claude Code

Full list at openrouter.ai/models?q=free. See the model guide for benchmark comparisons, pricing, and privacy details.


How it works

Your machine
├── VS Code  ──── Remote SSH ────► Docker container (johannesfoulds/claude-code-free)
│                                  ├── Claude Code CLI
│                                  ├── Node.js 22
│                                  ├── Python 3 + w3m + curl
│                                  └── /workspace  (your files, persisted via volume)
│
└────────────────────────────────► OpenRouter API ──► your chosen model

Claude Code speaks the OpenAI API format. This project points it at OpenRouter, which proxies that format to whichever model you select.


What's inside

Component Details
OS Debian (node:22-slim)
Claude Code Latest stable release
Node.js 22 LTS
Python 3 (system)
Web access w3m, curl, markdownify — the model can browse URLs and search the web via Bash

Why use this

Anthropic's Claude Code requires a Claude Pro subscription ($20/month) or API credits. This project lets you run the same interface against free models on OpenRouter at no cost.

This project Claude Pro
Cost Free $20/month
Setup One command Built-in
Models Any OpenRouter model Claude only
Code stays on your machine Yes No

Good fit if you

  • Want to try Claude Code before committing to a subscription
  • Are a student or working in a cost-sensitive environment
  • Want to experiment with different models through the same interface

Stick with Claude Pro if you

  • Do serious daily coding work — the quality difference is real
  • Need the latest Claude Sonnet or Opus models

On the free tier

OpenRouter's free models are community-supported. Rate limits, availability, and which models are offered at no cost can change without notice. If you find yourself using this setup regularly, consider adding credits to your OpenRouter account — even a small balance gives you higher rate limits and access to a broader model selection. OpenRouter is pay-as-you-go with no subscription, and most requests cost a fraction of a cent under normal coding use.


Uninstall

Mac / Linux — run in a terminal:

docker compose -f ~/.claude-code-free/docker-compose.yml down --volumes
rm -rf ~/.claude-code-free
# Remove the 'claude-code-free' entry from ~/.ssh/config

Windows — run in PowerShell:

docker compose -f "$env:USERPROFILE\.claude-code-free\docker-compose.yml" down --volumes
Remove-Item -Recurse -Force "$env:USERPROFILE\.claude-code-free"
# Remove the 'claude-code-free' entry from %USERPROFILE%\.ssh\config

Contributing

Bug reports and pull requests are welcome. Please open an issue first for significant changes.

License

MIT © Johannes Foulds

About

Run Claude Code free on any laptop — one-liner installer using Step-3.5-Flash via OpenRouter

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors