blackdark
Applied AIClaude CodeterminalCLIAIproductivityautomationadvanced

Claude Code in the Terminal: The Advanced Leap That Multiplies Your Power

You already use the Claude Code app and you want more. This guide takes you to the terminal: installation, key commands, parallel sessions with git worktrees, subagents, and advanced workflows. When it's worth it and when it isn't.

By BlackdarkUpdated on 6 min read

You've been on the Claude Code app for weeks and you've got the hang of it: clear tasks, review the viewer, approve. It works. But you're starting to feel the ceiling: you'd like to launch two things at once, you repeat the same instructions every session, and you keep thinking of tasks that would be a script if you could call Claude from the command line.

That ceiling has a name: it's time to drop down to the terminal. Not because it's "more pro," but because it unlocks a handful of things the app, by design, doesn't give you. This guide is the leap: what you actually gain, how to install it, the commands that matter, and the workflows that change the way you work.

Note

The engine is the same in the app and in the terminal. You're not going to "learn another Claude Code." You're going to uncover the advanced features that the visual interface keeps out of sight: parallelism, automation, and fine-grained permission control.

What you gain by dropping to the terminal (and what you don't)

Let's be honest so you don't waste your time. The terminal does not make you better or your results smarter. What changes is the way you work. You gain four concrete things:

  • Parallel sessions. Several instances working at once on different branches. It's the number-one reason to make the leap.
  • Automation. Flags like --print and --output-format turn Claude into just another command, chainable with |, grep, or a cron job.
  • Headless mode. Drop Claude inside a script or a CI pipeline without anyone watching the screen.
  • Permission control. You decide what gets auto-approved (read, list) and what needs your OK (delete, run, push).

What does not change: the safety net is still there. Claude asks for your approval before touching anything, just like in the app. It's just that now you decide where to set the bar.

Installation: five minutes

If you already have the app, you already meet the requirements (Node and, almost certainly, Git). The terminal installs as a global package:

Install Claude Code (terminal)
# With npm (the most common way)
npm install -g @anthropic-ai/claude-code

# Check that it's there and look at the version
claude --version

# Log in the first time (use the same account as the app)
claude

The first time you run claude inside a folder, it asks you to log in and starts an interactive session in that directory. From there you talk to it in natural language, exactly like in the app. The difference is in what you can do around that conversation.

Tip

Always start Claude inside the project folder (cd my-project && claude). The directory where you launch it is its workspace and where it looks for CLAUDE.md. Launching it from your home directory by mistake is the classic first stumble.

The commands that actually matter

Forget memorizing a hundred shortcuts. In practice, the day-to-day is six. The commands that start with / are typed inside the Claude session:

  • /clear β€” empties the context and starts clean. Your best friend: one session, one goal. When you switch tasks, clear it.
  • /init β€” scans the project and generates a first CLAUDE.md for you. The starting point for permanent context.
  • /agents β€” manages subagents (we explore these below).
  • /permissions β€” adjusts what gets auto-approved and what doesn't.
  • /resume β€” picks up a previous session with all its context. Close the laptop and tomorrow you continue where you left off.
  • # at the start of a sentence β€” saves that instruction into CLAUDE.md without opening the file. A golden shortcut.

And two flags you use when launching claude from outside, not inside:

  • claude -p "your task" (or --print) β€” runs a task and returns the result on standard output, with no interactive session. The gateway to automation.
  • --output-format json β€” returns the response structured so another program can process it.

The real leap: parallel sessions with git worktrees

Here's the real reason to drop to the terminal. In the app you work with one conversation at a time. In the terminal you can have three Claudes working in parallel, each on its own branch, without stepping on each other.

The trick is git worktree: it creates copies of the repository that share the same history but live in different folders and branches. You open one terminal per worktree, launch a claude in each, and they split the work.

Three parallel sessions
# From the project root, create three worktrees on new branches
git worktree add ../project-feature -b feature-payments
git worktree add ../project-tests   -b add-tests
git worktree add ../project-docs    -b update-docs

# In three separate terminal tabs/windows:
cd ../project-feature && claude   # "implement the payment flow"
cd ../project-tests   && claude   # "write tests for the auth module"
cd ../project-docs    && claude   # "update the README with the new endpoints"

# When a branch is ready, merge it and clean up its worktree
git worktree remove ../project-docs

This is what the app doesn't give you and what, once you try it, you don't let go of. While one session refactors, another documents and another tests. Your work goes from "waiting for Claude to finish" to "supervising three fronts." It's the step from assistant to team.

Heads up

Parallelism is not a free-for-all. Each session follows its goal and nothing else: one worktree, one task. If you mix topics within a single session, you strip its precision exactly like in the app. And review each branch before merging; three agents produce three times the changes to approve.

CLAUDE.md and slash commands: your personal operating system

If CLAUDE.md was already useful in the app, in the terminal it's essential. It's the permanent context Claude reads when it starts every session: what the project is, how you work, what rules to respect. With several sessions running in parallel, it's what keeps them all aligned without you repeating it to each one.

The second level is custom slash commands: Markdown files in .claude/commands/ that turn into shortcuts. You write a long prompt once and invoke it with /name forever.

Custom slash command (.claude/commands/review.md)
Review the code I just changed, looking for:

- Logic bugs and uncovered edge cases.
- Security issues (unvalidated inputs, secrets in plaintext).
- Inconsistencies with this project's conventions.

Don't rewrite anything yet. List the findings by severity
and wait for my OK before touching files.

From that file, you type /review inside any session and Claude runs that full review. Multiply this by your recurring tasks (commits, changelog, audits) and you stop typing the same thing every day.

Headless mode: Claude inside your scripts

The last advanced workflow is the one almost nobody uses and pays off the most. With claude -p you drop Claude into any script, cron job, or CI pipeline. It stops being a chat window and becomes a piece of your automation.

Claude in a script
# Generate the commit message from the staged diff
git commit -m "$(git diff --cached | claude -p 'Summarize these changes in a concise commit message, in the imperative')"

# Automatic triage: classify a new issue via standard output
echo "$ISSUE_BODY" | claude -p 'Classify this issue: bug / feature / question. Respond with the label only.' --output-format json

This is where Claude Code stops being a tool you open and becomes infrastructure that runs on its own. Start with bounded, deterministic tasks (summaries, classification, formatting), not with destructive tasks left unsupervised.

When to make the leap (and when not)

Don't drop to the terminal for status. Do it when you feel at least one of these three signals:

  1. You repeat instructions. If you copy the same prompt every session, you need slash commands and a fine-tuned CLAUDE.md.
  2. You'd like to launch two tasks at once. That's worktrees. The number-one reason.
  3. You keep thinking of scripts. If you think "this should run on its own," you want headless mode.

If you feel none of them β€” your tasks are one-off and you review them calmly β€” stay in the app without a second thought. It's just as powerful for that use and has no friction.

The rule for scaling is the same as always: little by little. Install the terminal, get used to the six commands, and only then try a worktree. Parallelism and scripts come once the earlier steps feel automatic. The leap isn't technical, it's about volume: the moment you have three sessions producing at once and a couple of slash commands set up, you won't want to go back.

FAQ

The engine is the same, but the terminal exposes features the app hides or doesn't have: parallel sessions with git worktrees, flags for automation (--print, --output-format), a headless mode to drop it into scripts, and finer control over permissions and context. The app is perfect for reviewing change by change; the terminal is for when you work at volume or want to chain Claude with other tools.

Just the basics. You need to be comfortable with cd, ls, running commands, and understanding what a git branch is. You don't have to be a bash expert: 90% of the time you write in natural language just like in the app. The new things to learn are four Claude commands (the slash commands) and the concept of a worktree.

They're several Claude Code instances running at once, each in its own copy of the project (a git worktree) and on its own branch. While one refactors, another writes tests and another documents, without stepping on each other. It's the workflow that turns Claude Code from an assistant into a team, and it's practically impossible to replicate with a single app window.

You don't lose it: in the terminal, Claude also asks for your approval before touching files or running commands. The difference is that you can adjust the permissions (auto-approve what's safe, require confirmation for what's destructive) and, if you want, give it more autonomy. More power and more responsibility: configure the permissions before you turn it loose on big tasks.

If your tasks are one-off, you review them calmly one by one, and you don't need parallelism or automation, the app is more than enough. The leap pays off when you notice three things: that you repeat the same instructions, that you'd like to launch two tasks at once, or that you'd like to drop Claude inside a script. If you feel none of them, stay in the app without a second thought.

Share
Newsletter

Get the next guides in your inbox

AI and marketing ideas and resources, no filler. What works and how to apply it.

Ideas and resources, no spam. Unsubscribe anytime.

Finding this guide useful?

Subscribe