Terminal & Claude Code Power User

From "what's a terminal?" to daily superpowers

You already use Claude Code every day. But there's a whole world underneath it - the terminal - that you've been using without really understanding. This course fixes that, then shows you Claude Code features you didn't know existed.

What Is a Terminal?

YOU
keyboard
TERMINAL
text interface
💻
YOUR COMPUTER
files, apps, settings

Your Filesystem Is a Tree

/ (root)
├── Users/
│   └── halsarjant/
│       ├── Desktop/
│       ├── Documents/
│       ├── hal-ea/ ← your EA repo
│       │   ├── domains/
│       │   ├── inbox/
│       │   └── manifest.md
│       └── .claude/ ← Claude Code config
│           ├── settings.json
│           ├── skills/
│           ├── hooks/
│           └── commands/
├── Applications/
└── System/

pwd - Where Am I?

$ pwd
/Users/halsarjant/hal-ea

cd - Moving Around

$ cd hal-ea          # go into a folder
$ cd ..              # go up one level
$ cd ~               # go home
$ cd -               # go back to where you just were
$ cd ~/Desktop       # jump to an absolute path

ls - Looking Around

$ ls
domains/  inbox/  manifest.md  learnings.md

$ ls -la
drwxr-xr-x  12 hal  staff   384 Feb 27 09:30 .
drwxr-xr-x  93 hal  staff  2976 Feb 27 09:30 ..
drwxr-xr-x   8 hal  staff   256 Feb 27 09:30 .claude
drwxr-xr-x   4 hal  staff   128 Feb 27 09:30 .git
-rw-r--r--   1 hal  staff  4521 Feb 27 09:30 manifest.md

Anatomy of a Command

ls
command
(verb)
-la
flags
(how)
~/Desktop
argument
(what)

mkdir & touch - Creating Things

$ mkdir my-project              # create a directory
$ mkdir -p deep/nested/path     # create nested dirs
$ touch notes.md                # create an empty file
$ touch already-exists.md       # updates timestamp if exists

cp, mv, rm - File Operations

$ cp file.md backup.md          # copy a file
$ cp -r folder/ backup-folder/  # copy a directory (-r = recursive)
$ mv old-name.md new-name.md    # rename a file
$ mv file.md ~/Desktop/         # move a file
$ rm unwanted.md                # delete a file (no bin!)
$ rm -r old-folder/             # delete a directory

cat, head, tail - Reading Files

$ cat manifest.md               # print entire file
$ head -20 manifest.md          # first 20 lines
$ tail -10 manifest.md          # last 10 lines
$ tail -f logfile.log           # follow a file (live updates)

grep - Finding Needles

$ grep "status: seed" domains/**/*.md
$ grep -r "broker" .                    # search recursively
$ grep -i "CLAUDE" settings.json        # case-insensitive
$ grep -n "hook" settings.json          # show line numbers

Pipes | and Redirection >

command1
produces data
|
command2
filters it
|
command3
formats it
>
output.txt
saves to file
$ ls -la | grep ".md"              # list only .md files
$ cat manifest.md | head -5        # first 5 lines of manifest
$ echo "hello" > file.txt          # write to file (overwrites)
$ echo "more" >> file.txt          # append to file
$ history | grep "git push"        # find past commands

Your Keyboard Shortcuts

These work everywhere - terminal, Claude Code, any command line tool.

Environment Variables

$ echo $HOME
/Users/halsarjant

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:...

$ export MY_VAR="hello"
$ echo $MY_VAR
hello

Process Control

$ Ctrl+C              # kill the running command
$ Ctrl+Z              # pause (suspend) the command
$ fg                  # resume the paused command
$ bg                  # resume it in the background
$ jobs                # list paused/background jobs

Git Basics - Your Safety Net

$ git status              # what's changed?
$ git log --oneline -5    # recent history
$ git diff                # see exact changes
$ git add file.md         # stage a file for commit
$ git commit -m "message" # save a snapshot
$ git push                # sync to GitHub

Git - The Mental Model

Working
Directory
your files
git add
Staging
Area
ready to save
git commit
Local
Repo
saved locally
git push
Remote
(GitHub)
in the cloud

Terminal Foundations Quiz

1. What command shows your current directory?

2. What does cd .. do?

3. What does the -a flag do in ls -la?

4. What happens when you rm a file?

5. What does the pipe | do?

6. What does git status show you?

7. What does Ctrl+C do in the terminal?

cmux - Your Terminal Superpower

Module 2

Your terminal can do much more than run one command at a time. cmux turns Ghostty into a multi-pane powerhouse with an embedded browser.

cmux - Your Terminal's Secret Weapon

Splitting Panes

$ cmux new-split right     # split right
$ cmux new-split left      # split left
$ cmux new-split up        # split above
$ cmux new-split down      # split below
original
original
new pane
(right)

Your md Function Dissected

# What happens when you type: md /path/to/file.md

surface=$(cmux new-split right --json 2>&1 | awk '{print $2}')
cmux send --surface "$surface" "glow -p '/path/to/file.md'; exit"
cmux send-key --surface "$surface" Enter

