Skip to main content
Early access — new tools and guides added regularly
🟢 Zero to Claude Code — Guide 3 of 6
View track
>_ claude codeBeginner18 min

Terminal Basics for AI-Assisted Development

The only terminal knowledge you need to be productive with Claude Code. Navigation, files, Git basics, and npm — explained for complete beginners.

What you will build
Confidence navigating your terminal and managing projects from the command line

Why the terminal matters for Claude Code

Claude Code lives in your terminal. You do not need to become a terminal expert — Claude Code handles the complex commands for you — but you need enough fluency to navigate to your project, start Claude Code, and understand what it is doing. Think of it like learning to drive: you do not need to be a mechanic, but you need to know the steering wheel, pedals, and mirrors. This guide gives you exactly that level of knowledge. On macOS, open Terminal from Applications > Utilities, or press Cmd+Space and type Terminal. On Windows, open Windows Terminal from the Start menu. On Linux, you already know where your terminal is. When you open a terminal, you see a prompt — usually your username and a dollar sign. This is where you type commands. Every command follows the same pattern: command name, then options, then arguments. For example: ls -la Documents. The command is ls (list files), the option is -la (long format, all files), and the argument is Documents (which directory to list). That is the entire pattern. Everything in the terminal is a variation of this.

Navigating the filesystem

You are always "in" a directory. The command pwd (print working directory) tells you where you are. The command cd (change directory) moves you somewhere else. cd Documents moves into the Documents folder. cd .. moves up one level. cd ~ takes you to your home directory. The command ls lists everything in your current directory. ls -la shows hidden files too (files starting with a dot, like .gitignore). These four commands — pwd, cd, ls, and cd .. — are 80 percent of terminal navigation. To create a folder: mkdir my-project. To create a file: touch index.html. To delete a file: rm index.html. To delete a folder: rm -rf my-folder (be careful with this one — there is no recycling bin in the terminal). To move or rename: mv old-name.txt new-name.txt. To copy: cp original.txt copy.txt. Practice by creating a test folder, navigating into it, creating a few files, listing them, and then deleting the folder. Once this feels natural, you have the filesystem skills needed for Claude Code.

Git in 5 minutes

Git tracks changes to your files. It is how developers save their work and collaborate. You need three Git commands to work effectively with Claude Code. First: git init. Run this inside a project folder to start tracking changes. You only do this once per project. Second: git add . followed by git commit -m "your message". This saves a snapshot of your current files. The message describes what changed. Do this frequently — after every meaningful change. Third: git status. This shows which files have changed since your last commit. Claude Code uses Git extensively. When it makes changes to your project, you can use git diff to see exactly what it changed. If you do not like the changes, git checkout . reverts everything back to your last commit. This is your safety net — Claude Code cannot permanently break anything because Git lets you undo. Install Git from git-scm.com if you do not have it. Verify with git --version. That is all the Git you need to start. You will learn branches, remotes, and pull requests naturally as your projects grow.

npm and Node.js essentials

Claude Code runs on Node.js, so you need it installed. Download the LTS (Long Term Support) version from nodejs.org. It comes with npm, the Node.js package manager. Verify both: node --version and npm --version. npm installs software packages. npm install -g @anthropic-ai/claude-code installs Claude Code globally (the -g flag). npm install inside a project folder installs that project's dependencies. npm run dev starts most development servers. When Claude Code creates a new project, it often generates a package.json file — this is the project's manifest listing its name, scripts, and dependencies. You do not need to understand every line. The important parts are the "scripts" section (which defines commands like npm run dev and npm run build) and the "dependencies" section (which lists the libraries the project uses). If Claude Code tells you to run npm install, just run it. If it says npm run dev, run that. Claude Code will explain what each command does if you ask. The pattern is simple: Claude Code generates the project, npm install fetches the libraries, npm run dev starts it.

Setting up your first project folder

Let us create a workspace for your Claude Code projects. Open your terminal and run: mkdir ~/projects. This creates a "projects" folder in your home directory. Run: cd ~/projects. Now create your first project: mkdir my-first-project && cd my-first-project. Initialise Git: git init. Now start Claude Code: claude. You are now in a Claude Code session inside a fresh project folder with Git tracking. Try saying: "Create a simple HTML page with a heading that says Hello World and a paragraph about AI." Claude Code will create the file. Check it with: ls (you should see index.html). Open it in your browser by running: open index.html (macOS) or start index.html (Windows). You just built your first thing with Claude Code. The workflow for every project going forward is the same: create a folder, navigate into it, optionally initialise Git, start Claude Code, and describe what you want to build. Claude Code handles the rest. As your projects get more complex, Claude Code will create multiple files, install dependencies, and set up configurations — but the starting ritual is always the same: folder, terminal, claude.

Troubleshooting common terminal issues

"Command not found" is the most common terminal error. It means the program is not installed or your terminal cannot find it. For Claude Code: reinstall with npm install -g @anthropic-ai/claude-code and restart your terminal. For Git: install from git-scm.com. For Node: install from nodejs.org. Always restart your terminal after installing new software — the terminal caches its knowledge of available commands. "Permission denied" usually means you need administrator access. On macOS and Linux, prefix the command with sudo: sudo npm install -g @anthropic-ai/claude-code. On Windows, right-click your terminal and select "Run as administrator." "EACCES" errors on npm are permission issues with the global npm directory. The fix: follow the npm docs for changing the global install directory, or use a Node version manager like nvm which avoids permission issues entirely. If Claude Code starts but cannot connect, check your API key. It should be set as an environment variable: export ANTHROPIC_API_KEY=your-key-here. Add this line to your shell profile (~/.zshrc on macOS, ~/.bashrc on Linux) so it persists across terminal sessions. When in doubt, close your terminal, open a fresh one, and try again. Most terminal issues are solved by a fresh session.

Related Lesson

Your Development Environment

This guide is hands-on and practical. The full curriculum covers the conceptual foundations in depth with structured lessons and quizzes.

Go to lesson