Claude Code CLI: Beginner to Expert Guide¶
An interactive tutorial series for learning Claude Code CLI - the terminal-based AI coding assistant. From your first command to advanced automation.
Note: This guide is specifically for Claude Code CLI (the terminal/command-line tool), not the Claude web interface at claude.ai.
What is Claude Code CLI?¶
Claude Code CLI is Anthropic's official command-line interface that brings Claude AI directly into your terminal. Unlike the web chat interface, Claude Code CLI:
- Runs in your terminal - Works where you already code
- Has direct file access - Reads, writes, and edits files in your project
- Executes commands - Runs shell commands and sees the output
- Understands context - Knows your project structure and codebase
- Integrates with tools - Git, npm, docker, and any CLI tool
CLI vs Web: Why Use Claude Code CLI?¶
| Capability | Claude Web | Claude Code CLI |
|---|---|---|
| File access | Copy/paste only | Direct filesystem access |
| Code editing | Manual copy back | Edits files in place |
| Run commands | Describe results | Executes and sees output |
| Git operations | Instructions only | Creates commits, PRs |
| Project context | You describe it | Reads your actual files |
| Tool integration | None | MCP, hooks, commands |
| Automation | None | Scripts, CI/CD, cron |
| Multi-file refactoring | Tedious | Seamless |
How to Use This Guide¶
Each section contains: - Concepts - Key ideas explained simply - Examples - Real terminal commands you can run - Exercises - Hands-on practice projects
Work through the levels in order, or jump to topics you need.
Learning Path¶
Level 1: Beginner¶
Start here if you're new to Claude Code.
| Tutorial | Description |
|---|---|
| 01-getting-started | Installation and first conversation |
| 02-basic-commands | Essential commands and navigation |
| 03-file-operations | Reading, writing, and editing files |
| 04-asking-questions | How to prompt Claude effectively |
Level 2: Intermediate¶
Build on the basics with real workflows.
| Tutorial | Description |
|---|---|
| 01-code-exploration | Navigating and understanding codebases |
| 02-debugging | Finding and fixing bugs with Claude |
| 03-git-workflows | Commits, PRs, and version control |
| 04-testing | Writing and running tests |
Level 3: Advanced¶
Master Claude Code's full capabilities.
| Tutorial | Description |
|---|---|
| 01-custom-commands | Creating slash commands |
| 02-hooks | Automating with lifecycle hooks |
| 03-mcp-servers | Extending Claude with MCP |
| 04-multi-agent | Working with subagents |
Level 4: Expert¶
Push the boundaries of what's possible.
| Tutorial | Description |
|---|---|
| 01-sdk-integration | Building with Claude Agent SDK |
| 02-enterprise-patterns | Team workflows and best practices |
| 03-performance | Optimizing for speed and cost |
| 04-n8n-integration | Workflow automation with n8n |
| 05-development-environment | Professional dev environment setup |
| 06-toolchain-integration | Essential developer tool integrations |
| 07-debugging-mastery | Debug, test & troubleshoot best practices |
| 08-cli-power-user | Advanced CLI techniques & automation |
Exercises¶
Hands-on projects to practice what you've learned:
| Exercise | Level | Description |
|---|---|---|
| hello-claude | Beginner | Your first Claude Code project |
| bug-hunter | Intermediate | Debug a broken application |
| auto-reviewer | Advanced | Build a code review automation |
Quick Reference¶
Terminal Commands (Starting Claude)¶
# Interactive session
claude
# Start with a prompt
claude "explain this codebase"
# Continue previous session
claude -c
# Non-interactive mode (for scripts)
claude -p "what does main.py do"
# Work in different directory
claude --cwd /path/to/project
# Check version
claude --version
Inside a Session (Slash Commands)¶
/help # Show available commands
/exit # Exit session
/clear # Clear conversation history
/compact # Summarize to save context
/config # View/edit settings
Keyboard Shortcuts¶
| Shortcut | Action |
|---|---|
Enter |
Send message |
Shift+Enter |
Multiline input |
Ctrl+C |
Cancel / Exit (2x) |
Up/Down |
History navigation |
Ctrl+L |
Clear screen |
Shell Integration (Add to ~/.zshrc)¶
Prerequisites¶
- Terminal/command line basics
- A code editor (VS Code recommended)
- Node.js 18+ installed
- An Anthropic API key or Claude Pro/Max subscription
Installation¶
Then authenticate:
Appendix¶
- Complete Cheat Sheet - All CLI commands organized by level with explanations
Contributing¶
Found an error or want to add content? Contributions welcome!