Remote-Controlling Panes

# Type a command into a specific pane
$ cmux send --surface "$surface" "npm run dev"

# Press Enter in that pane
$ cmux send-key --surface "$surface" Enter

# Close a pane
$ cmux close-surface --surface "$surface"

A Browser in Your Terminal

$ cmux browser open https://example.com
$ cmux browser navigate <url> --surface <id>
$ cmux browser snapshot --interactive --surface <id>
$ cmux browser get text "h1" --surface <id>

Browser Superpowers

# Fill a form field
$ cmux browser fill "input[name=email]" "hal@genh.co" --surface <id>

# Click a button
$ cmux browser click "button.submit" --surface <id>

# Run JavaScript
$ cmux browser eval "document.title" --surface <id>

# Get the current URL
$ cmux browser get url --surface <id>

Utility Commands

$ cmux notify "Deploy complete!"          # system notification
$ cmux set-status "Building..."           # status bar message
$ cmux list-surfaces                      # see all open panes
$ cmux focus --surface "$id"              # switch to a pane

cmux Quiz

1. What does cmux new-split right do?

2. Why use CSS selectors instead of ref IDs with cmux browser?

3. What does cmux send --surface "$id" "ls" do?

4. How do you close a cmux browser pane?

Claude Code Power User

Module 3

You use Claude Code daily. Now learn the configuration, hooks, skills, and systems that make it truly yours.

The Brain: ~/.claude/

~/.claude/
├── CLAUDE.md           # Global instructions for ALL projects
├── settings.json      # Permissions, hooks, MCP servers
├── settings.local.json  # Machine-specific overrides
├── commands/           # Custom /commands
│   ├── brainstorm.md
│   ├── deploy-cloudflare.md
│   └── surge.md
├── skills/             # Knowledge library (18 skills)
│   ├── claudeception/
│   ├── frontend-design/
│   ├── frontend-slides/
│   └── ...
├── hooks/              # Event-triggered scripts
│   ├── session-handoff.js
│   ├── claudeception-activator.sh
│   └── gsd-statusline.js
├── agents/             # Custom agent definitions
├── projects/           # Per-project memory
└── history.jsonl       # All conversation history

CLAUDE.md - Your Instructions to Claude

# Global Instructions

## Terminal Environment
Hal uses Ghostty with cmux (not tmux).
Never use `tmux` - it's not installed.
Never try `ghostty` CLI for tab/pane management
- use `cmux`.

Project-Level Instructions

Hooks - Claude's Event System

Hook Event Timeline

SessionStart
UserPromptSubmit
PreToolUse
[Tool Runs]
PostToolUse
...repeat...

SessionStart Hooks

You have two SessionStart hooks:

1. GSD Update Checker gsd-check-update.js

2. Session Handoff session-handoff.js

UserPromptSubmit - The Claudeception Hook

You have one UserPromptSubmit hook:

Claudeception Activator claudeception-activator.sh

PreToolUse - Safety Guards

You have two PreToolUse hooks:

1. DCG (Bash commands)

2. Field Theory Permission Hook (Read/Write/Edit)

PostToolUse - Context Monitor

You have one PostToolUse hook:

GSD Context Monitor gsd-context-monitor.js

The Status Line

$ claude
> Working on the EA...

...

⚡ GSD: hal-ea | Phase 3.2 | 65% ctx

The Handoff Chain

Session 1

Working on task...
context getting full

/context-handoff
saves to handoff.md

/clear

Session 2

SessionStart hook fires
reads handoff file

Picks up where left off
full context available

/resume - Crash Recovery

# Terminal crashed? Accidentally closed the window?

$ claude --resume          # or just: claude -r
# Picks up your last conversation exactly where it stopped

$ claude --resume --list   # see recent sessions to choose from

Custom Commands

~/.claude/commands/
├── brainstorm.md        → /brainstorm
├── deploy-cloudflare.md → /deploy-cloudflare
├── surge.md             → /surge
├── bi-analysis.md       → /bi-analysis
├── bi-consolidate.md    → /bi-consolidate
├── funder-report.md     → /funder-report
└── gsd/                 → /gsd:*

Skills - Your Knowledge Library

~/.claude/skills/ (18 skills)
├── claudeception/       # Self-learning system
├── frontend-design/     # UI design skill
├── frontend-slides/     # Presentation builder
├── cmux-browser-automation/
├── context-handoff/
├── paper/               # ExCo paper writer
├── bi-analysis-workflow/
├── cli-hanging-in-claude-code/
├── swiftui-*            # 4 SwiftUI bug skills
└── ...

How Skills Get Created

You work on a task
Claudeception hook fires
Claude evaluates:
"Was there non-obvious discovery here?"
YES
Extract skill → SKILL.md created
NO
Skip (most sessions)

Permissions - What Claude Can Do

"permissions": {
  "allow": [
    "Bash(git pull *)",
    "Bash(git add *)",
    "Bash(git commit *)",
    "Bash(git push *)",
    "Bash(ls *)",
    "Skill(claudeception)",
    "Skill(context-handoff)"
  ],
  "defaultMode": "default"
}

MCP Servers - Extending Claude's Reach

