Claude Code Tutorial 2026: Run AI Agents From Your Terminal
Claude Code lets you run AI agents from your terminal that read files, write code, and finish real tasks. This 2026 tutorial shows you setup to first agent in 15 minutes.
🤖 What Is Claude Code, and Why Run AI Agents From a Terminal?
Claude Code is Anthropic's command-line tool that turns Claude into an agent on your computer. Instead of pasting text into a chat window and copying answers back out, you open a terminal, type what you want, and the agent does the work directly: it reads your files, edits them, runs commands, and reports back. That difference sounds small until you experience it. A chatbot gives you instructions. An agent executes them.
Here is a concrete example from my own setup. I asked Claude Code to reorganize a folder of 200 blog draft files by date and topic. It listed the files, wrote a small script, ran it, verified the results, and told me what it changed. Total time: about two minutes. Doing that by hand would have eaten an afternoon.
The terminal part scares people off, and it should not. You need exactly one skill: typing a sentence and pressing Enter. Claude Code handles the actual commands. When it wants to do something on your system, it asks permission first, so you approve or reject each action until you trust it enough to loosen the rules.
In 2026, Claude Code runs on the Claude 4 model family. Claude Sonnet 4.6 is the fast, everyday choice, and Claude Opus 4.8 is the heavyweight for complex, multi-step work. You can switch between them inside a session, which matters because you pay for what you use if you go through the Anthropic API.
Agent vs. Chatbot: The One-Line Difference
A chatbot answers questions. An agent takes actions toward a goal, checks its own results, and keeps going until the task is done or it needs your input. Claude Code is the second kind, and that is why it lives in the terminal, where actions actually happen.
⚡ How to Install Claude Code in Under 10 Minutes
Setup is genuinely short. You need a computer running macOS, Windows, or Linux, and a Claude account. Claude Code is included with Claude Pro and Max subscriptions, or you can connect it to an Anthropic API key and pay per use. For most beginners, the subscription route is simpler because there are no per-token surprises.
Open your terminal app: Terminal on Mac, PowerShell or Windows Terminal on Windows. Then install and start Claude Code with the commands below. The first launch walks you through login in your browser, and after that you are in an interactive session.
Once you see the Claude Code prompt, type something harmless to test it, like asking it to summarize what is in your current folder. Watch how it asks permission before reading or changing anything. That permission system is your safety net while you learn.
One setup tip that saves headaches: start Claude Code inside a specific project folder, not your home directory. The agent treats the folder you launch it from as its workspace, so a scoped folder keeps its attention, and its file access, where you want it.
The Exact Commands
Install with npm: npm install -g @anthropic-ai/claude-code. Then move into a project folder with cd my-project and type claude to start. On first run it opens a browser window to log in with your Claude account. That is the entire setup.
Subscription or API Key?
Claude Pro or Max: flat monthly cost, usage limits reset over time, easiest for beginners. Anthropic API key: pay per token, no monthly commitment, better for occasional or automated use. You can switch later, so do not overthink this choice on day one.
# Quick start (copy and paste) npm install -g @anthropic-ai/claude-code cd your-project-folder claude # First things to try inside the session: "What files are in this folder?" "Read notes.txt and summarize it in 3 bullets" "Create a file called ideas.md with 5 blog post ideas about coffee"
🖥️ Your First Agent Session: 5 Commands That Do Real Work
The fastest way to understand agents is to give one a real task. Skip the toy questions and try jobs you would otherwise do by hand. Everything below works in plain English. You never need to know the underlying shell commands, because writing them is the agent's job, not yours.
First, file cleanup: point Claude Code at a messy downloads or documents folder and say what organized looks like to you. Second, summarization across files: ask it to read every text file in a folder and produce one digest. A chatbot cannot do this because it cannot see your files. Third, data wrangling: hand it a CSV export from anywhere and ask for totals, top items, or a cleaned version. Fourth, writing scaffolds: have it create a folder structure and template files for a new project. Fifth, small scripts: describe a repetitive task you do weekly and ask it to write a script you can rerun anytime.
While it works, read what it shows you. Claude Code narrates its plan, shows each command before running it, and explains results. Treat those narrations as a free course in how your computer actually works. After a week of sessions, most people start recognizing the patterns.
When a task is big, ask for a plan first: say something like, before you touch anything, show me your plan. The agent will outline steps and wait for your approval. This one habit prevents most beginner mishaps, because you catch misunderstandings before any files change.
⚖️ Claude Code vs. OpenAI Codex vs. Chat Tools: Which Fits You?
Claude Code is not the only terminal agent in 2026. OpenAI Codex is the closest competitor, a CLI agent from OpenAI that also works in your terminal and through cloud tasks. Both are capable, and I keep both installed, but they feel different in daily use.
In my experience, Claude Code is stronger at long, multi-step tasks where the agent has to keep track of context, ask good clarifying questions, and recover when something fails midway. Codex is fast and integrates naturally if you already live in the OpenAI ecosystem. Regular chat interfaces like the Claude app or ChatGPT still win for pure thinking work: brainstorming, drafting, and questions with no file access needed.
The honest answer for beginners: pick the ecosystem you already pay for. If you have a Claude Pro or Max subscription, Claude Code costs nothing extra to try. If you have ChatGPT Plus or Pro, Codex is the natural first step. The skills transfer almost completely between them, so nothing you learn is wasted.
The table below compares the realistic options for running agent-style AI in 2026.
| Tool | Where It Runs | Best For | Access |
|---|---|---|---|
| Claude Code (Sonnet 4.6 / Opus 4.8) | Terminal, IDE, desktop app | Multi-step agent tasks, file work, coding | Claude Pro/Max or Anthropic API |
| OpenAI Codex | Terminal, IDE, cloud | Coding tasks in the OpenAI ecosystem | ChatGPT paid plans or OpenAI API |
| Claude app (chat) | Browser, mobile | Brainstorming, drafting, Q&A | Free tier available |
| ChatGPT | Browser, mobile, desktop | General chat, image tasks with gpt-image-2 | Free tier available |
| Anthropic API direct | Your own scripts | Custom automations you build yourself | Pay per token |
🔌 MCP Servers: How Agents Connect to Your Real Tools
Out of the box, Claude Code works with files and commands on your machine. MCP servers are how it reaches everything else. MCP stands for Model Context Protocol, an open standard Anthropic released that lets AI agents talk to outside services through small connector programs. Think of an MCP server as a power adapter: one side plugs into the agent, the other side plugs into Gmail, Notion, Slack, a database, or your browser.
Once a server is connected, the agent gains those abilities in plain conversation. With a Google Drive MCP server attached, you can say, find last month's budget spreadsheet and summarize the changes, and the agent actually does it. No copy-paste, no switching tabs.
Adding a server is one command in the form: claude mcp add, followed by the server details from that server's documentation. Popular connectors in 2026 include Notion, Slack, GitHub, Google Drive, and browser automation servers like Playwright. The ecosystem is large because anyone can publish a server, which is also your cue for caution.
A security note worth taking seriously: every MCP server you add is code that can act on your accounts. Install servers only from official vendors or well-known open source projects, read what permissions they request, and skip anything you cannot verify. The agent is only as trustworthy as the connectors you hand it.
Three MCP Servers Worth Trying First
Start with a filesystem or Google Drive server for document work, a browser automation server like Playwright for web tasks, and the connector for whatever tool holds your notes, such as Notion. Those three cover most everyday workflows and teach you how the pattern works.
🛠️ Real Workflows You Can Copy Today
Here is how terminal agents fit into actual creative and business work, based on pipelines I run myself. The pattern is always the same: Claude Code acts as the coordinator, and specialized AI services do the media-specific jobs.
Content pipeline: I use Claude Code to draft and edit long-form articles, check them against an SEO checklist stored in a config file, and save structured drafts ready for publishing. The agent reads my style guide from the project folder every session, so output stays consistent without me repeating instructions.
Audio workflow: for narrated content, the agent prepares scripts, then a service like ElevenLabs turns the script into natural speech through its API. For music, Suno V5.5 generates full tracks from text descriptions. Claude Code can write and organize the prompts, call the APIs through small scripts it writes itself, and file the outputs into the right folders.
Image workflow: the same coordinator pattern works for visuals. The agent drafts detailed image prompts, sends them to a generator such as gpt-image-2, and renames and sorts the results. The point is not that one AI does everything. The point is that one agent can orchestrate many tools, and the terminal is where that orchestration happens.
Start with one pipeline, not five. Automate the single task that annoys you most every week, get it reliable, then expand. Agents reward incremental trust.
✅ Before You Run Your First Agent: A Safety and Setup Checklist
Agents that can change files deserve a little discipline. None of this is hard, and all of it is the difference between a great first week and a frustrating one.
The core principle: give the agent a sandbox before you give it your house. Work inside a dedicated project folder, keep backups of anything irreplaceable, and use the permission prompts as your review step instead of clicking approve on reflex. Read what the agent plans to do; if the plan surprises you, ask it to explain before approving.
Also set up a CLAUDE.md file in your project folder. Claude Code reads this file automatically at the start of every session, so it is the place for standing instructions: your preferred style, folders it should never touch, and how you want it to behave. Writing five lines there beats repeating yourself in every session.
Run through this checklist before your first serious session.
- ✔Create a dedicated project folder and launch Claude Code from inside it
- ✔Back up any important files before letting an agent edit them
- ✔Write a CLAUDE.md file with your rules and off-limits folders
- ✔Keep permission prompts on until you trust the agent's judgment
- ✔Ask for a plan before approving any multi-step task
- ✔Install MCP servers only from official or well-known sources
- ✔Start with Claude Sonnet 4.6 for speed, switch to Opus 4.8 for complex jobs
- ✔Check your usage or API spend after the first few sessions
❓ Frequently Asked Questions
Do I need to know how to code to use Claude Code?
No. You interact with it entirely in plain English, and it writes and runs any code the task needs. Basic comfort with opening a terminal helps, but that is a five-minute skill. Many non-programmers use it purely for file organization, writing, and data tasks.
Is Claude Code free?
The tool itself is free to install, but it needs either a Claude Pro or Max subscription or an Anthropic API key to run. Subscriptions give you a flat monthly cost with usage limits, while the API charges per token used. Beginners usually find the subscription simpler to manage.
What is the difference between Claude Code and ChatGPT?
ChatGPT is primarily a chat interface: you ask, it answers, and you apply the answer yourself. Claude Code is an agent that acts on your computer, reading files, running commands, and completing multi-step tasks with your permission. The closest ChatGPT-side equivalent is OpenAI Codex, which also runs in a terminal.
Is it safe to let an AI agent run commands on my computer?
Claude Code asks permission before reading files, editing them, or running commands, so nothing happens without your approval by default. Keep those prompts on while learning, work inside a dedicated folder, and back up important data. The main real risk is approving actions without reading them, so slow down on the permission dialogs.
Which model should I choose, Claude Sonnet 4.6 or Opus 4.8?
Use Sonnet 4.6 as your default: it is fast, capable, and cheaper on API pricing. Switch to Opus 4.8 for long, complex tasks like large refactors, multi-file research, or anything where the agent must reason across many steps. You can change models mid-session, so experiment with both.
🏁 Final Thoughts
Three things to remember from this tutorial. First, Claude Code turns Claude from a chatbot into an agent: it acts on your files and finishes tasks instead of just describing them. Second, setup is genuinely beginner-friendly: one install command, one login, and a plain-English conversation in your terminal, with permission prompts protecting you while you learn. Third, the real power arrives when you connect things: MCP servers link your agent to tools like Notion, Google Drive, and your browser, and the agent can coordinate services like ElevenLabs, Suno V5.5, and gpt-image-2 into full workflows. Your next action: install Claude Code today, point it at one messy folder, and give it one real task you have been putting off. Fifteen minutes from now you will understand agents better than any headline could teach you. If this guide helped, subscribe for more hands-on AI workflow tutorials, and drop a comment with the first task you automated. I read every one.
Last updated: July 18, 2026 · Keyword: Claude Code tutorial · Agents at Work

Comments
Post a Comment