Claude Code Anthropic AI CLI Developer Tools

Claude Code: The AI CLI That's Changing How Developers Code in 2026

A complete guide to Claude Code — Anthropic's terminal-based AI coding agent. Learn installation, slash commands, MCP servers, hooks, and real-world workflows that make you dramatically more productive.

All articles

Claude Code is Anthropic's official command-line AI coding agent. It runs directly in your terminal, reads your codebase, edits files, runs commands, and manages Git — all guided by natural language. Unlike browser-based AI tools, Claude Code lives where developers already work: the shell.

This is a complete guide to getting started, mastering the core features, and building workflows that make Claude Code indispensable.


What Is Claude Code?

Claude Code is an agentic AI coding tool built on top of Claude — Anthropic's state-of-the-art language model. It's not an autocomplete plugin. It's an agent that can:

  • Read and understand your entire codebase
  • Edit multiple files in a single session
  • Run shell commands, tests, and build scripts
  • Manage Git (stage, commit, create branches)
  • Search the web for documentation
  • Call external APIs via MCP servers

Think of it as a senior engineer you can pair-program with via the command line — one with perfect recall of every file in your project.


Installation

Claude Code requires Node.js 18+ and an Anthropic API key.

# Install globally
npm install -g @anthropic-ai/claude-code
 
# Set your API key
export ANTHROPIC_API_KEY="sk-ant-..."
 
# Start Claude Code in your project
cd your-project
claude

You can also install the VS Code extension for integrated IDE support, or use Claude Code inside the claude.ai/code web app.


Your First Session

Once running, Claude Code opens an interactive REPL. Type in natural language:

