← back to posts

Getting Started with Claude Code: Anthropic's Agentic CLI

Claude Code is Anthropic’s official agentic CLI — an AI coding assistant that lives in your terminal, reads your repository, edits files, runs commands, and iterates until the task is done. Unlike chat-only assistants, Claude Code operates with real tools: it can read, write, grep, run shell commands, hit web APIs, and chain those actions across many turns. This post covers the path from zero to a productive first session.

Installation

Claude Code ships as an npm package and runs anywhere Node.js does — Linux, macOS, and Windows (PowerShell, WSL, Git Bash all work).

1
2
3
4
5
# Requires Node.js 18 or later
npm install -g @anthropic-ai/claude-code

# Verify
claude --version

There are also IDE integrations for VS Code and JetBrains (IntelliJ, PyCharm, WebStorm), plus a desktop app on Mac and Windows and a hosted version at claude.ai/code. The CLI is the canonical entry point — every other surface uses the same engine underneath.

First Run and Authentication

From any directory, run:

1
claude

On first launch you will be prompted to authenticate. Two paths are supported:

  • Anthropic Console (default): OAuth flow that opens your browser, signs you in, and bills usage to your Console workspace.
  • API key: Set ANTHROPIC_API_KEY in your environment for headless or CI use.

You will also be asked whether to trust the current directory. Claude Code will not read or write files in untrusted directories — a safety boundary that matters when you are cloning unknown repos.

The CLAUDE.md File

The single highest-leverage file in any Claude Code project is CLAUDE.md at the repo root. It is automatically loaded into every session and acts as durable context — build commands, architectural notes, conventions, gotchas. To bootstrap one, run the built-in slash command:

/init

Claude will scan the codebase and draft a CLAUDE.md for you. Edit it, commit it, and from then on every teammate’s Claude Code session inherits the same project knowledge.

Common Flags and Modes

  • claude — Interactive REPL. Default mode; you type, Claude works.
  • claude -p "summarize the auth module" — One-shot prompt. Prints the answer and exits. Great for scripting.
  • claude --resume — Pick up the previous session with full history.
  • claude --continue — Resume the most recent session in the current directory.
  • claude --dangerously-skip-permissions — Bypass per-tool approval prompts. Reserve for sandboxed environments only.

Permission Model

By default, Claude Code asks before running shell commands or editing files outside the working directory. You can pre-approve patterns in .claude/settings.json so routine tools (like npm test or git status) stop interrupting you. The /permissions slash command opens a UI to review and add allowlist entries.

A Realistic First Session

1
2
cd ~/code/my-project
claude

Then inside the REPL:

> /init
> add a /health endpoint to the express server, return {status:"ok"} and write a test

Claude will read package.json, find the express setup, add the route, write a Jest test, run the suite, and report back with a diff. You review, accept, and move on. The entire loop typically takes under a minute on a small change.

Where to Go Next

Once the basics click, the productivity multipliers are slash commands (built-in and custom), hooks (event-driven automation), subagents (specialized AI workers), and MCP servers (external tool integration). Each of those gets its own post in this series.

Claude Code is the rare AI tool that gets out of your way. Install it, write a CLAUDE.md, and let the terminal do the heavy lifting.