Home/Blog/Generative Ai/A complete Claude Code tutorial
Home/Blog/Generative Ai/A complete Claude Code tutorial

A complete Claude Code tutorial

9 min read
Oct 03, 2025
content
What is Claude Code?
Claude Code in action: A quick demo
Claude Code setup: Install and configure the CLI
Choose the theme
Choose the plan
Why Claude Code is terminal-first (CLI > IDE for agents)
What Claude Code can do: Onboarding, refactors, and code review
Claude Code SDK (TypeScript and Python)
Claude Code slash commands (agent control)
Claude Code vs. Copilot, Cursor, Windsurf
Conclusion

Claude Code, Anthropic’s agentic AI coding assistant for the terminal, is getting real traction with developers. New AI coding tools launch weekly and most fade, but this one feels grounded in hands-on results. As a CLI inside your workflow, Claude Code explores your project, gathers context, and proposes multi-file changes—more like an AI agent than a traditional “copilot.”

Today, we will explore its core philosophy, practical applications, and why it might represent the most significant leap forward since the advent of the integrated development environment (IDE).

What is Claude Code?#

At its core, Claude Code is an agentic coding tool developed by Anthropic. It operates directly in the terminal, providing a native extension to your existing development environment. Integrating directly removes the need for additional servers or complex setups so that you can focus on the task at hand: writing and improving code.

Claude Code: Workflows and Tools

Cover
Claude Code: Workflows and Tools

Claude Code is Anthropic’s AI coding assistant, streamlining development with natural conversations, automation, and integrations. This course begins with the essentials: installation, setup, and the foundations of conversation-driven development. The learners learn to manage context, guide interactions, and work with Claude as a coding partner. The learners will then explore advanced features like custom commands, sub-agents, and hooks. They’ll see how to automate tasks, secure workflows, and extend Claude Code with SDK integrations. By structuring conversations and using Claude’s orchestration, they can achieve clarity and efficiency across complex projects. Finally, they will focus on integrations, connecting Claude Code with MCP servers and GitHub for seamless collaboration and version control. The course concludes with best practices, preparing the learners to apply Claude Code in real environments and unlock AI-powered workflows that boost productivity, security, and team efficiency.

4hrs
Beginner
14 Playgrounds
32 Illustrations

Crucially, Claude Code’s agentic nature means it can explore the codebase as needed and gather context automatically, without requiring manual file additions. This is a significant shift from traditional methods, where you often need to feed relevant files or code snippets to an AI.

The distinction between a “copilot” and an “agent” is not just semantics; it is a real difference in capability. A traditional copilot primarily suggests code. An agentic tool, however, performs operations on the codebase. This means less manual intervention from you, because the AI can navigate and comprehend the project structure and propose more context-aware solutions. Automating context gathering reduces cognitive load, often a bottleneck in large or unfamiliar codebases. It also implies that Claude Code can handle multi-file changes more effectively than tools that require explicit context, leading to higher-quality, integrated changes across a project.

To begin, ensure Node.js version 18 or higher is installed. Then install Claude Code globally with:

npm install -g @anthropic-ai/claude-code

Once installed, navigate to your project directory in the terminal and type claude to start the agent.

Claude Code in action: A quick demo#

Before diving into setup, here is a quick example of its agentic capabilities.

Consider an Astro project we have not seen before. Besides knowing Astro is a static site generator (SSG), we typically click through files, read documentation, and piece together how everything connects. With Claude Code, we can simply navigate to the project directory and ask it to explain the parts we care about. For example:

Analyze this Astro project and explain:
- The main components and their relationships
- How user authentication works
- Where API calls are handled

Claude Code explores the project structure within seconds, reads relevant files, and returns a comprehensive overview.

Claude Code response to an Astro question
Claude Code response to an Astro question

This level of understanding comes from a single command. There is no manual file selection, switching between tools, or hunting through documentation.

Let’s set Claude Code up so you can experience this yourself.

Claude Code setup: Install and configure the CLI#

The first time you run the claude command in a project directory, you will be guided through a one-time setup. This interactive onboarding tailors the tool to your preferences and explains its capabilities and billing model. The steps include:

Choose the theme#

The first screen focuses on readability. Claude Code asks you to choose a text style that fits your terminal’s color scheme.

  • Dark/light mode: Standard themes for the most common terminal backgrounds.

  • Dark mode (color-vision friendly) and light mode (color-vision friendly): These modes have higher-contrast palettes that are easier to distinguish for users with color vision deficiencies (CVD).

  • Dark mode (ANSI colors only) and light mode (ANSI colors only): These fallback options use a basic 16-color ANSI palette for compatibility with older or limited terminal emulators.