> Add a rate-limiting middleware to my Express API.
  Use express-rate-limit, 100 requests per 15 minutes per IP,
  apply it to all /api/* routes, and return JSON errors.

Claude Code will:

  1. Read your project structure
  2. Find your Express server file
  3. Check if express-rate-limit is installed (and install it if not)
  4. Write the middleware
  5. Apply it to the correct routes
  6. Show you a diff before saving

You approve or reject each change. Nothing is applied without your confirmation.


Slash Commands — The Power User Interface

Claude Code ships with built-in slash commands that trigger specific behaviors:

CommandWhat it does
/helpShow all available commands
/clearClear conversation history
/compactCompress context to save tokens
/reviewDeep review of changed files
/initGenerate a CLAUDE.md file for your project
/memoryView and edit Claude's persistent memory
/costShow token usage for this session
/modelSwitch between Claude models

Custom Slash Commands

You can create your own slash commands as Markdown files inside .claude/commands/:

<!-- .claude/commands/pr-review.md -->
Review the staged changes as a strict code reviewer.
Check for: security issues, edge cases, missing tests,
performance regressions, and style consistency.
Output a prioritized list of issues with file:line references.

Now /pr-review is available in every session.


CLAUDE.md — Project Memory

CLAUDE.md is a Markdown file at the root of your project that Claude Code reads at the start of every session. It's how you give Claude permanent context about your codebase.

# My Project — Claude Instructions
 
## Stack
- Next.js 15, TypeScript, Tailwind CSS
- PostgreSQL via Prisma
- Deployed on Railway
 
## Conventions
- Components: PascalCase, co-located .test.tsx files
- API routes: snake_case, always return { data, error }
- Never use `any` — use `unknown` and narrow
 
## DO NOT
- Modify the authentication middleware without asking
- Add dependencies without checking if a lighter alternative exists
- Use default exports for utilities

With a good CLAUDE.md, Claude Code understands your conventions without you repeating them.


Hooks — Automate Workflows

Hooks execute shell commands automatically in response to Claude Code events. Configure them in .claude/settings.json:

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          {
            "type": "command",
            "command": "npx prettier --write $CLAUDE_FILE_PATH"
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "npm run typecheck"
          }
        ]
      }
    ]
  }
}

This example:

  • Runs Prettier automatically every time Claude edits a file
  • Runs TypeScript type checking when the session ends

Hooks can run any shell command — linters, test runners, formatters, notification scripts.


MCP Servers — Extend Claude's Capabilities

Model Context Protocol (MCP) lets Claude Code talk to external services. Anthropic and the community have built MCP servers for:

  • Filesystem operations — advanced file manipulation
  • GitHub — read PRs, issues, and repo metadata
  • PostgreSQL / SQLite — query your database directly
  • Puppeteer — control a browser for testing
  • Google Drive — read documents
  • Slack — send notifications

Configure MCP servers in ~/.claude.json:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_..."
      }
    }
  }
}

Now Claude Code can read your GitHub issues and pull requests during a session:

> Look at issue #142 and implement the described feature.

Real-World Workflows

Workflow 1: Feature From Ticket to PR

claude
> Read the GitHub issue #87. 
  Implement the described feature following our CLAUDE.md conventions.
  Write unit tests. Then stage the changes and write a commit message.

Claude Code reads the issue, implements it, writes tests, stages the diff, and suggests a commit message. Review, approve, push.

Workflow 2: Codebase Onboarding

claude
> Explain the architecture of this project.
  How does data flow from the API to the database?
  What are the most critical files I should understand first?

Paste this into every new codebase you join. Claude Code reads the project structure and gives you a map.

Workflow 3: Automated Code Review

git diff main..HEAD | claude -p "Review this diff as a strict engineer.
Prioritize: security, correctness, edge cases. 
Output: numbered list, severity HIGH/MEDIUM/LOW, file:line."

Pipe git diffs directly into Claude Code for headless reviews.

Workflow 4: Legacy Code Modernization

claude
> Audit all files in /src/utils that are older than 2 years.
  For each: identify deprecated patterns, propose modern alternatives,
  and flag anything that might break in Node 22.

Claude Code vs GitHub Copilot vs Cursor

FeatureClaude CodeCopilotCursor
Lives in terminal
Multi-file agentPartial
Runs shell commandsLimited
MCP / extensions
Custom hooks
Works headlessly (CI)
IDE integrationPluginNativeNative
Context window200K tokens~8K~20K

Claude Code wins on agentic capability and context. Copilot and Cursor win on in-editor experience. Many developers use both.


Permission Modes

Claude Code asks for permission before running dangerous operations. You can configure trust levels:

{
  "permissions": {
    "allow": [
      "Bash(npm run *)",
      "Bash(git status)",
      "Bash(git diff *)",
      "Read(**)",
      "Edit(src/**)"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(git push --force *)"
    ]
  }
}

This lets Claude run safe commands automatically while requiring confirmation for destructive operations.


Tips for Getting the Most from Claude Code

1. Write a great CLAUDE.md

Invest 30 minutes writing your project's CLAUDE.md. It pays back every session.

2. Use /compact on long sessions

When context grows large, /compact compresses history while preserving key decisions. This saves tokens and keeps responses fast.

3. Be specific about constraints

"Write a login form" → generic result
"Write a login form: TypeScript, React Hook Form, Zod validation, Tailwind CSS, no external UI library, handle loading and error states" → production-ready result

4. Use headless mode for automation

claude -p "Run the test suite and summarize failures" --no-interactive

Integrate Claude Code into CI pipelines for automated review gates.

5. Iterate, don't restart

Claude Code remembers the full session. If the first implementation isn't right, say "The rate limiting isn't applying to the /api/auth routes — fix that" rather than starting over.


Security Considerations

  • Claude Code runs in your local environment with your filesystem access
  • Review every file edit before approving
  • Never share your ANTHROPIC_API_KEY in project files — use environment variables
  • Use the deny permission list to block destructive operations
  • For sensitive repos, review the Anthropic privacy policy

Getting Started Today

  1. Install: npm install -g @anthropic-ai/claude-code
  2. Get an API key at console.anthropic.com
  3. Run /init in your project to generate a starter CLAUDE.md
  4. Read the official Claude Code documentation

Claude Code is the most powerful AI tool in a developer's terminal. The learning curve is gentle — and the productivity gains compound every week.


Resources