Facebook iconHow to Use Claude Code? (Everything You Need to Know)
Blogs/AI

How to Use Claude Code? (Everything You Need to Know)

Written by Rabbani Shaik
Oct 22, 2025
6 Min Read
How to Use Claude Code? (Everything You Need to Know) Hero

Have you ever wanted a simple way to get coding help right inside your terminal? This article is about Claude Code, Anthropic’s AI tool that works from the command line, reads your project, and helps with everyday coding tasks like explaining code, automating routine steps, and handling Git commands using plain language. 

We’ll guide you through installing it, using the main commands, setting permissions safely, and extending it with external tools through the Model Context Protocol (MCP). By the end, you’ll know how to set up Claude Code in your own projects and use it to work more smoothly and efficiently. As reported by ppc.land, Claude Code has already processed 195 million lines of code in a week. Keep reading to see how it can fit into your workflow.

How to Install and Set Up Claude Code

Install via npm

# Install Claude Code
npm install -g @anthropic-ai/claude-code

# Navigate to your project
cd your-awesome-project

# Start coding with Claude
claude
# You'll be prompted to log in on first use

Basic Commands in Claude Code

Once you’ve installed Claude Code, here are some essential commands you’ll use regularly.

Starting a Session

# Start a new Claude session
claude

# Start with MCP servers configured in a JSON file
claude --mcp-config .mcp.json

# Skip ALL permission prompts (dangerous, allows execution without confirmation)
claude --dangerously-skip-permissions

Working With Prompts

# Start with an initial prompt
claude "explain this project"

# Continue the most recent conversation
claude -c

# Resume any past conversation (shows history)
claude --resume

Maintenance
# Update to the latest CLI version
claude update

What You Can Do Inside a Claude Session?

Once inside a session, Claude provides a set of slash commands (/) for extended functionality:

  • /mcp → Check MCP server status
  • /clear → Clear the current context (start fresh)
  • /compact → Compact the conversation to reduce token usage
    • Useful since Claude Code has a ~200k context limit (can be restrictive for large projects)
  • /memory → Edit persistent memory (claude.md)
  • /model → Switch between models
    • opus-4.1 for planning (more powerful, more expensive)
    • sonnet-4.1 for day-to-day coding
  • /review or /security-review → Trigger code review

Using claude.md - The Claude code’s context of your project.

What is claude.md?

  • A simple markdown file that acts as long-term memory for your project.
  • Claude reads it automatically at the start of every session (/init).
  • Anything in claude.md becomes part of Claude’s working context—without you having to re-explain it every time.

What to Put in claude.md

Think of it as a project README for your AI pair-programmer. Examples:

  • Project goals & scope
  • Coding conventions (naming patterns, linting rules)
  • Architecture notes
  • Environment setup instructions
  • Special constraints (e.g., “always use Python 3.12,” “React 18 only”)

Updating claude.md from Prompts

You don’t even need to edit the file manually. Inside a session, you can tell Claude to remember something using the # symbol:

This automatically appends the instruction to your claude.md file.

Pro tip: Keep claude.md in version control with your team. That way, every developer (and every Claude session) shares the same context.

MCP: Extend Claude Code with External Tools

MCP (Model Context Protocol) is what allows Claude Code to reach beyond your local terminal and interact with external services. By configuring MCP servers, you can give Claude access to tools such as:

  • context7 → Up-to-date documentation for LLMs and AI code editors
  • GitHub → Pull requests, issues, repo browsing
  • Git → Local Git operations
  • Playwright → browser automation
Innovations in AI
Exploring the future of artificial intelligence
Murtuza Kutub
Murtuza Kutub
Co-Founder, F22 Labs

Walk away with actionable insights on AI adoption.

Limited seats available!

Calendar
Saturday, 1 Nov 2025
10PM IST (60 mins)

In short, MCP is how you turn Claude Code from a “chatty assistant” into a programmable development agent.

Opening the MCP Configuration Workflow

Inside a Claude session, run:

/mcp

This command opens the MCP configuration workflow, where you can:

  • Add or remove MCP servers
  • Inspect which servers are active
  • Verify connection status

Example: Adding the Context7 MCP Server

Let’s walk through adding a real MCP server, Context7.

Context7 is a popular MCP server that provides up-to-date code snippets from major frameworks and Git repositories. Once connected, Claude can fetch relevant examples directly into your workflow.

Step 1. Get Your API Key

Log in to the Context7 dashboard and copy your API key.

Step 2. Add the MCP Server

Run the following command:

claude mcp add --transport http context7 https://mcp.context7.com/mcp \
  --header "CONTEXT7_API_KEY: YOUR_API_KEY"

This command installs Context7 as a global MCP server on your system.

Step 3. Verify the Setup

Open a Claude Code session and run:

/mcp

You should see context7 listed among the active MCP servers.

Step 4. Use It in Prompts

When you want Claude to use Context7, simply reference it in your prompt:

  • Use context7 to get me the latest Next.js authentication snippet.
  • Fix this camera track not getting published to livekit during low network conditions. Use context7 to get the latest code. 

Claude will automatically call the Context7 MCP server and pull in relevant results.

That’s it, adding an MCP server really is as easy as “blowing out a candle on a cake.”

