Skip to content

Chapter 1 of 7

Getting Started with Claude Code

Claude Code is Anthropic's official AI-powered command-line tool designed to help developers write, edit, debug, and understand code directly from the terminal. To begin, you simply run `claude` from any project directory, which launches an interactive session with the assistant. The tool's most powerful feature is its agentic mode, in which Claude can read files, write code, run tests, and execute shell commands autonomously, allowing it to complete complex multi-step tasks end-to-end without constant human direction. Because the working directory provides automatic context, navigating to your project root before starting Claude ensures it has visibility into all files in that directory.

Inside the session, several slash commands help you manage the conversation and inspect state. Running `/help` displays available commands, keyboard shortcuts, and usage information, while `/clear` resets the conversation context entirely, starting a fresh session. The `/compact` command compresses conversation history to save context space while preserving essential information, and `/cost` shows token usage and the estimated API cost for the current session. For developers who prefer modal editing, `/vim` enables Vim keybindings for the input field. If you need to halt a task in progress, pressing `Escape` or `Ctrl+C` interrupts the current operation and returns you to the prompt.

When you want Claude to execute a shell command, a safe pattern is to ask it to report first and explain any failures before acting: "Run [command] and tell me the output. If there are any errors, explain what went wrong before attempting a fix." This keeps you in the loop while still benefiting from Claude's ability to interpret results.

All chapters
  1. 1Getting Started with Claude Code
  2. 2Project Context and Configuration
  3. 3Reading, Searching, and Understanding Code
  4. 4Writing, Editing, and Refactoring Code
  5. 5Testing, Debugging, and Code Review
  6. 6APIs, Data, and Infrastructure
  7. 7Architecture, Documentation, and Release Workflow

Drill it

Reading is not remembering. These come from the Claude Code Prompts deck:

Q

What is Claude Code?

Claude Code is Anthropic's official AI-powered CLI tool that helps developers write, edit, debug, and understand code directly in the terminal.

Q

How do you start Claude Code?

Run `claude` in your terminal from any project directory to start an interactive session with the AI assistant.

Q

What is the key benefit of working in Claude Code's agentic mode?

Claude Code can read files, write code, run tests, and execute shell commands autonomously, completing complex multi-step tasks end-to-end.

Q

How do you give Claude Code access to your entire project?

Navigate to your project root before starting Claude Code — it will automatically have context of all files in the working directory.