A structured study reference covering everything you need to understand, install, and confidently use Claude Code, Anthropic's agentic command-line coding assistant, in seven focused days.
Claude Code is an agentic command-line interface (CLI) tool built by Anthropic that brings the power of the Claude AI model directly into your terminal and development environment. Rather than simply answering questions in a chat window, Claude Code actively reads, writes, edits, and executes code across your entire codebase, acting as a collaborative engineering partner that understands full project context.
Claude Code runs locally in your shell, reading files, running commands, and modifying code autonomously, all while explaining its reasoning at every step.
Under the hood, Claude Code leverages Anthropic's most capable Claude models (Opus and Sonnet) with large context windows enabling it to reason over entire codebases.
Unlike inline autocomplete tools, Claude Code handles multi-step engineering tasks: refactoring, debugging, writing tests, searching files, and running builds end-to-end.
Claude Code always asks for permission before making file changes or running commands, ensuring you maintain full oversight over what happens in your project.
node -v/tutorial)/help, /clear, /compact, /memory--print and --output-format flagsCLAUDE.md to set project-level contextConfirm you have Node.js 18+ installed. If not, download from nodejs.org.
Install the Claude Code CLI package via npm with global scope so it's available in any project directory.
Export your Anthropic API key as an environment variable. Add this to your .bashrc or .zshrc for persistence.
Navigate into any project directory and start an interactive session. Claude Code will automatically read the file structure.
Once inside the Claude Code session, run the tutorial command to walk through core features interactively.
Add a CLAUDE.md file in your project root to give Claude Code persistent instructions, context, coding standards, and architectural notes about your project.
| Command / Syntax | What it Does | Example |
|---|---|---|
claude |
Start an interactive REPL session in the current directory | claude |
claude "prompt" |
Run a one-shot task and exit (non-interactive) | claude "add JSDoc to utils.js" |
claude -p "prompt" |
Print-only mode: outputs result without writing files | claude -p "explain this repo" |
/help |
Show all available slash commands inside a session | /help |
/clear |
Clear conversation history and free context window | /clear |
/compact |
Summarize context to reduce token usage while keeping key info | /compact |
/memory |
View and edit Claude Code's persistent memory and project notes | /memory |
/init |
Initialize a CLAUDE.md file with auto-detected project context | /init |
/doctor |
Check environment health: Node version, API key, config status | /doctor |
/bug |
Report a Claude Code bug with captured context automatically | /bug |
claude --output-format json |
Output structured JSON, useful for CI pipelines and scripts | claude --output-format json "audit deps" |
Shift + Tab |
Toggle between auto-accept and manual-confirm modes for file edits | (Keyboard shortcut in session) |
/compact regularly during long sessions to prevent context overflow while keeping Claude Code's understanding of your project intact.
Keep your project's CLAUDE.md updated with stack details, coding conventions, architecture notes, and explicit dos and don'ts to improve consistency across sessions.
Vague prompts yield vague results. Be explicit: name the file, function, and goal. "Refactor the parseUser function in auth.js to use async/await" beats "improve the code."
Use the diff view to inspect every file change before accepting. Claude Code is powerful but not infallible; your review is an essential quality gate.
Run Claude Code experiments on a dedicated branch. This lets you cleanly compare, revert, or merge its changes without risk to your main branch.
Clear the conversation context when switching between unrelated tasks. A fresh context means Claude Code focuses on what matters now, not earlier conversations.
Never commit your ANTHROPIC_API_KEY to version control. Use a .env file and ensure it's in .gitignore from day one.
When requesting new features or refactors, explicitly ask Claude Code to write corresponding tests. Build the habit of treating test generation as a default, not an afterthought.
Once comfortable, explore Model Context Protocol (MCP) servers to extend Claude Code with external data sources, APIs, databases, and enterprise tooling connections.
The authoritative introduction to Claude Code: what it is, how it works, and how to get started.
Complete reference for all Claude Code CLI flags, options, slash commands, and environment variables.
Official source repository. Browse issues, follow releases, and contribute to Claude Code's development.
The official launch post explaining the vision, capabilities, and design philosophy behind Claude Code.
Step-by-step tutorials for common workflows: debugging, refactoring, writing tests, and more.
How to use CLAUDE.md, project memory, and user-level memory to customize Claude Code for your workflows.
How to extend Claude Code with MCP servers to connect external APIs, databases, and enterprise tools.
Create and manage your API keys, monitor usage, and configure billing for Claude Code access.