Lesson 30 of 2116
Installing and Using Claude Code CLI
Claude Code is Anthropic's terminal-native coding agent. Let's install it, wire it to a project, and use the features most engineers miss on day one.
Lesson map
What this lesson covers
Learning path
The main moves in order
- 1A Coding Agent That Lives in Your Shell
- 2Claude Code
- 3CLAUDE.md
- 4slash commands
Concept cluster
Terms to connect while reading
Section 1
A Coding Agent That Lives in Your Shell
Claude Code is a terminal-based agent that reads and writes files, runs commands, and carries project context across sessions. Unlike an IDE plugin, it can drive your entire development environment, not just the editor.
Install in under two minutes
Two commands and you are running an agent against your codebase.
# Install globally via npm
npm install -g @anthropic-ai/claude-code
# First run — authenticates via browser
cd my-project
claude
# Inside the TUI, type your first request:
# "Explain what this repo does and list the main entry points."CLAUDE.md: project memory
Drop a CLAUDE.md file at the root of your project. Claude Code reads it on every session. This is where you put your project's conventions, scripts to run, architecture notes, and the AI etiquette you want followed. Teams treat it as a living style guide.
A CLAUDE.md is the single highest-leverage file in any Claude Code project.
# CLAUDE.md
## Stack
- Next.js 15, TypeScript, Tailwind, Postgres via Prisma.
## How to run
- `pnpm dev` for local, `pnpm test` for tests, `pnpm build` before PR.
## Conventions
- Server actions live in `app/actions/`, named `<verb><Noun>`.
- Never commit directly to main — always open a branch.
- Use Zod for all public API inputs.
## Things to avoid
- Do not add new dependencies without asking first.
- Do not rename exported functions — downstream consumers break.Slash commands and skills
As of 2026, slash commands and skills are unified in Claude Code. Put markdown files in .claude/skills/ at the project root, and each one becomes a /slash-command. The skill defines a repeatable workflow: run tests, deploy, generate a PR description, whatever you need.
Now typing /pr-ready in any Claude Code session triggers this playbook.
# .claude/skills/pr-ready.md
---
name: pr-ready
description: Prepare the branch for PR review
---
1. Run `pnpm lint --fix` and commit any fixes.
2. Run `pnpm test` and make sure all pass.
3. Run `pnpm build` and fix any type errors.
4. Write a PR description summarizing the diff in 3 bullets.
5. Suggest a PR title under 70 characters.Sub-agents: up to 10 in parallel
A sub-agent is a separate Claude instance spawned from your main session to handle a narrow job. Define one in .claude/agents/explore.md with its own tool access and system prompt. Then say: Use the explore agent to find all auth-related files. Up to 10 can run in parallel, which is a game-changer for parallel codebase exploration.
Day-one workflow
- 1Install, authenticate, cd into your project
- 2Write a CLAUDE.md describing stack, conventions, and commands
- 3Ask Claude to explain the repo architecture out loud
- 4Create one skill for a workflow you repeat (tests, deploy, etc.)
- 5Ask Claude to plan a feature, then execute step by step
“The best interface is the one that can drive the whole machine. The terminal still is.”
Key terms in this lesson
The big idea: Claude Code treats your terminal as the agent's workspace. CLAUDE.md gives it context, skills automate recurring work, and sub-agents run parallel tasks. Invest in those three and the tool compounds.
End-of-lesson quiz
Check what stuck
15 questions · Score saves to your progress.
Tutor
Curious about “Installing and Using Claude Code CLI”?
Ask anything about this lesson. I’ll answer using just what you’re reading — short, friendly, grounded.
Progress saved locally in this browser. Sign in to sync across devices.
Related lessons
Keep going
Creators · 55 min
Agentic Shell Workflows — Claude Code Sub-Agents in Practice
Sub-agents turn Claude Code from a coding assistant into a small engineering team that works in parallel. Let's build a real sub-agent workflow end to end.
Creators · 50 min
Test-Driven AI Development
TDD was already the gold standard. Paired with an agent, it becomes the tightest feedback loop in software. Here's the full workflow and the pitfalls.
Creators · 50 min
AI-Assisted Code Review Workflows (for Teams)
Code review is the highest-leverage touchpoint in a team. Automating the noise with AI frees humans to focus on the irreducibly human parts. Let's design the workflow.