// ~/.claude/.mcp.json
{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

GSD - Project Management for Claude

/gsd:new-project
Research → Roadmap → Phases
/gsd:plan-phase
Research → Plan → Verify Plan
/gsd:execute-phase
Execute → Atomic Commits → Verify
/gsd:verify-work
UAT → Complete

Agent Teams - Parallel Work

Team Lead (you)
Agent 1
Design
CSS
Agent 2
Content
HTML
Agent 3
Charts
Data
Agent 4
Testing
QA

Each works independently, reports back

How Claude Remembers

~/.claude/projects/-Users-halsarjant-hal-ea/
└── memory/
    └── MEMORY.md    # Persists across sessions

Claude Code Power User Quiz

1. What is CLAUDE.md for?

2. What does the claudeception hook do?

3. When does the session-handoff hook fire?

4. What is an MCP server?

5. How do custom commands work?

6. What does the GSD system do?

Daily Power User Workflows

Module 4

Putting it all together. Terminal, cmux, Claude Code, and your custom systems working as one integrated workflow.

A Power User Morning

1. Open Ghostty               → Terminal ready
2. cd ~/hal-ea && claude  → Start Claude Code in EA repo
3. SessionStart hooks fire Handoff loaded, GSD checked
4. /review                  → Check idea corpus status
5. /inbox                   → Process any overnight captures
6. Status line shows context Always know where you are

The Stack in Action

Real example: deploying a presentation

1. /frontend-slides        → Build a presentation
   Claude spawns 3 agents  → Parallel build
   Agents report back      → Assembled into one HTML file

2. /deploy-cloudflare     → Deploy to Cloudflare
   Security scan runs      → Checks for secrets/PII
   Deployed to pages.dev   → Live URL generated

3. cmux browser opens      → Test the deployment
   Navigate all slides     → Verify everything works
   Test on mobile viewport → Check responsiveness

4. Claudeception evaluates  → Any new skills to extract?

Try It Now - Terminal Exercises

Open a second pane (cmux new-split right) and try these:

Exercise 1: Navigate your EA repo

cd ~/hal-ea && ls -la
cd domains && ls
cd .. && pwd

Exercise 2: Search for something

grep -r "status: seed" domains/
grep -rn "broker" domains/ | head -5

Exercise 3: Check your git history

git log --oneline -10
git status
git diff --stat HEAD~1

Exercise 4: Inspect Claude Code's config

ls -la ~/.claude/
cat ~/.claude/CLAUDE.md | head -20
ls ~/.claude/skills/

Each takes under a minute. If you can do all four, you've got the fundamentals.

When Things Go Wrong

Common errors and what they mean:

ErrorWhat it meansFix
command not foundThe command isn't installed or isn't in your PATHCheck spelling, or install it
permission deniedYou don't have access to that file/folderCheck with ls -la, might need chmod
No such file or directoryThe path is wrongCheck with pwd and ls
fatal: not a git repositoryYou're not inside a git repocd to the right folder
Connection refusedThe service/server isn't runningCheck if the dev server is up

The terminal almost always tells you what's wrong - read the error message first before trying random fixes.

Cheat Sheet

Terminal Essentials

CommandWhat it does
pwdWhere am I?
cd pathGo somewhere
cd ..Go up one level
ls -laList everything
mkdir -pCreate directories
grep -r "text" .Search files
cmd1 | cmd2Pipe output
TabAuto-complete
Up arrowPrevious command

Git

CommandWhat it does
git statusWhat's changed?
git log --oneline -5Recent commits
git diffSee changes
git add && git commitSave a snapshot
git pushSync to remote

cmux

CommandWhat it does
cmux new-split rightSplit pane
cmux browser open URLOpen browser
cmux notify "msg"Send notification

Claude Code

CommandWhat it does
/commandsList available commands
/clearReset conversation
/context-handoffSave state for next session
Ctrl+CCancel current operation

Rescue

CommandWhat it does
Ctrl+CKill current command
Ctrl+Z then fgPause and resume
claude --resumeRecover crashed session
/context-handoff + /clearFresh context

Final Assessment

1. You're in /Users/hal/projects/ and want to get to /Users/hal/. What command?

2. What's the difference between > and >>?

3. You want to find all files containing "broker" in the current directory and below. Which command?

4. What makes cmux's CSS selectors more reliable than ref IDs for browser automation?

5. Where do global Claude Code instructions go?

6. What triggers the claudeception skill to extract knowledge?

7. You've been working for 2 hours and context is getting full. What's the workflow?

8. What's the relationship between commands and skills?

9. A PreToolUse hook can:

10. What does cmux send --surface "$id" "npm run dev" do?

11. You're running a long command and need to do something else quickly. What's the best approach?

12. After pushing a commit from Claude Code, you want to see what just changed. What command?

Course Complete

You made it.

You now understand the terminal foundations underneath Claude Code, how cmux extends your workspace, and the hooks, skills, commands, and systems that make Claude Code truly yours.

The best way to learn is to use it. Open Ghostty, start typing, and build the muscle memory. Every command you learn removes one more barrier between your ideas and their execution.