Getting Started with Claude Code

Claude Code is Anthropic's agentic coding tool. It reads your codebase, edits files, runs commands, and integrates with your terminal, IDE, browser, and apps.

Terminal VS Code JetBrains Desktop Browser GitHub Actions Slack

Overview

What Claude Code is and why we use it

Claude Code is an agentic coding tool that reads your codebase, edits files, and runs commands. Unlike simple code completion, Claude Code operates in an agentic loop — it gathers context, plans, acts, and verifies its own work.

Why Our CloseFuture Team Uses Claude Code?

Ship Faster

Automate boilerplate, test writing, and code gen. Ship features in hours, not days.

🔁

Git Automation

Commits, branches, PRs, code reviews — all through natural language.

🧪

Auto Testing

Generate tests, run them, fix failures, and iterate until they pass.

🐛

Bug Fixing

Analyze stack traces, find root causes, and apply targeted fixes.

📝

Documentation

Auto-generate JSDoc, README updates, and release notes.

🤝

Team Standards

CLAUDE.md shares conventions across all sessions and team members.

What You Can Do

  • Ask questions about your codebase"How does our auth middleware work?"
  • Edit code across multiple files"Add input validation to the signup form"
  • Run and fix tests"Write tests for the cart service and fix any failures"
  • Search and navigate"Find all API endpoints that don't have auth checks"
  • Git operations"Commit these changes, create a PR with a clear description"
  • Automate CI workflowsUse in GitHub Actions for automated code reviews
  • Connect external toolsJira, Slack, Supabase databases via MCP protocol

Platforms at a Glance

PlatformBest ForKey Features
Terminal CLIFull control, scriptingAll features, composable with Unix tools
VS CodeIDE workflowInline diffs, @-mentions, plan review
JetBrainsIntelliJ/PyCharm usersInteractive diffs, context sharing
Desktop AppVisual review, parallel workSide-by-side sessions, visual diffs
WebNo local setup, mobileCloud sandboxed, long-running tasks
GitHub ActionsCI/CD automationAutomated PR review, code gen
SlackTeam workflowsRoute bugs to PRs from chat
Subscription required. Claude Code requires a Pro ($20/mo), Max ($100/$200/mo), Team, or Enterprise plan. The free tier does not include Claude Code.

Quickstart

From zero to running in 5 minutes

System Requirements

  • OS: macOS 13+, Windows 10 1809+, Ubuntu 20.04+, Debian 10+
  • Hardware: 4 GB+ RAM
  • Network: Internet connection required
  • Shell: bash, zsh, or PowerShell recommended

Step-by-Step Setup

Create your account

Go to claude.ai and sign up. Upgrade to Pro ($20/mo) or Max ($100 or $200/mo) under Settings → Billing.

Install Claude Code

bash
curl -fsSL https://claude.ai/install.sh | bash
powershell
# PowerShell
irm https://claude.ai/install.ps1 | iex

# Or WinGet
winget install Anthropic.ClaudeCode
bash
brew install --cask claude-code
bash
# Requires Node.js 18+
npm install -g @anthropic-ai/claude-code

Navigate to your project and start

bash
cd your-project
claude

Authenticate

On first run, Claude opens your browser for login. Sign in with your Anthropic account and trust the project directory.

Start coding

bash
# Ask about your project
> summarize this codebase and explain the architecture

# Make changes
> add input validation to the signup form in src/components/Signup.tsx

# Run tests
> run the test suite and fix any failures
Claude respects .gitignore and never sends ignored files. It reads your project structure to understand context.

How Claude Code Works

The agentic loop and available tools

Claude Code operates through an intelligent three-phase agentic loop. Unlike traditional code assistants, Claude gathers context, acts, and verifies its own work — iterating until complete.

🔍

1. Gather Context

Read/search files, analyze errors, review git state, load CLAUDE.md instructions

2. Take Action

Edit files, run commands, execute git operations, invoke external tools via MCP

3. Verify Results

Run tests, analyze output, course-correct, iterate until the task is complete

Available Tools

