# 🤖 Free Claude Code Setup on Mac
**By @chaotechh** — Step-by-step guide, 3 methods

---

## Pehle samjho — Claude Code kya hai?

Claude Code = Anthropic ka AI coding assistant jo **terminal mein directly kaam karta hai.**
Code likhta hai, bugs fix karta hai, poori files edit karta hai — sirf ek prompt se.

---

## 3 Methods — Ek Nazar Mein

| | ⚡ Method 1 | 🆓 Method 2 | 😊 Method 3 |
|---|---|---|---|
| **Name** | Free API Credits | Ollama (Local) | Claude.ai Web |
| **Cost** | Free credits, then paid | 100% free forever | Free (limited/day) |
| **Setup time** | 5 min | 20 min | 2 min |
| **Internet** | Haan | Setup ke baad nahi | Haan |
| **Best for** | Serious coders | Privacy + zero cost | Beginners |

---

## ⚡ Method 1 — Free API Credits
> Fastest. New account pe free credits milte hain.

### Step 1 — Node.js Install Karo
1. [nodejs.org](<https://nodejs.org>) pe jao
2. **LTS version** download + install karo
3. Terminal mein check karo:
```bash
node --version

✅ v18 ya usse upar aana chahiye


Step 2 — Claude Code Install Karo

sudo npm install -g @anthropic-ai/claude-code

⏳ 2–3 minute lagenge

Done hone pe verify karo:

claude --version

Step 3 — Anthropic Account + API Key

  1. console.anthropic.com pe jao
  2. Sign up karo (Google login supported)
  3. Left menu → API Keys → Create Key
  4. Key copy karo — sirf ek baar dikhti hai, abhi save karo

Step 4 — API Key Set Karo

export ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxx

Permanent karne ke liye (har baar set nahi karna padega):

echo 'export ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxx' >> ~/.zshrc
source ~/.zshrc

Step 5 — Run Karo

cd ~/Desktop
mkdir my-ai-project
cd my-ai-project
claude

Welcome screen aayegi. Try karo:

Create a simple Python script that prints hello world

🎉 Ho gaya!


🆓 Method 2 — Ollama + Local Model

No API key. No billing. Laptop pe locally. Internet bhi nahi chahiye after setup.

Step 1 — Ollama Install Karo

brew install ollama

Homebrew nahi hai? Pehle brew.sh se install karo.

Ya directly download: ollama.ai → Download for Mac


Step 2 — Free AI Model Download Karo

# Best for coding (~5GB):
ollama pull gemma3

# Lighter option (~2GB):
ollama pull qwen2.5-coder:3b

Step 3 — Ollama Server Start Karo

ollama serve

⚠️ Ye terminal tab open rehni chahiye — band mat karna


Step 4 — VS Code Extension Install Karo

  1. VS Code kholo
  2. Extensions (Cmd+Shift+X) → "Continue" search karo
  3. Install karo
  4. Left sidebar mein Continue icon dikhega

Step 5 — Ollama se Connect Karo

  1. Continue sidebar → gear icon ⚙️ click karo
  2. config.json khulega
  3. Ye add karo:
{
  "models": [
    {
      "title": "Gemma 3 (Free Local)",
      "provider": "ollama",
      "model": "gemma3"
    }
  ]
}
  1. Save (Cmd+S)

Step 6 — Use Karo

Shortcut Kya karta hai
Cmd + I Selected code ko inline edit karo
Cmd + L Chat sidebar kholo
Right click → Edit with Continue Kisi bhi code pe AI apply karo

✅ Zero cost. Forever.


😊 Method 3 — Claude.ai Web (Simplest)

Setup kuch nahi. Bas browser kholo.

  1. claude.ai pe jao
  2. Free account banao
  3. Code paste karo, questions pucho

⚠️ Limited messages per day — beginners ke liye enough hai


🔧 Common Errors aur Fix

command not found: claude

source ~/.zshrc

Nahi hua? Terminal completely band karke dobara kholo.


permission denied error npm install pe

sudo npm install -g @anthropic-ai/claude-code

Password maangega — apna Mac password daalo.


API key invalid → Key copy karte waqt extra space aa gayi hogi. Anthropic console se dobara copy karo.


Ollama model bahut slow hai

ollama pull qwen2.5-coder:1.5b

→ Ye sirf 1.5GB hai, faster chalega.


npm: command not found → Node.js install nahi hua. Method 1 ka Step 1 dobara karo.


🚀 Setup Ho Gaya? Ab Ye Try Karo

"Explain this code to me"
"Fix the bug in this file"
"Write a Python script that does X"
"Refactor this function to be cleaner"

📲 Aur Chahiye?

Mere baaki AI tools reels ke liye follow karo 👉 @chaotechh

Koi step mein stuck ho? Neeche comment karo ya DM karo — help karunga. 🙌


Last updated: April 2026