All posts
claude-codeai-codingclideveloper-tools

Claude Code: A Complete Guide to Anthropic's CLI Coding Agent

How Claude Code works, how to set it up, and the workflow patterns that make it useful for real full-stack work instead of toy demos.

SR

Suhail Roushan

July 18, 2026

·
4 min read

Claude Code is Anthropic's official CLI agent — it reads your repo, edits files, runs shell commands, and drives your test suite from a terminal instead of a chat window bolted onto an editor. I moved most of my day-to-day full-stack work into it a while back, and the difference from a copy-paste chatbot workflow is that it actually has hands: it can grep, run pnpm build, read the failing test output, and fix the bug in the same loop, without me relaying text back and forth.

Why Claude Code Matters (and When to Skip It)

The core idea is that an agent with direct tool access — file read/write, bash, search — closes the loop that chat-based coding assistants leave open. In a chatbot you paste code in, get a suggestion back, paste it into your editor, run it yourself, paste the error back. Claude Code collapses that into one continuous session: it edits, runs, reads the result, and iterates.

Skip it for tiny one-line changes — opening a CLI session has more ceremony than just typing the fix yourself. It's also not the right tool when you need a human-reviewed, incremental diff for a highly sensitive file (auth, billing, migrations) without an agent touching it first — use it there for drafting only, and review every line before it lands.

Getting Started

Install and launch it from any project directory:

npm install -g @anthropic-ai/claude-code
cd your-project
claude

On first run it asks for authentication (Claude subscription or API key) and reads your working directory as context. From there you talk to it in plain English — "add pagination to the /blog route" — and it plans, edits files, and runs commands to verify its own work.

Core Concepts Every Developer Should Know

1. CLAUDE.md as project memory. Drop a CLAUDE.md file in your repo root describing tech stack, conventions, and commands (pnpm test, pnpm lint). Claude Code reads it automatically at session start, so you stop re-explaining your codebase every session.

# CLAUDE.md
Tech stack: Next.js 15 App Router, MongoDB, Tailwind
Test: pnpm test
Lint: pnpm lint
Never commit without running lint first.

2. Permission modes. By default Claude Code asks before running risky commands (writes, deletes, git pushes). You can tighten or loosen this per project in .claude/settings.json — I keep destructive git operations gated but allow read-only commands (git status, git diff, ls) to run without a prompt, which removes most of the friction.

3. Subagents. For open-ended research ("where is auth handled in this codebase?") you can delegate to a search-focused subagent instead of burning your main session's context on exploration. It comes back with a summary, not a wall of file contents.

4. Plan mode. For anything non-trivial, ask it to plan first before touching files. You get a step-by-step breakdown to approve or redirect before any edit happens — this is the single biggest lever for keeping an agent's changes scoped to what you actually asked for.

Common Claude Code Mistakes and How to Fix Them

Mistake 1: No CLAUDE.md. Without it, every session starts from zero — the agent re-discovers your stack, your test command, your conventions. Five minutes writing one pays for itself in the first session.

Mistake 2: Letting it run unchecked on a large refactor. Large, vague asks ("clean up the codebase") produce large, vague diffs. Scope requests to one concern at a time and review incrementally.

Mistake 3: Skipping the plan step. Jumping straight to "just do it" on a multi-file change means you find out what it decided to do after it's already done. Ask for a plan first on anything touching more than two or three files.

When Should You Use Claude Code?

Use it for the bulk of day-to-day feature work, bug fixes, test writing, and refactors where you can review the diff before shipping. It's also strong for codebase archaeology — "why does this endpoint return 500 on empty input?" — because it can actually trace the call path instead of guessing from a pasted snippet.

Avoid full autonomy on anything touching production data, secrets, or payment flows without a human reviewing every step.

Claude Code in Production

On suhailroushan.com I run it with a CLAUDE.md pinned to the repo, git hooks that block commits without passing lint, and a habit of asking for a plan before any change spanning more than two files. That combination — memory, guardrails, and a review step — is what turns "AI wrote my code" into a workflow I actually trust.

Start small: add a CLAUDE.md to one project, do a week of real feature work through it, and see how much of your own explaining you stop having to do.

Related posts

Written by Suhail Roushan — Full-stack developer. More posts on AI, Next.js, and building products at suhailroushan.com/blog.

Get in touch