Newsletter image

Subscribe to the Newsletter

Join 10k+ people to get notified about new posts, news and tips.

Do not worry we don't spam!

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Search

GDPR Compliance

We use cookies to ensure you get the best experience on our website. By continuing to use our site, you accept our use of cookies, Privacy Policy, and Terms of Service.

Claude - AI Coding

Claude AI Tutorial: Get Started with Claude Code in 10 Minutes

Claude Code is Anthropic's official CLI that gives Claude direct access to your terminal, file system, and dev tools. This hands-on tutorial gets you from install to your first agentic coding session.
2026-04-10
Updated 0

TL;DR
  • Agentic coding CLI: Claude reads, edits, runs, and commits code from your terminal
  • Ships as npm package, desktop app, web app, and IDE extensions for VS Code and JetBrains
  • Extend with MCP servers for GitHub, databases, Slack, and custom APIs

Most developers interact with Claude through a chat window in the browser. That works for quick questions, but it falls apart when you need Claude to read your codebase, edit files across multiple directories, run tests, and commit the result. Claude Code is Anthropic's official CLI that gives Claude direct access to your terminal, your file system, and your development tools. It runs as an agentic coding assistant: you describe what you want, and Claude reads your code, makes edits, runs commands, and verifies the result. This tutorial gets you from install to your first agentic coding session in under ten minutes.

What Is Claude Code

Claude Code is a terminal-based AI assistant that operates directly in your development environment. Unlike browser-based chat, it can read and write files, execute shell commands, search your codebase with grep and glob, create git commits, open pull requests, and interact with external services through MCP servers. It is powered by Claude Opus 4.6 (the same model behind the API) and ships as an npm package, a desktop app, a web app at claude.ai/code, and IDE extensions for VS Code and JetBrains.

The key difference from other AI coding tools: Claude Code is agentic. You do not copy-paste code snippets back and forth. You tell Claude what you want in plain language, and it figures out which files to read, what changes to make, which commands to run, and how to verify the result. You approve or reject each action along the way.

Install Claude Code

You need Node.js 18 or newer. Install globally via npm:

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

Verify the installation:

claude --version

On first run, Claude Code will open a browser window for authentication with your Anthropic account. You need an active API plan or a Claude Pro/Max subscription. Once authenticated, the CLI stores a session token locally and you will not need to log in again.

Your First Session

Navigate to any project directory and start Claude Code:

cd ~/my-project
claude

You land in an interactive prompt. Claude automatically detects the project context: the language, framework, git state, and any CLAUDE.md files with project-specific instructions. Ask it something about your code:

> How is authentication handled in this project?

Claude will search through your files, read the relevant source code, and give you a grounded answer with file paths and line numbers. No hallucinated function names, because it is reading your actual code.

Editing Code

The real power is in letting Claude edit files. Ask it to make changes and it will show you exactly what it plans to do before writing anything:

> Add input validation to the signup form. Email must be valid,
  password at least 8 characters.

Claude will read the relevant files, propose edits with diffs, and ask for your approval. You can approve individual changes, reject them, or ask for modifications. Every edit is shown as a before/after diff so you see exactly what changes.

For larger tasks, Claude works through multiple files in sequence. It reads the codebase to understand the patterns, makes consistent changes across files, and runs the test suite to verify nothing broke. If a test fails, it reads the error and fixes the issue before moving on.

Running Commands

Claude Code can execute shell commands on your behalf. This is how it runs tests, installs dependencies, checks git status, and verifies its own changes. You control how much autonomy Claude gets through permission modes:

ModeBehavior
DefaultClaude asks permission before every file edit and shell command
Auto-accept editsFile edits are applied automatically, shell commands still require approval
BypassFull autonomy: Claude runs everything without asking (use with caution)

Start with the default mode. As you build trust with how Claude operates in your project, you can open up more autonomy. You can also configure per-command permissions in your settings so common safe operations (like running tests or linting) are always auto-approved.

Slash Commands

Claude Code has built-in slash commands for common operations:

CommandWhat It Does
/helpShow available commands and usage
/clearClear conversation history and start fresh
/compactCompress conversation to save context window
/costShow token usage and cost for the current session
/initGenerate a CLAUDE.md file for your project

The /init command is worth running on any new project. It creates a CLAUDE.md file at the root of your repository that tells Claude how your project is structured, which conventions to follow, how to run tests, and what to avoid. Claude reads this file automatically at the start of every session.

CLAUDE.md: Project Memory

The CLAUDE.md file is how you give Claude persistent context about your project. It is loaded automatically every session, so Claude remembers your conventions without you repeating them. A typical CLAUDE.md includes:

# My Project

## Build & Test
- Run tests: `npm test`
- Lint: `npm run lint`
- Build: `npm run build`

## Conventions
- Use TypeScript strict mode
- Prefer named exports
- Tests go in __tests__ directories next to the source

You can also have CLAUDE.md files in subdirectories for area-specific rules, and a personal one at ~/.claude/CLAUDE.md for preferences that apply across all your projects.

MCP Servers: Extending Claude's Reach

Model Context Protocol (MCP) servers let Claude interact with external services. You can connect Claude Code to databases, GitHub, Slack, Jira, or any custom API by configuring an MCP server. Servers are defined in your Claude Code settings:

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "ghp_..." }
    }
  }
}

With a GitHub MCP server configured, Claude can read issues, create pull requests, review code, and comment on PRs directly from your terminal session. The same pattern works for any service that has an MCP server implementation. The MCP registry has a growing list of community-built servers.

Headless and CI Usage

Claude Code is not limited to interactive sessions. You can run it headlessly in scripts and CI pipelines with the -p flag:

claude -p "Review this PR for security issues and post your findings as a comment"

Or pipe input directly:

cat error.log | claude -p "What caused this crash and how do I fix it?"

This makes it straightforward to add Claude as a step in your CI workflow: automated code review on every PR, test failure analysis, documentation generation, or dependency audit. The output is plain text by default, or JSON with the --output-format json flag for machine consumption.

Tips for Effective Use

Be specific about scope. "Fix the bug" is vague. "The /api/users endpoint returns 500 when the email field is empty. Add validation and return a 400 with a descriptive error message" gives Claude everything it needs to find the file, make the change, and write a test.

Use /compact on long sessions. Claude Code compresses your conversation automatically when it approaches the context limit, but you can trigger it manually to free up space for complex tasks.

Let Claude run tests. The biggest wins come from Claude's ability to edit code, run the test suite, read failures, and fix issues in a loop. This works best when your project has good test coverage and a fast test command documented in CLAUDE.md.

Start small. Let Claude handle a single file change and verify it before asking for a large refactor. Once you see how it works in your codebase, scale up the scope.

Try It Now

Install Claude Code, run claude in any project directory, and ask it to explain something about your codebase. That first session is all it takes to see whether agentic coding fits your workflow. If you want to go deeper, run /init to generate a CLAUDE.md and start building Claude's understanding of your project.

Documentation: docs.anthropic.com/en/docs/claude-code/overview

Prev Article
Automate MODX with Claude Code: Full Site Control Over SSH
Next Article
How to create Logos with Midjourney

Related to this topic:

No related pages found.