<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Terminal on Damian Galarza | Software Engineering &amp; AI Consulting</title><link>https://www.damiangalarza.com/tags/terminal/</link><description>Recent posts from Damian Galarza | Software Engineering &amp; AI Consulting</description><generator>Hugo</generator><language>en-us</language><managingEditor>Damian Galarza</managingEditor><atom:link href="https://www.damiangalarza.com/tags/terminal/feed.xml" rel="self" type="application/rss+xml"/><item><title>What Claude Code Does in Your Terminal</title><link>https://www.damiangalarza.com/posts/2026-03-16-what-claude-code-does-in-your-terminal/</link><pubDate>Mon, 16 Mar 2026 00:00:00 -0400</pubDate><author>Damian Galarza</author><guid>https://www.damiangalarza.com/posts/2026-03-16-what-claude-code-does-in-your-terminal/</guid><description>Claude Code runs terminal commands and asks you to approve them. This explains what those commands mean and when to pause before saying yes.</description><content:encoded><![CDATA[<p>Every time you use Claude Code to work on a project, it runs commands in your terminal. You&rsquo;ve probably seen the prompt: &ldquo;I&rsquo;m going to run this command. Approve?&rdquo; If you&rsquo;ve come across commands like these and wondered what they actually mean, you&rsquo;re in the right place.</p>
<p>This guide is for people who are building real things with Claude Code but haven&rsquo;t spent much time in the terminal. Designers, product managers, founders who have picked up coding recently. If the terminal feels like reading another language, this is the starting point.</p>
<h2 id="what-the-terminal-actually-is">What the Terminal Actually Is</h2>
<p>Your computer has two ways to interact with it.</p>
<p>The first is what you&rsquo;re used to: icons, windows, buttons. You click a file to open it. You drag it to the trash to delete it. The computer shows you what&rsquo;s happening visually.</p>
<p>The second is the terminal. Instead of clicking, you type. Instead of visual feedback, you get text. It&rsquo;s the same computer doing the same things, just through a different interface.</p>
<p>The terminal can do everything the graphical interface (sometimes called a <strong>GUI</strong>, or graphical user interface) can do, and usually faster. When Claude Code searches your entire codebase for a function name, it does that in the terminal because searching thousands of files through a visual interface would be painfully slow.</p>
<p>The terminal comes pre-installed on Mac (it&rsquo;s called Terminal). Tools like VS Code and Cursor have one built in. When you see Claude Code working, it&rsquo;s using that built-in terminal.</p>
<h2 id="files-folders-and-where-you-are">Files, Folders, and Where You Are</h2>
<p>Everything on your computer is either a file or a folder. Files have content (code, images, documents). Folders contain files and other folders.</p>
<p>The terminal uses slightly different words. Folders are called <strong>directories</strong>. Your project is a directory (usually containing many sub-directories). Same concept, different name.</p>
<p>The terminal always has a <strong>current location</strong>. Think of it like Finder or Windows Explorer: you&rsquo;re always looking at a specific folder. In the terminal, that location is called the <strong>working directory</strong>.</p>
<p>When Claude Code opens in your project, the working directory is your project folder. Every command it runs starts from there.</p>
<p>File paths can be <strong>relative</strong> or <strong>absolute</strong>. An absolute path starts from the root of your computer, like <code>/Users/yourname/Projects/my-app/src/App.tsx</code>. A relative path starts from wherever you currently are. If your working directory is <code>/Users/yourname/Projects/my-app</code>, then <code>src/App.tsx</code> points to the same file. Most commands Claude Code runs use relative paths, so knowing your current location matters.</p>
<p>If you&rsquo;re ever unsure which directory you&rsquo;re in, you can check by running:</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#89dceb">pwd</span>
</span></span></code></pre></div><p>This prints the full path. Something like <code>/Users/yourname/Projects/my-app</code>. Read-only, nothing changes.</p>
<p>To move to a different directory, use <code>cd</code> (change directory):</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#89dceb">cd</span> ~/Projects/my-app
</span></span></code></pre></div><p>The <code>~/</code> is a shortcut that means your home folder (usually <code>/Users/yourname</code> on Mac or <code>/home/yourname</code> on Linux). So <code>~/Projects/my-app</code> expands to the full path automatically.</p>
<p>You can also move up one level with <code>cd ../</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#89dceb">cd</span> ../
</span></span></code></pre></div><p>The <code>../</code> means &ldquo;the parent directory,&rdquo; or one folder up from where you currently are. If you&rsquo;re in <code>/Users/yourname/Projects/my-app/src</code>, running <code>cd ../</code> takes you back to <code>/Users/yourname/Projects/my-app</code>.</p>
<p>This is how you navigate to your project before starting Claude Code. If Claude Code isn&rsquo;t finding the files you expect, it might be running from the wrong directory. Use <code>pwd</code> to check, and <code>cd</code> to move to the right place.</p>
<h2 id="looking-around-what-claude-code-does-first">Looking Around: What Claude Code Does First</h2>
<p>Before Claude Code makes any changes, it looks around. It needs to understand what exists before it can modify anything. The commands it uses for this are all read-only — they cannot break anything.</p>
<p><strong><code>ls</code></strong> lists the files and folders in the current directory:</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>ls
</span></span><span style="display:flex;"><span>ls src/components
</span></span></code></pre></div><p>Claude Code might run <code>ls</code> before creating a file to confirm it doesn&rsquo;t already exist. Or look inside a specific folder to understand what&rsquo;s there.</p>
<p><strong><code>cat</code></strong> prints the contents of a file:</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>cat package.json
</span></span></code></pre></div><p>When Claude Code reads your <code>package.json</code> to understand your project&rsquo;s dependencies, this is what it&rsquo;s doing. Reading, not changing.</p>
<p>One thing to keep in mind: <code>cat</code> is read-only, but be cautious if Claude Code tries to <code>cat</code> files that contain secrets, like <code>.env</code> files with API keys or passwords. Those contents will be visible in your terminal session and sent to Claude as context. Treat secret files the same way you&rsquo;d treat a password: don&rsquo;t share them unless you understand where they&rsquo;re going.</p>
<p><strong><code>grep</code></strong> searches for text inside files:</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep -r <span style="color:#a6e3a1">&#34;handleSubmit&#34;</span> src/
</span></span></code></pre></div><p>The <code>-r</code> here is a <strong>flag</strong>. Flags modify how a command behaves. They usually start with a dash (<code>-</code>) followed by a letter. In this case, <code>-r</code> tells <code>grep</code> to search <strong>recursively</strong>, meaning it looks through every file in the <code>src/</code> folder and all its sub-folders. Without <code>-r</code>, it would only search a single file.</p>
<p>You&rsquo;ll see flags on many commands. <code>ls -l</code> shows files in a detailed list. <code>rm -r</code> deletes directories. Each flag changes the command&rsquo;s behavior in a specific way. When you see one you don&rsquo;t recognize, that&rsquo;s a good time to ask Claude what it does.</p>
<p>This <code>grep</code> command finds every file in <code>src/</code> that contains the text <code>handleSubmit</code>. Claude Code uses this constantly to find where things are defined and where they&rsquo;re used.</p>
<p>All of these commands are exploratory. Nothing gets created, moved, or deleted. If you&rsquo;re unsure whether to approve a command, <code>ls</code>, <code>cat</code>, and <code>grep</code> are safe.</p>
<h2 id="when-claude-code-actually-changes-things">When Claude Code Actually Changes Things</h2>
<p>Reading is safe. Everything else deserves attention.</p>
<p><strong>Creating files and directories:</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>mkdir src/components/forms
</span></span><span style="display:flex;"><span>touch src/components/forms/LoginForm.tsx
</span></span></code></pre></div><p><code>mkdir</code> creates a directory. <code>touch</code> creates an empty file. Low-risk, but worth understanding what&rsquo;s being created and where.</p>
<p><strong>Moving and renaming:</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>mv LoginForm.tsx AuthForm.tsx
</span></span></code></pre></div><p><code>mv</code> moves or renames a file. After this runs, <code>LoginForm.tsx</code> no longer exists under that name. Renaming in the terminal is just a move with a new name.</p>
<p><strong>Deleting:</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>rm old-config.ts
</span></span><span style="display:flex;"><span>rm -r deprecated/
</span></span></code></pre></div><p><code>rm</code> deletes files. <code>rm -r</code> deletes entire directories and everything inside them. There is no trash bin. No undo. The file is gone.</p>
<p>Claude Code shouldn&rsquo;t be deleting things without telling you what and why. If you see <code>rm -rf</code>, verify that you actually want those files removed before approving. If you are unsure, ask Claude what it&rsquo;s deleting and why.</p>
<p><strong>Running your project&rsquo;s tools:</strong></p>
<p>Depending on your project, you&rsquo;ll see Claude Code use different <strong>package managers</strong> and tools. A package manager handles your project&rsquo;s dependencies: the external libraries and code your project relies on so you don&rsquo;t have to build everything from scratch.</p>
<p>The most common ones are <strong>npm</strong> (for JavaScript/Node.js projects), <strong>pip</strong> (for Python), <strong>gem</strong> (for Ruby), and <strong>yarn</strong> (an alternative to npm). Claude Code will use whichever one your project is set up with. When Claude Code runs <code>npm install</code> or <code>pip install</code>, it&rsquo;s downloading packages. <code>npm run build</code> tells npm to run a build script defined in your project.</p>
<p><strong>git</strong> is version control. It tracks every change to your code over time, like a detailed save history. <code>git add</code> tells git which files to include in your next save. <code>git commit</code> takes those staged files and saves them as a snapshot in the project&rsquo;s history.</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install
</span></span><span style="display:flex;"><span>npm run build
</span></span><span style="display:flex;"><span>git add . <span style="color:#89dceb;font-weight:bold">&amp;&amp;</span> git commit -m <span style="color:#a6e3a1">&#34;Add login form&#34;</span>
</span></span></code></pre></div><p>These commands do real things. <code>npm install</code> downloads packages to your project. <code>git commit</code> saves your changes to version history. When Claude Code runs these, it&rsquo;s making moves that affect your project&rsquo;s state.</p>
<h2 id="reading-a-command-before-you-approve">Reading a Command Before You Approve</h2>
<p>You might see more complicated commands from Claude Code. Take the following example:</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>find . -name <span style="color:#a6e3a1">&#34;*.test.ts&#34;</span> | grep <span style="color:#a6e3a1">&#34;auth&#34;</span>
</span></span></code></pre></div><p>These are actually sequences of simpler commands combined together, a powerful feature of the terminal that lets you compose tools. To understand it, break it down from left to right:</p>
<ul>
<li><code>find .</code> — search starting from the current directory (<code>.</code> means &ldquo;here&rdquo;)</li>
<li><code>-name &quot;*.test.ts&quot;</code> — find files that end in <code>.test.ts</code></li>
<li><code>|</code> — take the results and feed them to the next command</li>
<li><code>grep &quot;auth&quot;</code> — filter those results to only lines containing &ldquo;auth&rdquo;</li>
</ul>
<p>The full command: &ldquo;Find all test files and show me the ones related to auth.&rdquo; That&rsquo;s read-only. Safe to approve.</p>
<p>The <code>|</code> character is called a <strong>pipe</strong>. It chains commands together: the output of the first becomes the input of the second. You&rsquo;ll see it often. When you do, read each side separately, then understand what connects them.</p>
<h2 id="commands-to-think-twice-about">Commands to Think Twice About</h2>
<p>Most of what Claude Code runs is safe. A few patterns are worth pausing on.</p>
<p><strong><code>rm -rf</code> on anything important:</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>rm -rf src/
</span></span></code></pre></div><p>This deletes the entire <code>src</code> directory instantly. Claude Code will ask you to approve this command, but once you do, there&rsquo;s no additional safety net from the operating system. No trash bin, no undo. Be sure about this before approving.</p>
<p><strong><code>sudo</code>:</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>sudo npm install -g some-package
</span></span></code></pre></div><p><code>sudo</code> runs a command as an administrator. It will prompt you for your computer&rsquo;s password. Claude Code rarely needs this. If you see it, ask Claude why it&rsquo;s necessary. And don&rsquo;t type your password into Claude Code&rsquo;s prompt. If <code>sudo</code> is truly needed, deny the command, then run it yourself directly in your own terminal after Claude explains what it does.</p>
<p><strong><code>curl</code> piped into bash:</strong></p>
<p><code>curl</code> is a command that downloads content from the internet. On its own, it&rsquo;s harmless. It just fetches a file or a web page. But when you see it piped into <code>bash</code>, it becomes something different:</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl https://example.com/script.sh | bash
</span></span></code></pre></div><p>This downloads a script from the internet and runs it immediately. The <code>|</code> sends whatever <code>curl</code> fetches straight into <code>bash</code>, which executes it as commands on your computer. Uncommon, but when you see it, understand exactly what you&rsquo;re downloading before approving.</p>
<p><strong>Pro tip:</strong> If you&rsquo;re not sure what a script contains or whether it&rsquo;s safe, ask Claude to review it first. Deny the <code>curl | bash</code> command and say something like: &ldquo;What is this script you are trying to run in bash? Before we run this, can you download the contents and evaluate if it&rsquo;s safe or not? Help me understand what it does.&rdquo; Claude can fetch the file, display its contents, and walk you through what each part does so you can make an informed decision.</p>
<h2 id="when-a-command-fails">When a Command Fails</h2>
<p>Claude Code commands fail regularly. That&rsquo;s normal. Here&rsquo;s what the common errors mean:</p>
<ul>
<li><strong><code>command not found</code></strong> — the tool isn&rsquo;t installed. Claude Code will usually try to install it, or tell you what you need.</li>
<li><strong><code>No such file or directory</code></strong> — the path is wrong. Something about the file name or location doesn&rsquo;t match.</li>
<li><strong><code>Permission denied</code></strong> — you don&rsquo;t have access to that file or directory.</li>
</ul>
<p>When something fails, Claude Code will diagnose it and try a different approach. If it gets stuck, copy the error message and paste it back. Errors in the terminal are almost always actionable once you know what they&rsquo;re saying.</p>
<h2 id="getting-help-with-commands">Getting Help with Commands</h2>
<p>You don&rsquo;t need to memorize what every command does. There are two quick ways to get answers.</p>
<p><strong>Ask the command itself.</strong> Most terminal commands have a built-in help option. Add <code>--help</code> after the command name:</p>
<div class="highlight"><pre tabindex="0" style="color:#cdd6f4;background-color:#1e1e2e;-moz-tab-size:2;-o-tab-size:2;tab-size:2;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>grep --help
</span></span><span style="display:flex;"><span>git --help
</span></span><span style="display:flex;"><span>npm --help
</span></span></code></pre></div><p>This prints a summary of what the command does and what flags it accepts. The output can be dense, but scanning it for the flag you&rsquo;re curious about usually answers your question.</p>
<p><strong>Ask Claude.</strong> If a command Claude Code wants to run looks unfamiliar, deny it and ask Claude to explain. Something as simple as &ldquo;What does this command do?&rdquo; will get you a plain-language breakdown. Claude can explain the command, each flag, and what will happen when it runs. This is one of the most practical ways to learn the terminal while using Claude Code.</p>
<h2 id="youre-supervising-not-executing">You&rsquo;re Supervising, Not Executing</h2>
<p>You don&rsquo;t need to be a terminal expert to use Claude Code. Your job is to understand enough to supervise what it&rsquo;s doing.</p>
<p>Supervisors know enough to recognize when something looks right and when something needs a question. That&rsquo;s the skill worth developing here.</p>
<p>Most of what Claude Code runs is safe. The unsafe things are usually obvious once you know what <code>rm -rf</code> means and when <code>sudo</code> is suspicious. You now know both.</p>
<h2 id="cheat-sheet--glossary">Cheat Sheet &amp; Glossary</h2>
<p>I put together a 2-page reference card with every command and term from this post, including safety ratings for each one. Keep it next to your keyboard while you work, or print it out.</p>
<p><a href="/downloads/terminal-cheat-sheet/">Get the free Terminal Cheat Sheet (PDF) →</a></p>
<p>If you&rsquo;re new to the terminal and want to use Claude Code confidently, I offer coaching to help you get there. From project setup to understanding what&rsquo;s happening under the hood, we can work through it together. <a href="/coaching/#claude-code-basics">Book a Claude Code Basics session</a>.</p>
]]></content:encoded></item></channel></rss>