Example:

Permissions & Project-Scoped MCP Servers

By default, Claude will ask for your permission before invoking any MCP server. Once approved, it integrates the tool into its workflow seamlessly.

Sometimes, however, you don’t want global servers, you need project-specific MCP configurations that can also be shared with teammates.

Using .mcp.json for Project Scope

You can configure MCP servers at the project level by creating a .mcp.json file in your repo. This allows you to:

  • Keep project tools isolated from global ones
  • Share the same MCP setup with your team via version control
  • Ensure consistent environments across devs

Example: Adding the Playwright MCP Server

Playwright has an MCP server that lets Claude Code execute browser automation, perfect for UI testing and debugging.

  1. Create a .mcp.json in your project root.
  2. Add the server config like this:
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}
  1. command: "npx" → Uses npx to run the tool
  2. args: [...] → Installs and runs the latest Playwright MCP package
Innovations in AI
Exploring the future of artificial intelligence
Murtuza Kutub
Murtuza Kutub
Co-Founder, F22 Labs

Walk away with actionable insights on AI adoption.

Limited seats available!

Calendar
Saturday, 1 Nov 2025
10PM IST (60 mins)

Triggering the Server

Once defined, Claude Code will automatically pick up the project’s .mcp.json. To use it, just ask in your Claude prompt:

Use the playwright MCP server to test the login flow.

Claude will then execute browser automation through Playwright as part of its workflow.

Use Case: This is especially powerful for automation testing, detecting UI regressions, running end-to-end flows, or validating

Multi-Model Strategy: Choosing the Right Model

Claude Code supports multiple models, and you can switch between them at any time using the /model command. Each model has its strengths, so knowing when to use which can save you time (and money).

When to Use Each Model

  • Opus 4.1 → Best for architecture, system design, and complex debugging
    • Slower and more expensive, but produces deeper reasoning and higher-quality plans.
  • Sonnet 4 → Ideal for day-to-day development
    • Balanced speed and quality, great for writing functions, tests, or iterating quickly.

The Hybrid Mode: opusplan

If you want the best of both worlds, Claude Code introduces opusplan mode.

Here’s how it works:

  1. Planning with Opus 4.1
    • Claude first uses Opus 4.1 to analyze your request.
    • It produces a detailed plan (e.g., files to edit, functions to touch, risks to consider).
  2. Execution with Sonnet 4
    • Once you approve the plan, Claude switches to Sonnet 4 to implement the code.
    • You get both the depth of Opus and the efficiency of Sonnet.

BOOM  (Probably the best outcome of an agentic coding agent, anthropic really nailed it here) 

Claude will give you a plan to implement a feature/ fix a bug or anything you want. It will tell you the file that it is gonna change and all. And you can approve the plan or modify it and accept. Sonnet 4 will take over and code it for you.

Conclusion

Claude Code is intentionally low-level and unopinionated, sitting close to raw model access, so it can adapt to your development workflow rather than forcing a new one.

Think of it as a senior pair-programmer sitting in your terminal:

  • Be specific in your prompts
  • Iterate instead of expecting perfection in one shot
  • Keep safety checks on unless you know what you’re doing
  • Extend it with MCP servers when you need external tools or integrations

Used well, Claude Code doesn’t just speed up your work, it changes how you build, test, and reason about software.

Author-Rabbani Shaik
Rabbani Shaik

AI enthusiast who loves building cool stuff by leveraging AI. I explore new tools, experiment with ideas, and share what I learn along the way. Always curious, always building!

Share this article

Phone

Next for you

How to Use UV Package Manager for Python Projects Cover

AI

Oct 28, 20254 min read

How to Use UV Package Manager for Python Projects

Managing Python packages and dependencies has always been a challenge for developers. Tools like pip and poetry have served well for years, but as projects grow more complex, these tools can feel slow and cumbersome.  UV is a modern, high-performance Python package manager written in Rust, built as a drop-in replacement for pip and pip-tools. It focuses on speed, reliability, and ease of use rather than adding yet another layer of complexity. According to benchmarks from Astral, UV installs pac

15 Best AI Code Generators of 2025 (Reviewed) Cover

AI

Oct 17, 202521 min read

15 Best AI Code Generators of 2025 (Reviewed)

With most developers now relying on AI in their workflow, the question isn’t if you’ll use a code generator in 2025, but which one can deliver the most reliable, context-aware support. In just a few years, AI coding assistants have evolved from autocomplete tools to full-scale collaborators, capable of scaffolding projects, debugging complex systems, and even generating production-ready applications. Stack Overflow’s 2023 Developer Survey mentioned that nearly 70% of developers already use AI t

12 Replit Alternatives for Development in 2025 Cover

AI

Oct 15, 202512 min read

12 Replit Alternatives for Development in 2025

Is Replit still the best choice for cloud-based development in 2025? For years, Replit has been one of the most popular online IDEs, thanks to its instant setup, collaborative editing, and growing ecosystem of AI tools. For students and indie developers, it has often been the first stop for quick coding experiments. For teams, it has offered a fast way to collaborate without heavy local setups. But the developer ecosystem has changed. As projects scale, many find that Replit struggles with perf