This is the first post in my Build It With AI series — practical tutorials for developers who want to use AI tools effectively.
Claude Code is a terminal-based AI coding agent from Anthropic. According to the Pragmatic Engineer’s 2026 survey, it’s now the most-used AI coding tool, overtaking both GitHub Copilot and Cursor in just eight months. 46% of developers named it the tool they love most.
Here’s how to get started.
What Claude Code Actually Is
Claude Code runs in your terminal. No IDE, no editor — just your terminal. You describe what you want in plain English, and it:
- Reads your codebase
- Plans the changes
- Writes and modifies files
- Runs commands (tests, builds, git)
- Fixes errors it encounters
It’s not an autocomplete tool. It’s an autonomous agent that does the work while you supervise.
Installation
Prerequisites
- Node.js 18+ installed
- An Anthropic account with Claude Max subscription or API access
Install
npm install -g @anthropic-ai/claude-code
Authenticate
claude
The first time you run it, it’ll open a browser window to authenticate with your Anthropic account. Once authenticated, you’re ready to go.
Your First Session
Navigate to any project directory and start Claude Code:
cd ~/my-project
claude
You’ll see a prompt where you can type natural language instructions. Try something simple:
> What does this project do? Give me a summary.
Claude Code will read your project files and give you an overview. This is a great way to onboard onto unfamiliar codebases.
Common Workflows
Ask questions about your code
> How does the authentication flow work in this project?
> Where is the database connection configured?
> What would break if I changed the User model?
Claude Code reads the relevant files and gives you answers with specific file references.
Make changes
> Add a /health endpoint to the Express server that returns { status: "ok" }
Claude Code will:
- Find your server file
- Add the endpoint
- Show you the diff
- Ask for confirmation (unless you use
--yes)
Refactor code
> Refactor the auth middleware to use JWT tokens instead of session cookies
This is where Claude Code shines. It’ll identify all the files that need to change, plan the refactoring, and execute it across your entire codebase.
Fix bugs
> The /api/users endpoint returns a 500 error. Find and fix the bug.
Claude Code will read the route, check the error handling, potentially run the server, and fix the issue.
Run commands
> Run the tests and fix any failures
Claude Code has shell access. It can run your test suite, read the output, and fix failing tests — all in one session.
Key Flags
# Skip all confirmation prompts (careful!)
claude --dangerously-skip-permissions
# Auto-accept all changes
claude --yes
# Run a single prompt and exit (no interactive session)
claude -p "Add a README.md to this project"
# Resume a previous session
claude --resume
Tips From Daily Use
Start with questions, not commands. Before asking Claude Code to change anything, ask it to explain the codebase. This loads context and leads to better changes.
Be specific about what you want. “Make the app better” gives bad results. “Add input validation to the /api/users POST endpoint that checks for valid email format” gives great results.
Let it run tests. After making changes, tell it to run your test suite. It’ll fix its own mistakes, which saves you review time.
Use it alongside your editor. Claude Code works in the terminal, so you can have it open in one pane and your editor in another. Watch the files change in real-time.
Commit frequently. Tell Claude Code to commit after each logical change. If something goes wrong, you can easily revert.
Pricing
Claude Code requires either:
- Claude Max subscription: $100/mo (5x usage) or $200/mo (20x usage)
- API key: Pay per token, roughly $5-15 per heavy coding session
There’s no free tier for Claude Code specifically, but you can try it with a standard Claude Pro subscription ($20/mo) with limited usage.
When to Use Claude Code vs Other Tools
| Task | Best Tool |
|---|---|
| Large refactoring | Claude Code |
| Daily coding with inline suggestions | Cursor |
| Quick edits in JetBrains | Copilot |
| Thinking through architecture | ChatGPT |
| Budget-friendly AI IDE | Windsurf |
Claude Code is best when you have a well-defined task and want the AI to handle it autonomously. For real-time pair programming, Cursor is still better.
Next in this series: we’ll build a Chrome extension from scratch using Claude Code. Subscribe to get notified.