# 🤖 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
sudo npm install -g @anthropic-ai/claude-code
⏳ 2–3 minute lagenge
Done hone pe verify karo:
claude --version
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
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!
No API key. No billing. Laptop pe locally. Internet bhi nahi chahiye after setup.
brew install ollama
Homebrew nahi hai? Pehle brew.sh se install karo.
Ya directly download: ollama.ai → Download for Mac
# Best for coding (~5GB):
ollama pull gemma3
# Lighter option (~2GB):
ollama pull qwen2.5-coder:3b
ollama serve
⚠️ Ye terminal tab open rehni chahiye — band mat karna
config.json khulega{
"models": [
{
"title": "Gemma 3 (Free Local)",
"provider": "ollama",
"model": "gemma3"
}
]
}
| 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.
Setup kuch nahi. Bas browser kholo.
⚠️ Limited messages per day — beginners ke liye enough hai
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.
"Explain this code to me"
"Fix the bug in this file"
"Write a Python script that does X"
"Refactor this function to be cleaner"
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