No history yet

Agentic Terminal Workflows

Beyond Chat: Agentic Coding in the Terminal

Most AI coding assistants live in a web browser or a text editor sidebar. You copy-paste code back and forth, turning the AI into a glorified search engine. Claude Code is different. It's a command-line interface (CLI) tool that lives where you work: the terminal. This isn't just about chatting with an AI; it's about giving an agent access to your development environment so it can read files, execute commands, and perform multi-step tasks on its own.

Claude Code is a terminal-first, agentic coding assistant built on Anthropic’s Claude models—designed to work inside your workflow, not alongside it.

This shift from a conversational partner to an active agent is what makes CLI-based tools so powerful. Instead of you being the go-between, the AI can directly interact with your codebase, run tests, and even commit changes. It moves from a question-and-answer model to a do-things model.

Lesson image

Getting Started

Installation is handled through common package managers. For most systems, you can install it using npm, the Node.js package manager.

# Using npm
npm install -g @anthropic-ai/claude-code

Once installed, the first step is authentication. Running the claude command for the first time will prompt you to log in. This is where you'll make a key decision about how you pay for usage.

You have two main options: connect it to your Anthropic API account or link it to a Claude Pro/Max subscription. The best choice depends entirely on your workflow.

ModelBest ForCost Structure
API AccessOccasional use, scripting, CI/CDPay-per-token. Cost scales directly with usage.
SubscriptionHeavy interactive use, complex debuggingFlat monthly rate. Cost-effective for frequent, long-running agentic loops and exploration.

For heavy, interactive development sessions where the AI might perform many actions, the subscription model often provides significant cost savings and predictability. API access is better suited for automated, infrequent tasks.

Working With Your Codebase

To start an interactive session, navigate to your project's root directory in your terminal and simply run claude. This launches the (Terminal User Interface), creating a persistent session where Claude maintains the context of your conversation and actions.

This is different from one-off commands, where you might ask a quick question and get a single response. In a persistent session, Claude remembers previous commands and their outputs, allowing for a more natural, iterative workflow.

Within the TUI, you can issue commands in plain English. The agent can read files, write to them, and execute shell commands. This direct access is what makes it so effective.

"Read the package.json file and then run npm install to set up the project dependencies."

Claude will first perform the cat package.json command (or an equivalent file-read operation), analyse its contents, and then execute npm install in your shell. You see the output directly in your terminal, just as if you had run the command yourself.

Plan Before You Act

Making changes across a large, unfamiliar repository can be risky. If you tell an AI to "refactor the authentication logic," you want to be sure it understands the architecture before it starts editing files. This is where Plan Mode comes in.

By pressing Shift+Tab, you toggle Plan Mode. In this mode, Claude won't execute any changes immediately. Instead, it will first explore the codebase, read relevant files, and formulate a detailed step-by-step plan for your approval. This gives you a chance to review its logic, correct any misunderstandings, and ensure the proposed changes align with your goals.

The alternative, which some call "YOLO mode," is to just let the agent make changes directly. This is fine for small, well-defined tasks like adding a new function to a single file. But for anything complex, using Plan Mode is a much safer and more reliable way to work.

By leveraging these agentic capabilities directly in the terminal, you can significantly speed up your development workflow, moving from simple code generation to true AI-assisted engineering.