ToolWhat It Does
ReadRead file contents with line-level precision
Write / EditCreate new files or make targeted edits
GlobFind files by pattern (e.g., **/*.tsx)
GrepSearch file contents with regex
BashExecute shell commands (builds, tests, git, etc.)
Task (Subagent)Spawn sub-agents for parallel work
WebSearchSearch the web for documentation and solutions
MCP ToolsExternal integrations (Jira, Slack, databases, etc.)

Permission System

ModeBehaviorActivate
Normal (default)Asks before file edits and shell commandsDefault
Auto-Accept EditsEdits files silently, asks for shell commandsShift+Tab
Plan ModeRead-only analysis, creates a plan for your approvalShift+Tab ×2

Common Workflows

How to use Claude Code for everyday tasks

Explore → Plan → Code → Commit

Explore (Plan Mode)

Start with Shift+Tab to enter Plan Mode. Ask Claude to read and understand the relevant code.

prompt
> read src/auth/ and explain how session handling works

Plan

Ask for a detailed implementation plan. Review it, adjust if needed.

prompt
> create a plan to add OAuth2 support using the existing auth patterns

Implement

Switch back to Normal Mode and let Claude execute the plan.

prompt
> implement the plan. write tests and run them after each change

Commit

prompt
> commit the changes with a descriptive message and create a PR

Fix Bugs

prompts
> the login form throws a TypeError when email is empty - find and fix it
> users report a blank screen after failed login. check token refresh in src/auth/
> fix the race condition in the checkout flow

Write and Fix Tests

prompts
> write comprehensive tests for the CartService class, aim for >90% coverage
> find untested functions in the notification module and add edge case tests
> run the test suite and fix all failures

Refactor Code

prompts
> refactor fetchUserData to use async/await instead of .then() chains
> migrate our Express routes from JavaScript to TypeScript with proper type definitions
> find deprecated API usage across the project and suggest modern alternatives

Git & PRs

prompts
> commit my changes with a descriptive message
> create a new branch called feature/oauth2
> create a PR with a summary of what changed and why
> help me resolve the merge conflicts in src/api/users.ts

Pipe & Script (Headless)

bash
# One-shot query
claude -p "summarize this project"

# Process piped content
git diff main...feature | claude -p "review these changes for bugs and security issues"

# Structured output
claude -p "list all API endpoints" --output-format json > endpoints.json

Best Practices

Get the most out of Claude Code

Write Effective Prompts

Strategy❌ Before✓ After
Be specific"fix the bugs""fix the null pointer in UserService.getProfile() when user.email is undefined"
Point to sources"why is the API weird?""look through the git history of ExecutionFactory and explain the design decisions"
Reference patterns"add a calendar widget""look at HotDogWidget.php as a reference and implement a CalendarWidget similarly"
Include verification"write a validator""write validateEmail. test: user@example.com=true, invalid=false. run tests after"

Context Management

Your most important resource
  • Use /clear between unrelated tasks
  • Use /compact to compress long conversations
  • Run /clear after 2+ failed correction attempts — start fresh
  • Use subagents for exploratory work (they get separate context)
  • Put persistent rules in CLAUDE.md, not in conversation

Pitfalls to Avoid

PitfallFix
Kitchen-sink sessions (mixing unrelated tasks)/clear between different tasks
Correcting Claude repeatedly/clear and rewrite a better initial prompt
Over-specified CLAUDE.mdKeep it short — aim for under 100 lines
Trust-then-verify gapAlways include tests or screenshots as verification
Security: Be cautious about prompt injection. Don't paste untrusted content directly into Claude without reviewing it.

CLAUDE.md

Project memory and team standards

CLAUDE.md is a markdown file Claude reads at the start of every session. Run /init to create one.

Where to Put It

LocationScopeGit
~/.claude/CLAUDE.mdGlobal — all projects, all sessionsNot in git
./CLAUDE.mdProject — shared with teamCheck into git
./CLAUDE.local.mdPersonal project prefsAdd to .gitignore
./src/CLAUDE.mdSubdirectory — auto-loaded for that folderCheck into git

What to Include

markdown
# CLAUDE.md

## Tech Stack
- TypeScript strict mode, React 18, Next.js 14
- Tailwind CSS for styling
- Vitest for testing (not Jest)
- pnpm (not npm or yarn)

## Commands
- Build: `pnpm build`
- Test: `pnpm test`
- Lint: `pnpm lint`

## Architecture
- API routes in src/api/
- Components in src/components/
- All DB access through Supabase Client

## Conventions
- Branch naming: feature/*, bugfix/*, hotfix/*
- Commit messages: conventional commits (feat:, fix:, refactor:)
Keep your CLAUDE.md concise. Long files waste context tokens every session. Aim for under 100 lines.

Terminal (CLI)

The full-featured command-line interface

Starting a Session

bash
claude                     # Interactive session
claude "task description"  # Start with a task
claude -p "query"          # One-shot (print mode)
claude -c                  # Continue most recent conversation
claude -r                  # Resume a specific session
claude -r auth-refactor    # Resume by session name

Interactive Commands

CommandDescription
/helpShow all commands and keyboard shortcuts
/compactCompress conversation to save context
/clearReset conversation — start fresh
/modelSwitch model mid-session (Sonnet, Opus, Haiku)
/contextCheck context window usage
/commitCreate a well-formatted git commit
/review-prReview a pull request
/initGenerate a CLAUDE.md for the project
/loginSwitch accounts
/doctorDiagnose installation issues
/configOpen settings interface
/hooksConfigure automation hooks
/skillsList available skills
/agentsConfigure subagents

Keyboard Shortcuts

ShortcutAction
Shift+TabCycle permission modes (Normal → Auto-Accept → Plan)
EscInterrupt current action
Esc EscRewind to last checkpoint
Ctrl+CCancel / exit
?Show all keyboard shortcuts

VS Code Integration

Full IDE integration with inline diffs

Search for "Claude Code" in the Extensions marketplace (Ctrl+Shift+X) and install. Requires VS Code 1.98.0+.

Key Shortcuts

ShortcutAction
Alt+KInsert @-mention (reference a file)
Ctrl+EscToggle focus between editor and Claude
Ctrl+Shift+EscOpen Claude in a new editor tab
Ctrl+NNew conversation
Shift+TabCycle permission modes
Alt+TToggle extended thinking

Features

  • Inline diffs — review every code change before accepting
  • @-mentions @filename for files, @folder/ for directories
  • Checkpoints — hover over messages to rewind code and conversation
  • Plan Mode — analyze safely before committing to changes
  • Drag & drop — drag files into chat as context

JetBrains IDEs

IntelliJ, PyCharm, WebStorm, and more

Install the Claude Code plugin from the JetBrains Marketplace. Supports IntelliJ IDEA, PyCharm, WebStorm, GoLand, PHPStorm, and others.

  • Interactive diffs for reviewing code changes
  • Context sharing with the IDE
  • Same command set as the CLI (/compact, /clear, etc.)
  • Permission mode cycling with Shift+Tab

Desktop App

Visual interface with parallel sessions

Download from claude.ai/download for macOS (Intel/Apple Silicon) or Windows (x64, ARM64).

  • Side-by-side parallel sessions with separate git worktrees
  • Visual diffs for reviewing changes
  • All the same agentic capabilities as the terminal
  • Use /desktop in CLI to hand off a session to the desktop app

Claude Code on the Web

No install required, cloud-sandboxed

Go to claude.ai/code and sign in. No local setup needed.

  • Full agentic coding in a sandboxed cloud environment
  • Connect to GitHub repos directly
  • Long-running tasks continue even if you close the browser
  • Works on mobile — check progress from anywhere
  • Use /teleport in CLI to pull a cloud session to your terminal

Model Context Protocol (MCP)

Connect Claude to external tools and services

MCP lets Claude Code communicate with external tools — databases, APIs, project management tools, and more.

Adding MCP Servers

bash
# Add a server
claude mcp add --transport http github https://api.githubcopilot.com/mcp/

# Add a stdio server
claude mcp add my-server -- node /path/to/server.js

# List configured servers
claude mcp list

# Remove a server
claude mcp remove my-server

Popular Integrations

📋

Jira / Linear

Read and update tickets from within Claude

💬

Slack

Send messages and read channel context

🗄️

Databases

Query Postgres, MySQL, SQLite directly

📁

Google Drive

Read docs and spreadsheets as context

🎨

Figma

Read design files and translate to code

📊

Monitoring

Connect to Sentry, Datadog, etc.

MCP servers consume context tokens. Be mindful of how many you have active simultaneously.

Hooks

Automate actions before or after Claude acts

Hooks run deterministic commands at specific points in Claude's workflow — like linting after edits or blocking changes to certain directories.

json
{
  "hooks": {
    "afterEdit": [
      { "command": "eslint --fix $FILE", "description": "Auto-fix lint issues" }
    ],
    "beforeCommit": [
      { "command": "pnpm typecheck", "description": "Type-check before committing" }
    ]
  }
}

Available Hook Points

  • afterEdit — runs after any file is modified
  • beforeCommit — runs before git commits
  • afterCommit — runs after git commits
  • onSessionStart — runs when a session begins

Skills

Reusable slash commands for common workflows

Skills are custom slash commands you create for repeatable workflows. They live in .claude/skills/.

.claude/skills/review-pr/SKILL.md
---
name: review-pr
description: Review a PR with our team's checklist
---

# PR Review Workflow
1. Read all changed files
2. Check for security issues (SQL injection, XSS, auth bypass)
3. Check for performance issues (N+1 queries, missing indexes)
4. Verify tests exist for new functionality
5. Check adherence to our code style (see CLAUDE.md)
6. Write a structured review comment

Then use it with /review-pr. Run /skills to see all available skills.

Subagents

Specialized AI assistants within a session

Subagents are specialized assistants that run in their own context window with specific tools and permissions.

  • Preserve context — keep exploration out of your main conversation
  • Enforce constraints — limit which tools a subagent can use
  • Specialize — dedicated agents for testing, docs, security review
  • Control costs — route tasks to faster, cheaper models like Haiku

Creating a Subagent

.claude/agents/security-reviewer.md
---
name: security-reviewer
description: Review code for security vulnerabilities
model: sonnet
tools:
  - Read
  - Grep
  - Glob
---

You are a security-focused code reviewer. Analyze code for:
- SQL injection, XSS, CSRF vulnerabilities
- Authentication and authorization issues
- Hardcoded secrets or credentials

Agent Teams

Multiple agents working in parallel

While subagents work within a single session, agent teams coordinate across separate sessions. A lead agent distributes work and merges results.

  • Parallel processing — multiple agents work on different parts simultaneously
  • Separate git worktrees — each agent works in isolation
  • Lead agent coordinates — distributes tasks, reviews output, merges
  • Useful for large refactors, multi-service changes, comprehensive testing
Agent teams are best for tasks that are naturally parallelizable. For sequential tasks, use regular sessions or subagents instead.

Settings & Configuration

Customize Claude Code behavior

Configure via /config in a session, or edit .claude/settings.json directly.

Configuration Scopes

ScopeLocationUse For
User~/.claude/settings.jsonPersonal preferences across all projects
Project.claude/settings.jsonTeam settings, check into git
Local.claude/settings.local.jsonPersonal project prefs, gitignored
EnterpriseServer-managedOrganization-wide policies
json
{
  "permissions": {
    "allow": ["Bash(npm test)", "Bash(git status)", "Bash(pnpm lint)"]
  },
  "model": "sonnet",
  "theme": "dark"
}

Permissions

Control what Claude can and can't do

.claude/settings.json
{
  "permissions": {
    "allow": [
      "Bash(npm test)",
      "Bash(npm run lint)",
      "Bash(git status)",
      "Bash(git diff *)",
      "Read", "Glob", "Grep"
    ],
    "deny": [
      "Bash(rm -rf *)",
      "Bash(git push --force *)"
    ]
  }
}

Permission Modes

  • Normal: Ask for each edit and command
  • Auto-Accept Edits: Edit files freely, ask for commands
  • Plan Mode: Read-only. Creates a plan for approval before any changes
--dangerously-skip-permissions bypasses all permission prompts. Only use this in sandboxed CI environments, never locally.

Security

Data privacy and safety

  • Code context is sent to Anthropic's API for processing
  • Anthropic does not train on your code by default
  • Team and Enterprise plans have additional data privacy guarantees
  • Claude respects .gitignore — ignored files are never sent
  • Permission system prevents unauthorized destructive actions
  • All API communication is encrypted over HTTPS
Prompt injection: Be aware that content in files could attempt to manipulate Claude. Don't blindly paste untrusted content.

Model Configuration

Choose the right model for the task

ModelBest ForSpeedUsage Cost
Sonnet (default)Most coding tasks — good balanceFastLow
OpusComplex reasoning, architectureSlowerHigh
HaikuSimple tasks, high volumeFastestLowest
bash
# Start with a specific model
claude --model opus

# Switch mid-session
/model sonnet

# Toggle extended thinking (Opus)
# Alt+T in VS Code

Extended Thinking

  • Enabled by default for Opus
  • Toggle with Alt+T (VS Code) or Option+T (macOS)
  • Disable with export MAX_THINKING_TOKENS=0

CLI Reference

Complete command-line reference

Flags

FlagDescription
-p, --printPrint response without interactive mode
-c, --continueContinue most recent conversation
-r, --resumeResume a specific session by name or ID
--model <name>Set model (sonnet, opus, haiku)
--permission-modeSet mode (default, plan, acceptEdits)
--add-dir <path>Add additional working directories
--tools <list>Restrict available tools
--output-formatOutput format: text, json, stream-json
--max-turns <n>Limit number of agentic turns
--json-schemaGet validated structured JSON output
--verboseEnable verbose logging
--chromeEnable Chrome browser automation

Checkpointing

Undo anything — safely

Claude automatically creates checkpoints before making changes. You can rewind to any checkpoint to restore both code and conversation state.

  • Terminal: Press Esc twice, or use /rewind
  • VS Code: Hover over a message and click the rewind icon
  • Rewind restores: code changes, conversation state, and file system
  • You can fork from a checkpoint to try a different approach
Checkpoints persist across sessions but are not a replacement for git. Always commit important work.

GitHub Actions

CI/CD automation with Claude Code

Use Claude Code in your GitHub Actions workflows for automated code reviews, PR generation, and more.

.github/workflows/claude-review.yml
name: Claude Code Review
on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: anthropics/claude-code-action@v1
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
          prompt: |
            Review this PR for:
            - Bugs and logic errors
            - Security vulnerabilities
            - Performance issues
            Provide specific, actionable feedback.

SDK & Programmatic Usage

Build with Claude Code as a library

bash
# Headless mode
claude -p "explain this function" --output-format text

# JSON output for parsing
claude -p "list all API endpoints" --output-format json

# Stream output
cat access.log | claude -p "detect anomalies" --output-format stream-json

# Combine with other tools
git diff main --name-only | xargs -I{} claude -p "review {} for security issues" --output-format json

Troubleshooting

Common issues and solutions

IssueSolution
command not found: claudeReinstall, or add to PATH. Run claude doctor.
Authentication failuresRun /login to re-authenticate.
Slow responsesUse /compact to reduce context. Switch to Sonnet if on Opus.
Rate limit reachedWait for reset (rolling window) or upgrade to Max plan.
Extension not loadingUpdate VS Code to 1.98.0+. Reinstall extension. Check /doctor.
MCP server not connectingRun claude mcp list. Use --debug mcp flag.
Run claude --doctor or /doctor in a session for automated diagnostics.

Claude Code + Supabase Integration

Complete guide with Agents, Commands, and MCP

This integration installs 2 specialized agents, 8 database commands, and an MCP server that turn Claude Code into a full-featured Supabase development environment.

All components install automatically to standard Claude Code directories and are immediately available. No restart needed.

What's Included

2 Agents

Schema Architect & Realtime Optimizer — specialized agents for database design and WebSocket tuning

8 Commands

Slash commands for schema sync, migrations, performance, security audits, backups, types, data explorer, and realtime monitoring

1 MCP Server

Direct Supabase API integration through Model Context Protocol

Installation

Terminal
npx claude-code-templates@latest \
  --command supabase-schema-sync,supabase-migration-assistant,supabase-performance-optimizer,supabase-security-audit,supabase-backup-manager,supabase-type-generator,supabase-data-explorer,supabase-realtime-monitor \
  --agent supabase-schema-architect,supabase-realtime-optimizer \
  --mcp supabase
Terminal
# Install a specific agent
npx claude-code-templates@latest --agent supabase-schema-architect

# Install a specific command
npx claude-code-templates@latest --command supabase-schema-sync

# Install the MCP server only
npx claude-code-templates@latest --mcp supabase

MCP Server Configuration

Supabase provides an official Remote MCP Server — the simplest way to connect.

.mcp.json
{
  "mcpServers": {
    "supabase": {
      "url": "https://mcp.supabase.com/mcp"
    }
  }
}
Terminal
# Add via CLI
claude mcp add --transport http supabase https://mcp.supabase.com/mcp

# Authenticate (opens browser login)
# Type /mcp in Claude Code and follow the login flow
CategoryTools
Databaselist_tables, apply_migration, execute_sql
Edge Functionslist_edge_functions, deploy_edge_function
Developmentget_project_url, get_publishable_keys, generate_typescript_types
Debuggingget_logs, get_advisors
Documentationsearch_docs — search Supabase docs from Claude Code

Tutorials & Videos

Watch and learn from demos

Mastering Claude Code in 30 Minutes

Official walkthrough of Claude Code's features and agentic workflows.

Claude Code Best Practices

Tips for effective prompting and workflow optimization.

Taking Claude to the Next Level

Advanced features, MCP integrations, and scaling.

Building Headless Automation

Automate workflows with Claude Code's headless mode and SDK.

Documentation & Links

Official docs and community resources

Official Documentation

Community

FAQ

Frequently asked questions

What subscription do I need?
Claude Code requires a Pro ($20/mo), Max ($100 or $200/mo), Team, or Enterprise plan. Alternatively, use an Anthropic Console account with API credits. The free tier does not include Claude Code.
What if I hit usage limits?
Pro has a rolling usage window — wait and it resets. Max plans have much higher limits. Use /compact to save context tokens.
How do I integrate Claude Code with our repo?
Just cd into your project and run claude. It reads your codebase, respects .gitignore, and works within your existing git workflow. Add a CLAUDE.md for team standards.
How is this different from GitHub Copilot or ChatGPT?
Claude Code is agentic — it doesn't just suggest code, it reads your entire codebase, edits files, runs terminal commands, manages git, and iterates on failures. It operates in a loop (gather context → act → verify) rather than generating one-shot completions.
Is my code sent to Anthropic?
Yes, code context is sent to Anthropic's API for processing. Anthropic does not train on your data by default. Team and Enterprise plans have additional data privacy guarantees.
Can Claude run destructive commands?
Claude has a permission system. It asks approval before running commands that modify your system. It won't force-push, delete branches, or run rm -rf without explicit approval.
What languages and frameworks does it support?
Any language and framework. Especially strong with JavaScript/TypeScript, Python, Rust, Go, Java, C/C++, Ruby, PHP. Understands React, Next.js, Django, FastAPI, Express, Rails, and more.
How do I resume a previous session?
Run claude -c to continue the most recent session, or claude -r for an interactive picker. Name sessions with /rename my-task for easy resumption.
Can I use Claude Code in a monorepo?
Yes. Claude handles monorepos well — it navigates packages, understands workspace configs (pnpm workspaces, Turborepo, Nx, Lerna), and works across multiple packages.
What's the difference between subagents and agent teams?
Subagents work within a single session — like specialized helpers with their own context window. Agent teams coordinate across separate sessions with separate git worktrees, useful for large parallelizable tasks.
Built with love by Closefuture team