CC
0 XP
0

Chapter 1: Ground Zero

Running Commands

build5 min

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"

Terminal
$Claude wants to run: npm install lucide-react

Claude Code asks for permission before running any command. You'll see exactly what it wants to run before anything happens.

💡Info

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"

Terminal
$Claude wants to run: npm run dev
Tip

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:

  1. "Initialize a git repo and make an initial commit" -- Claude Code runs git init, stages files, and commits
  2. "What's the current git status?" -- Claude Code runs git status and interprets the output for you
  3. "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:

  1. Claude Code tells you what command it wants to run
  2. You see the exact command (e.g., npm install lucide-react)
  3. You approve, reject, or modify it
  4. Claude Code runs the command and shows you the output
  5. 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 installrm -rf
npm run devgit push --force
git statuschmod or chown
npx create-next-appDatabase migrations
⚠️Warning

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.

Terminal
$> "Run the linter and fix any issues"

Your todo app now has icons installed and a utility function ready. Next, let's tackle something more impressive -- multi-file changes.