Chapter 1: Ground Zero
Running Commands
Running Commands
Claude Code doesn't just write code. It can run shell commands in your terminal -- installing packages, starting servers, running tests, and managing Git.
Installing packages
Let's add some dependencies to the todo app:
"Install the lucide-react package for icons"
Claude Code asks for permission before running any command. You'll see exactly what it wants to run before anything happens.
This is the permission system from the Permission Modes section in action. In the default mode, Claude Code always asks before running commands. You can approve, reject, or modify the command.
Starting the dev server
"Start the dev server so I can see my changes"
After starting the dev server, Claude Code stays aware that it's running. You can continue giving instructions while the server is active in the background.
Git commands
Claude Code is a natural with Git. Try these:
- "Initialize a git repo and make an initial commit" -- Claude Code runs
git init, stages files, and commits - "What's the current git status?" -- Claude Code runs
git statusand interprets the output for you - "Create a new branch called feature/add-todo-form" -- Claude Code runs
git checkout -b feature/add-todo-form
How permissions work
When Claude Code wants to run a command, here's the flow:
- Claude Code tells you what command it wants to run
- You see the exact command (e.g.,
npm install lucide-react) - You approve, reject, or modify it
- Claude Code runs the command and shows you the output
- It interprets the results and continues from there
Safe vs. risky commands
Claude Code understands which commands are routine and which need extra caution:
| Safe (routine) | Needs attention |
|---|---|
npm install | rm -rf |
npm run dev | git push --force |
git status | chmod or chown |
npx create-next-app | Database migrations |
Claude Code will never run a destructive command without clearly warning you. But always read the command before approving -- especially anything involving rm, git push --force, or database operations.
Running multiple commands
Sometimes Claude Code needs to chain commands together:
"Install the clsx and tailwind-merge packages, then create a cn() utility function in src/lib/utils.ts"
Claude Code will run npm install clsx tailwind-merge, then create the utility file -- all in one flow.
Your todo app now has icons installed and a utility function ready. Next, let's tackle something more impressive -- multi-file changes.