Selecting the theme
Selecting the theme

Use the arrow keys to navigate and select an option. This choice is not permanent; you can change it later with the /theme command.

Choose the plan#

Next, you will see Claude Code’s ASCII art and be prompted to select a sign-in method. This choice determines how you pay for usage. The two primary options are:

  • Claude account with subscription (Claude Pro/Max): Links Claude Code to a consumer subscription. This is a flat-fee model with a predictable monthly cost. It is often the best value for heavy usage and a fixed budget.

  • Anthropic Console account (API usage billing): A pay-as-you-go model billed by input and output tokens. This can be cost-effective for sporadic or light usage. For intensive tasks, costs vary.

Claude Code’s login screen
Claude Code’s login screen

Choose the plan that aligns with your workflow. Heavy users may prefer the subscription model for predictability, while occasional users may prefer the flexibility of API billing.

Before you proceed, Claude Code presents security notes that are worth reading carefully:

  • Claude can make mistakes: Review suggestions critically, especially when generated code may have security implications or side effects.

  • Use trusted codebases: Because Claude Code can execute commands and interact with files, untrusted repositories create a risk of prompt injection.

Press “Enter” to acknowledge these points and continue. After setup, you will land on the welcome screen and can begin exploring. Use /help or /status to get oriented. Type a slash command to run it.

Your journey with your new AI collaborator has officially begun. All you need to do is to simply type the command with a / and it works. You can see in the screenshot below the result of running the help command:

Claude Code’s available commands
Claude Code’s available commands

Why Claude Code is terminal-first (CLI > IDE for agents)#

Many developers ask, “Why the terminal?” In a world of sleek, feature-rich IDEs, a command-line interface might seem counterintuitive. This design is deliberate. As Boris Cherny, the creator of Claude Code, explains, the terminal is “almost like the most universal of all the interfaces.”

Anthropic’s engineers and researchers use a variety of stacks. Some prefer Cursor, some use VS Code, and others live in Vim. Claude Code is built to meet developers where they already are without disrupting carefully customized workflows.

A terminal-first approach also supports agility. Its simplicity enables fast iteration, which is crucial for a cutting-edge tool. It is also a testament to dogfooding. Claude Code is used daily inside Anthropic, including to help develop Claude Code itself. When you use a product so integrated into its creators’ process, design choices tend to be practical, workflows refined, and features aligned with real engineering needs.

What Claude Code can do: Onboarding, refactors, and code review#

Claude Code is purpose-built for coding, so it excels at developer workflows:

  • Codebase onboarding: Ask Claude to “explore” a project and explain it. It can scan and summarize a repository, identify key modules, and map dependencies. You can ask questions like “How does authentication work?” or “Find the files that handle user authentication.” It will browse and learn from the code. This is a major time-saver for new team members or when revisiting old projects.

  • Triage issues and create PRs: Claude Code hooks into GitHub or GitLab via the CLI. For example, /review lets you review pull requests. To emphasize what matters, you can fine-tune the review prompt in a claude-code-review.yml file. Claude can run tests (for example, npm test) and perform builds as part of its process. It can read issues, write code fixes, run your test suite, and open a PR, all from the terminal. For example, you might run /review after cloning the openai/gpt-oss repository.

Claude Code checking for PRs
1 / 2
Claude Code checking for PRs
  • Powerful refactors and multi-file edits: Describe a change, and Claude Code will coordinate it across files. It can modify multiple files and run linters or type checkers automatically. Reports from the developer community note success on large codebases that challenged other tools.

  • Test generation and debugging: Ask “Generate tests for this component.” Claude Code scaffolds a test file with cases for expected behavior and edge cases. When a bug appears, it can analyze errors, locate logs, and suggest a fix.

  • Project scripting and automation: Claude Code can write helper commands and maintain CLAUDE.md, a Markdown knowledge base for your repository. It supports custom slash commands by placing prompt files under .claude/commands/. For instance, a /project:fix-issue-123 command could instruct Claude to fetch issue 123 with gh issue view, apply a fix, run tests, and open a PR. You can also attach hooks that run scripts before or after edits.

Claude Code SDK (TypeScript and Python)#

While the interactive terminal experience is powerful for individuals, the software development kit extends that power to systems. The Claude Code SDK enables you to run Claude Code as a subprocess and integrate it programmatically.

