📌 Quick Summary: This complete Claude Code tutorial teaches you how to install Anthropic's Claude Code CLI, set up MCP (Model Context Protocol) servers, use skills from sksh.sh, save tokens efficiently, and add new features with AI. Also includes a free alternative – Gemini CLI – with generous limits. Perfect for beginners and pros.
🚀 Claude Code Tutorial – Complete Beginner to Pro Guide (2026)
After reading this guide, you will be able to use Claude Code like a pro. You’ll learn tips and tricks that I’ve learned from my experience as an indie hacker (solopreneur). I build applications on my own using AI and earn from them. This is a complete workflow guide covering setup, MCP, skills, token optimization, feature addition, and even a free alternative.
📥 1. How to Install Claude Code CLI
To install Claude Code, visit the official Claude Code website. You will see a command (like npm install -g @anthropic-ai/claude-code). Copy it, open your terminal, paste the command, and press Enter. This will load Claude Code on your machine. After installation, restart your terminal (close and reopen). Then type claude and press Enter.
The setup will appear – select your preferred mode (I recommend Dark Mode). To use Claude Code, you need either a Claude Pro subscription, the Claude API, or a third‑party platform. Free third‑party APIs are also starting to support Claude Code – I’ll cover them in a separate guide. For now, sign in with your Claude Pro account.
🔐 2. Sign In & First Launch
When you run claude for the first time, your browser will open for authentication. Sign in with your Claude account, authorise access, and you will receive a numeric code. Paste that code into the terminal and press Enter. After successful login, press Enter through the security notes.
Your Claude Code terminal interface will open. To start using it for a project, navigate to your project folder and type claude again.
⚙️ 3. Modes: Normal, YOLO, and Plan
Press Shift + Tab to cycle through three modes:
- YOLO mode – automatically accepts file edits and runs terminal commands without asking for permission. Best when you trust the AI and want speed.
- Plan mode – Claude first creates a detailed plan for your task, asks for your review and possibly modifications, then executes after your approval. Ideal for complex features.
- Normal mode – asks for permission at every file edit and every command. Most safe and recommended for beginners.
You can switch between these modes at any time.
🤖 4. Model Selection: Haiku, Sonnet, Opus
Type /model in the chat to select which AI model to use:
- Haiku – smallest, most affordable, extremely fast. Perfect for small tasks like renaming variables, simple bug fixes, or formatting.
- Sonnet – medium model, excellent for coding. It is the default. Uses fewer tokens than Opus and works great for most development work.
- Opus – top‑tier, most intelligent but very expensive. Use only for complex reasoning, architecture design, or when Sonnet fails. Your limits will be exhausted quickly.
You can also adjust effort with /effort (low / medium / high). I keep it on medium to save tokens. High effort makes Claude think deeper but uses more tokens.
📄 5. CLAUDE.md – The Secret to Context Management
CLAUDE.md is a file you place in your project root. It contains an overview of your project structure, tech stack, important files, and development notes. Before starting any task, Claude reads this file – so even after clearing a session, it retains full context. This saves significant tokens because Claude doesn’t have to re‑analyse the entire codebase every time.
How to create it: After Claude has built the initial project structure, ask in the same chat: “Create a CLAUDE.md file for this project”. Claude will generate a well‑structured file. Never create it before you have a project structure – do it after. The file should include folder structure, main technologies, key components, and any conventions you follow.
To clear a session and start fresh, type /clear. Then Claude will read CLAUDE.md and be ready to work immediately.
📊 6. Status Line & Usage Limits
Type /status to generate a status line at the bottom of your terminal. It shows folder name, model name, token usage, and your remaining limits. Claude Code uses a 5‑hour rolling window limit. If you start at 12:00 PM, your session lasts until 5:00 PM. The status line shows what percentage of the limit you have used and when it resets.
You can also view limits in Settings → Usage. There is also a weekly limit. The status line can be customised. To do that, navigate to the Claude config folder (~/.claude on Mac/Linux) and edit the status file. You can copy a custom status line configuration from online resources – I will provide a ready‑made configuration on my website.
⌨️ 7. Terminal Shortcut (Alias)
To avoid typing claude every time, create an alias. Open your shell config file: for Mac – code ~/.zshrc, for Linux or Windows Git Bash – code ~/.bashrc. Add the line: alias ccd='claude'. Save, close and restart the terminal. Now type ccd to launch Claude Code instantly.
🔌 8. MCP (Model Context Protocol) – Connecting External Apps
MCP is a game changer. Before MCP, Claude Code only knew what was in its training data. Now, MCP connects external applications – like Notion, Google Drive, or documentation servers. The biggest use case is live documentation. For example, if you use a new framework version (Astro 6, Tailwind 4, Next.js 15), Claude’s training might be outdated. By adding an MCP server for that framework’s documentation, Claude can fetch the latest docs and generate accurate code without errors.
How to add an MCP server: Search for “[framework name] MCP” on Google. For Astro, you will find “Astro MCP server”. Copy the command (often npx -y @astrojs/mcp-server). Exit Claude Code (Ctrl+C twice), then paste the command into your terminal. The MCP will be installed. You can verify with /mcp inside Claude Code – you’ll see the active servers.
You can install MCP globally (using --scope global) or per project. After installation, when you prompt Claude to work with that framework, it will automatically use the MCP server to fetch the latest documentation.
🧠 9. Skills – Reusable Instructions for Quality Output
Skills are specific instruction sets for repetitive tasks – like “premium frontend design”, “backend security”, “Next.js best practices”, “clean architecture”. Instead of writing the same lengthy prompt each time, you create a skill. Visit sksh.sh – a website with hundreds of community skills. Search for what you need, copy the command (e.g., npx sksh frontend-design).
To install a skill: Navigate to your project folder, paste the command, select the target AI (Claude Code), and choose “symlink” (creates a shortcut, saves disk space). After installation, the skill is stored in .claude/skills. You can now mention it in your prompt: “Use the frontend design skills for the landing page.”
Skills ensure consistent quality. The difference between a generic design and a premium design is often just using the right skill. You can also create your own skills by writing markdown files in the skills folder.
💰 10. Token Saving Tricks (Make Limits Last Longer)
Tokens are the currency of AI agents. Here are practical ways to reduce consumption:
- Use /clear frequently – After 2‑4 tasks, clear the session. Otherwise, every new prompt includes the entire conversation history, exponentially increasing token use.
- Manual summarisation – Instead of
/compact(which still uses tokens), ask Claude: “Summarise our entire conversation so I can start a new session with this context.” Copy the summary,/clear, then paste the summary followed by your next task. This saves huge token counts. - Divide large tasks – Do not give one giant prompt like “create full website”. Break it into smaller steps: “create database schema”, then “create API”, then “create frontend”.
- Use CLAUDE.md – as explained earlier, reduces re‑analysis.
- Use Sonnet (not Opus) – Opus costs many more tokens.
- Use Haiku for simple edits – if you just need to rename a variable or fix a typo, switch to Haiku.
🔄 11. Adding New Features & Reviewing with Git + Second AI
When you add a new feature, use Git for version control. Commit your working code before asking AI to add features. Then give Claude the command: “Add a signup page to this project.”
Review with a second AI agent: You can use a different AI (e.g., Gemini CLI) to review the changes. Open a new terminal, navigate to the same project, and run your second AI (gemini). Ask: “Use git diff to review the new feature added, find bugs/issues, and give suggestions.” The second AI will analyse the changes. Copy its suggestions and give them back to Claude Code to fix. This multi‑agent workflow catches mistakes that one model might miss.
To use Git with Claude, ensure Git is installed. After each major change, commit with a meaningful message. You can revert bad changes easily using git reset.
🆓 12. Free Alternative – Gemini CLI (Claude Code Replacement)
Claude Code has limits (5‑hour rolling window). When you run out, or if you want a completely free option, use Gemini CLI (from Google). It has much higher limits (1,000+ requests per day) and supports MCP and skills similarly. Gemini CLI can be used alongside Claude Code. I often switch to Gemini CLI when my Claude limit is exhausted.
Gemini CLI uses Google’s Gemini models (1.5 Pro, 1.5 Flash). It is highly optimised and gives you up to 1,500 requests/day if you claim Google AI Pro (available free for Jio users in India). The workflow is almost identical: you install via npm, run gemini, sign in with Google, and you can use YOLO mode, sandbox, and even load skills. I have a separate detailed guide on this website for Gemini CLI – check it out.
🛠️ 13. Live Example: Building an Astro 6 Website with MCP & Skills (Step by Step)
Here is a real example that shows the power of MCP and skills. We will build a Font Extractor website using Astro 6, Tailwind CSS, and the AstroDocs MCP:
- Create a new Astro 6 project:
npm create astro@latest fontextractor.com– run this command yourself in the terminal. Do NOT waste tokens asking Claude to create the boilerplate. Leave all options as default. - Install Git if not already installed (to enable rollback). Then initialise git and make the first commit.
- Install AstroDocs MCP – search “Astro MCP” on Google, find the command for Claude Code CLI. Copy it, exit Claude Code if open, paste in terminal and press Enter. This adds the documentation server.
- Install a frontend design skill – go to sksh.sh, search “frontend design”, copy the command. In your project folder, run it, select Claude Code, choose symlink. This adds premium UI design instructions.
- Launch Claude Code in the project folder:
ccd(orclaude). - Give a prompt: “Create a Font Extractor website landing page using Astro and Tailwind CSS. Make sure to use the AstroDocs MCP for accurate Astro 6 code and apply the frontend design skills for a modern, premium UI.”
- Claude will fetch the latest Astro 6 documentation via MCP and apply the design skill. It will create multiple files (index.astro, components, CSS, etc.) and run
npm installautomatically. - After the page is built, ask Claude: “Create a CLAUDE.md file for this project.” Store it for future sessions.
- Run the dev server (
npm run dev) and view your stunning landing page.
This real example shows that using MCP and skills together eliminates version mismatch errors and produces professional results in minutes.
Gemini CLI 2026 - Free Claude Code Alternative (No GPU, 1000+ Requests/Day)❓ Frequently Asked Questions (15+ Questions Answered)
Q1: Is Claude Code free?
A: Claude Code requires a Claude Pro subscription or API credits. However, there are free third‑party APIs and alternative tools like Gemini CLI.
Q2: How do I check my remaining limits?
A: Use the status line (/status) or go to Settings → Usage.
Q3: Can I use Claude Code on Windows?
A: Yes, via WSL (Windows Subsystem for Linux) or Git Bash. The installation commands are the same.
Q4: What is the best model for coding?
A: Claude Sonnet 3.5 – good balance of quality and token cost.
Q5: Where do I find more MCP servers?
A: Search “[tool name] MCP” on Google. Or ask Claude Code to help install one. Many are listed on GitHub.
Q6: Are skills from sksh.sh safe?
A: Most are community‑contributed and safe. Review the skill’s content before using. You can also create your own skills.
Q7: How do I update Claude Code?
A: Run npm update -g @anthropic-ai/claude-code.
Q8: What is the 5-hour limit exactly?
A: It is a rolling window. Your session starts when you first make an API call. For the next 5 hours, you have a quota (e.g., 1000 requests). After that, the quota resets.
Q9: Can I use Claude Code for commercial projects?
A: Yes, as long as you comply with Anthropic’s terms of service.
Q10: How to fix “Claude not responding”?
A: Press Ctrl+C twice to exit, then restart claude. Sometimes a /clear helps.
Q11: What is the difference between /clear and /compact?
A: /clear starts a completely new session (loses context). /compact summarises the conversation but keeps context – however it still uses tokens.
Q12: Can I use Claude Code with VS Code?
A: Yes, you can open VS Code in the same folder and edit files manually. Claude Code runs in the terminal – changes appear live in VS Code.
Q13: How to stop Claude from auto-editing files?
A: Switch to Normal mode (press Shift+Tab until no mode indicator shows). Then it will ask for permission before each edit.
Q14: Does Claude Code work offline?
A: No, it requires an internet connection to call Anthropic’s API.
Q15: Can I use Claude Code with other AI providers?
A: The official version only supports Anthropic’s models. But third‑party forks may allow OpenAI or other APIs.
💡 Final Tip: Always keep a backup of your code. While Claude Code is powerful, review all changes before committing to production. Use Git extensively – commit before each AI task, then you can revert easily if something goes wrong.
📚 Additional Resources: The complete Claude Code status line configuration and MCP commands are available on our website. For the free Gemini CLI alternative, check our dedicated guide.
⚠️ Disclaimer: This guide is for educational purposes. Always respect API terms of service. Token usage and availability may change.
👍 If you found this guide helpful, share it with your developer friends!
