"Can I use Claude Code and Codex for free?" is one of the most-searched questions in AI coding right now — and almost every answer you'll find is either wishful thinking or a thinly-veiled pitch for something sketchy (cracked API keys, shared logins, "VPN tricks"). So here's the version a working engineer actually needs: the truthful breakdown of what costs $0, what doesn't, where the genuinely free tools are, and how to legitimately cut your AI coding bill close to nothing — without getting your account banned or your laptop compromised.
No piracy, no fraud, no "exploits." Just what's real in June 2026.
TL;DR
- Claude Code is not free. There is no free Claude Code tier — you need Claude Pro ($20/mo), Max ($100/$200), or pay-as-you-go API credits. The free claude.ai chat does not include the Claude Code CLI.
- Codex is free-ish. Codex (including the Codex CLI) is included in the ChatGPT Free plan at $0 — but with the lowest usage limits of any plan. Enough to try it; not enough to live in it.
- The genuinely free, no-credit-card-trap options for daily work are Gemini CLI (≈1,000 model requests/day free), GitHub Copilot Free (2,000 completions + 50 premium chat requests/month, agent mode + CLI), and local models like Qwen3-Coder.
- You can run a serious AI-assisted workflow for $0–$20/month legitimately by combining a free CLI for the bulk and a single paid tool for the hard 10%.
- The "free Claude Code via VPNs, shared keys, or cracked installers" hacks don't work, violate terms, or are security risks. Skip them.
The short answer: free vs. paid in 2026
Let's define the thing precisely, because "free" hides a lot of nuance. A free AI coding tool is one where you can do real coding work at $0 with no trial clock and no credit card required. By that standard, here's the lay of the land:
The headline: the agent everyone wants for free — Claude Code — is the one with no free tier. But the work it does isn't magic, and there are free and near-free ways to get 80–90% of the value. Let's go tool by tool.
Is Claude Code free?
No. This is the part people don't want to hear, so let's be exact about it.
Claude Code — the terminal/IDE agent — is not a standalone free product. To use it you need one of:
So the closest thing to "free Claude Code" is: spin up a new API account, use the small free starter credits to run a few sessions, and stop before they're exhausted. That's legitimate and genuinely free — for a little while. After that, Pro at $20/month is the real floor.
The one honest 'free Claude Code' move
New Anthropic API accounts come with a small amount of free credit for testing. You can point Claude Code at an API key and run a handful of real sessions on those credits before any charge. It's finite and not renewable, but it's a legitimate way to try the actual agent — not a chatbot — at $0.
Is Codex free?
Yes — more than people realize. Unlike Claude Code, Codex is bundled into the free ChatGPT plan. As of 2026, the Codex CLI is available with ChatGPT sign-in on every plan, including Free ($0/month). You get the real CLI agent, drawing from the same 5-hour-window usage limits as the Codex web and IDE surfaces — just at the lowest limits of any tier.
The catch is exactly that limit. On April 2, 2026 OpenAI moved Codex to token-based usage instead of per-message counts, and the free tier's allowance is small — the earlier promotional boost to free limits has ended. It's enough to evaluate Codex properly and do occasional real work; it's not enough to delegate all day. If you outgrow it:
- ChatGPT Go ($8/mo) — a cheap step up that still includes the Codex CLI.
- ChatGPT Plus ($20/mo) — expanded Codex usage across CLI, web, IDE, and iOS, with roughly a full working day of typical delegation (tens of cloud tasks and 100+ local messages per 5-hour window).
- Pro ($100+/mo) — 5× or 20× the Plus limits for heavy users.
For API-key usage instead of a subscription, gpt-5.3-codex bills around $1.75 per million input tokens and $14 per million output tokens — relevant only if you're scripting Codex rather than using your ChatGPT plan.
If you want a free agent CLI today
Codex CLI on the free ChatGPT plan is the single easiest "real agent, $0, signed in with an account you already have" option. Start there, see if the limits fit your day, and only pay if they don't.
The genuinely free options (ranked for real work)
If your actual goal is "do serious AI-assisted coding without paying," stop trying to get Claude Code for free and use the tools that are designed to be free. Here's how they really stack up:
A realistic free stack looks like this: Gemini CLI as your daily driver, Copilot Free for inline autocomplete in the editor, Codex CLI on free ChatGPT for a second opinion, and a local model for the private or offline stuff. That combination costs $0 and covers the overwhelming majority of everyday work.
For the local route specifically — running a capable coding model entirely on your own machine, no subscription, no API bill — I went deep on the setup, hardware reality, and which models are worth it here: The Local LLM Coding Revolution: Qwen3-Coder on Your Desktop.
How to slash your AI coding bill legitimately
Maybe you've decided the hard 10% is worth paying for — you want Claude Code or Plus-tier Codex for the genuinely tough work. Fine. Here's how to keep that bill as close to $0 as possible without breaking any rules:
The biggest lever by far is the first one: match the tool to the task. Most coding-agent work — renaming, refactoring, writing tests, fixing obvious bugs — doesn't need a frontier model. Send that to a free CLI and you'll find the only thing you actually pay for is the small fraction of genuinely hard reasoning. For help deciding which paid agent earns that slot, see Cursor vs Claude Code vs Copilot.
What NOT to do (the "free" traps that backfire)
The dark-pattern corner of this topic is full of advice that ranges from terms-violating to outright dangerous. To save you the trouble:
- Cracked or shared subscriptions / API keys — terms violation, instant ban risk, and you're trusting a stranger with code-execution access to your machine.
- "VPN to unlock free credits / get paid" — circumventing geographic or payment (KYC) controls is fraud, not a hack. On coding subscriptions it gets accounts terminated; on any ad or referral program it's explicitly banned and any balance clawed back.
- Random "free Claude Code unlocker" downloads — these are a classic vector for credential-stealing malware. A coding agent runs with deep access to your filesystem and shell; never install one from an untrusted source. (If you want to understand why that access is so dangerous, my piece on AI agent attacks on developers walks through real cases.)
The legitimate free options above are better than any of these and won't get you burned. There's simply no reason to go down the sketchy road.
The bottom line
Can you use Claude Code and Codex for free? Codex, yes — within limits. Claude Code, not really — but you barely need to. The honest play in 2026 is to stop hunting for a Claude Code loophole and build a free-first stack: a generous free CLI for the bulk, a local model for the private stuff, and a single $20 subscription reserved for the hard problems that genuinely justify it. That setup gives a paying user's results for $0–$20 a month — no piracy, no fraud, no banned accounts.
Skip the "free unlocker" rabbit hole entirely — the legitimate free stack above gets you a paying user's results without the risk. Still deciding which paid agent deserves your one subscription? Start with Cursor vs Claude Code vs Copilot.
Written for umesh-malik.com — no-fluff technical writing on AI, web dev, and engineering.
Originally published at umesh-malik.com
Keep reading on umesh-malik.com:
Top comments (0)