The SDK supports multiple environments, offering command-line, TypeScript, and Python interfaces. The TypeScript SDK is available through the @anthropic-ai/claude-code npm package for Node.js applications. A Python SDK provides similar capabilities for Python-based workflows.

The SDK already underpins real integrations, such as a GitHub Actions setup for automated code review, PR creation, and issue triage. By treating Claude Code as a callable service, teams can automate complex, multi-step tasks and script workflows via the Claude Code SDK.

Claude Code slash commands (agent control)#

Slash commands are the primary interface for controlling the agent’s behavior. Use them in the interactive terminal session to manage context, review code, and adjust settings.

Command

Description

Common Use Case

/add-dir

Adds additional directories to Claude’s working session.

Extend Claude’s visibility into other folders for a broader project context.

/bug

Reports bugs to Anthropic with conversation context.

Use this when something breaks or doesn’t behave as expected.

/clear

Clears the current conversation history.

Reset the session to start fresh or reduce token usage.

/compact [note]

Summarizes the conversation, optionally guided by a focus instruction.

Maintain context efficiently without exceeding token limits.

/config

Views and modifies user-specific Claude settings.

Tune Claude’s behavior and preferences for your workflow.

/cost

Displays current token usage statistics.

Monitor cost and session efficiency.

/doctor

Runs diagnostic checks on the Claude Code installation.

Use this when you’re encountering performance or setup issues.

/help

Shows a list of available commands and usage instructions.

When you forget a command or need syntax reminders.

/init

Initializes a project by generating a CLAUDE.md guide file.

First step when setting up Claude Code for a new repo.

/login

Authenticates or switches Anthropic accounts.

Use when accessing Claude from a different machine or account.

/logout

Signs out of the current Anthropic account.

Good practice for shared or public machines.

/mcp

Manages connections to the MCP server and OAuth authentication.

Useful for troubleshooting or setting up enterprise environments.

/memory

Edits the CLAUDE.md file (Claude’s memory) directly from the session.

Quickly adjust Claude’s understanding without opening an external editor.

/model

Switches between different Claude models.

Choose a faster model for quick tasks or a smarter one for deep reasoning.

/permissions

Views and updates the file system or command permissions.

Control what Claude can access for better security and transparency.

/pr_comments

Displays comments from a pull request.

Gain context before reviewing code or generating changes.

/review

Requests a code review by Claude.

Let Claude analyze your changes and suggest improvements.

/status

Shows current account and system status.

Check login status or troubleshoot access issues.

/terminal-setup

Installs Shift+Enter newline binding (VSCode/iTerm2).

Improve multiline editing comfort in supported terminals.

/vim

Enables Vim-style modal editing in the terminal.

For developers who prefer editing with Vim keybindings.

Claude Code vs. Copilot, Cursor, Windsurf#

Claude Code enters a crowded field. The short answer is that it is more agentic, integrated, focused, and specialized.

IDE-based tools such as Cursor, Windsurf, and GitHub Copilot provide autocomplete and chat inside the editor, and some use Anthropic models under the hood. In other words, if you are using Cursor or Windsurf, you may already be tapping into the Claude lineage, often Sonnet 4, wrapped in a full-featured UI with panels, visual diffs, and buttons for actions. Many allow switching among multiple large language model providers. Claude Code, by contrast, focuses on Anthropic’s Claude and presents a minimal interface.

This single-model focus removes extra layers. If you have used Claude models in other IDEs and with Claude Code, you can feel the difference in performance.

Both approaches have merits. Windsurf is praised for a polished UI and strong context recall; Cursor for granular power-user features. Claude Code signals a different direction: treating AI coding as a background service rather than a button-filled app. This aligns with Anthropic’s minimalist ethos.

Conclusion#

Tools like Claude Code will continue to proliferate. GitHub Copilot is adding more agentic features, major cloud providers are placing AI in their consoles, and niche agents are emerging. Claude Code’s success suggests a strong appetite for terminal-based coding agents. We may soon interact with code more by conversation and commands than by typing every line.

If you are excited about tools like Claude Code, this is a great time to level up your AI-assisted workflow with expert-led, hands-on courses for today’s powerful coding assistants.

In short, Claude Code is a bold step. It is as if we handed developers a new kind of IDE that lives in the shell, thinks like an AI, and plugs into the DevOps pipeline. For experienced engineers, it can reduce months of work to weeks when used wisely. For engineering leaders, it hints at a future where teams collaborate with AI in the same codebase. The terminal may be old-school, but Claude Code feels revolutionary, a true AI collaborator at your fingertips.


Written By:
Usama Ahmed
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources