What Is Claude Code? How the Anthropic Terminal Agent Works (2026 September)
Plain-English guide to Claude Code: what Anthropic's terminal agent does, how it differs from the Claude app, Cursor and Codex, and how sessions work.
Claude Code is Anthropic's coding agent that lives in your terminal. You open it inside a project folder, describe what you want in plain English, and it reads your files, edits code, runs commands and tests, and commits to git. It asks for permission before it does anything risky. This guide has 9 sections, 3 copy-paste blocks of prompts or commands, an 8-question Q&A, and takes about 26 minutes to read.
That one paragraph is the whole idea. The rest of this guide explains the pieces: what makes it different from the Claude app you may already use, how it compares to Cursor, GitHub Copilot and OpenAI Codex, what a session looks like from the inside, and the four extension mechanisms (skills, subagents, hooks and plugins) that turn it from a helper into a system you can shape.
Everything here describes Claude Code as it works in late 2026. Features move fast, so when the tool on your screen disagrees with this page, type /help and trust the tool. If you want hands-on steps instead of concepts, jump to the Claude Code tutorial for beginners after this.
Claude Code at a Glance
Claude Code in Plain English
Think of a capable colleague who sits at your keyboard but never touches it without asking. You say "the login form breaks on mobile, fix it." The colleague opens the relevant files, reads them, finds the CSS rule, changes it, runs the test suite, and tells you what was done. That colleague is Claude Code.
Technically, it is an agent: a Claude model wrapped in a loop. The loop is plan, act, observe, repeat. The model decides what to do, calls a tool (read a file, run a command), looks at the result, and decides again. It keeps going until the task is done or it needs you.
Three things make it feel different from chat. First, it works on your real files, not on text you pasted. Second, it can execute things and see the output, so it can check its own work. Third, it remembers your project rules across sessions through a file called CLAUDE.md.
You start it from any terminal by moving into a project folder and typing one command.
cd my-project
claudeThen you type a request like any chat.
The first time, it asks you to log in with an Anthropic account. From then on, each launch drops you into an interactive prompt where you describe tasks, review what it proposes, and approve or reject changes.
Claude Code is a Claude model with hands: it reads, edits, runs and commits inside your project, and asks before doing anything it cannot undo.
Claude Code vs the Claude App
The Claude app (web, desktop and mobile) and Claude Code use the same family of models. The difference is where the model lives and what it can touch.
In the app, Claude sees what you give it: a message, an uploaded file, a Project's knowledge base. It can write code in an Artifact and even run small snippets in a sandbox. But it cannot open your repository, run your build, or push a branch. You are the hands.
In Claude Code, the model has hands. It reads your file tree, greps for symbols, edits multiple files in one pass, runs npm test, reads the failure, fixes it, and runs again. You are the reviewer, not the typist.
A useful rule: use the app for thinking, learning and drafting; use Claude Code when the output needs to land in a real codebase or a real filesystem. Many people keep both open. They reason about architecture in the app, then hand the plan to Claude Code to implement.
Claude Code is also available outside the bare terminal. There are official extensions for VS Code and JetBrains that show diffs inline, and a web version that runs sessions on Anthropic's cloud against your GitHub repository. The mental model is identical in every surface.
Claude Code vs Cursor, Copilot and Codex
Cursor is a full code editor (a VS Code fork) with AI built into every surface: autocomplete, inline edits, a chat sidebar and an agent mode. You live inside Cursor and the AI is a feature of the editor.
Claude Code is the opposite shape. It is the agent first, and your editor is whatever you already use. It has no autocomplete and no GUI of its own. You delegate whole tasks rather than accepting suggestions line by line.
People who like to type code themselves and get help as they go often prefer Cursor. People who want to describe an outcome and review a finished change often prefer Claude Code. Plenty of developers use Cursor as the editor and Claude Code in the integrated terminal.
The comparison above is about shape, not quality. All four tools use strong models and all four improve every few months. Pick based on how you like to work: editor-first (Cursor, Copilot) or agent-first (Claude Code, Codex).
What Claude Code Can Actually Do
Opens any file in your project, understands it in context, and makes targeted edits across multiple files in one pass.
Executes shell commands: build scripts, package installs, database migrations, linters. Sees the output and reacts to it.
Reads history, creates branches, stages changes, writes commit messages, and opens pull requests with the GitHub CLI.
Runs your test suite, reads failures, patches the cause, and re-runs until green or until it needs your input.
Through Model Context Protocol servers it can fetch web pages, query databases, read Slack or Jira, or drive a browser.
Greps for symbols, follows imports, and explains how a feature works across dozens of files you have never opened.
The last card deserves emphasis. A large share of real Claude Code usage is not writing code at all. It is reading. "Explain how authentication works in this repo." "Where is the discount logic?" "Why does this cron job run twice?" The agent traces the answer through the files and reports back with paths and line numbers.
MCP is what stretches it beyond the filesystem. The Model Context Protocol is an open standard for plugging tools into AI models. Add an MCP server for your database and Claude Code can run read-only queries. Add one for a browser and it can load your staging site and check the layout. Add one for your issue tracker and it can read the ticket you are working on.
Non-coding work fits too. Because it can read and write any file, people use it to reorganize folders, rename hundreds of photos, convert spreadsheets, draft documentation, or build a personal website from a description. The AI Mastery course spends several lessons on exactly these non-developer workflows.
You type: add a rate limit of 100 requests per minute to the public API. Claude Code searches for the API routes, proposes a plan, waits for your approval, adds middleware, writes a test, runs the suite, and reports the changed files. You review the diff and commit. Five minutes, and you never left the terminal.
How a Session Works
A session starts when you run claude in a folder and ends when you exit. Inside, four things shape every interaction: context, CLAUDE.md, permissions, and the mode you are in.
Context
Context is the model's working memory for the session: your messages, its replies, and every file it has read or command output it has seen. It is large but finite. As a long session fills up, the tool compacts older material into a summary. You can trigger this yourself with /compact, or wipe the slate with /clear when you switch to an unrelated task.
A practical habit: one task per session, or at least one /clear between unrelated tasks. A session full of a database migration is worse at fixing CSS than a fresh one.
CLAUDE.md
This is a plain Markdown file in your project root. Claude Code reads it at the start of every session. It is where you write the rules you would tell a new hire: how to run tests, which folders are off limits, naming conventions, the deploy command, things that have gone wrong before. You can generate a first draft with /init.
# CLAUDE.md
- Run tests with `npm test` before any commit
- Never edit files under /legacy
- Use pnpm, not npmShort, specific bullets work best.
There can be several: a global one in your home directory for personal preferences, a project one committed to the repo for team rules, and nested ones in subfolders for local quirks. They stack.
Permissions
By default Claude Code asks before it edits a file or runs a command that changes anything. You approve once, or approve that kind of action for the rest of the session. Over time you build an allowlist of safe commands (your test runner, your linter) so it stops asking about them, while destructive actions still prompt.
Plan mode
Plan mode is a permission mode where the agent may read and think but not write or execute. Toggle it with a keyboard shortcut and ask for an approach. It explores the code, proposes a numbered plan, and waits. You edit or approve the plan, switch back to normal mode, and it executes. For anything larger than a one-line fix, starting in plan mode is the single best habit you can adopt.
Context disappears when the session ends. CLAUDE.md persists. If you find yourself explaining the same thing twice, put it in CLAUDE.md. If the agent keeps making a mistake, write a one-line rule about it there, and it stops.
Skills, Subagents, Hooks and Plugins
These four mechanisms are how you customize Claude Code. They sound similar but solve different problems, so here is each in one breath.
Skills
A skill is a folder containing a SKILL.md file: a documented, reusable procedure. It has a name, a one-line description of when to use it, and step-by-step instructions, optionally with scripts. Claude Code loads a skill when the task matches its description, or when you invoke it by name as a slash command.
.claude/skills/deploy/SKILL.md
---
name: deploy
description: Safe deploy with pre-checks
---
1. Check for uncommitted changes
2. Confirm no build is running
3. Run the deploy script, then verify with curlA skill turns tribal knowledge into a repeatable command.
Good skills are specific, tested, and say when not to use them. The Claude Code skills guide covers writing them from scratch.
Subagents
A subagent is a separate Claude Code instance the main agent launches for a bounded job. It gets its own context window, its own tools, and its own instructions. The main agent hands over a task, keeps working, and gets a summary back. This keeps your main context clean and lets several agents work in parallel: one searches the codebase, another writes tests, a third reviews the diff.
Hooks
A hook is a shell command that runs automatically at a lifecycle point: before a tool runs, after a file is edited, when the agent stops. Hooks are deterministic; the model cannot skip them. Typical uses are running a formatter after every edit, blocking commands that touch production, or sending a notification when a long task finishes.
Plugins
A plugin bundles skills, subagents, hooks and MCP servers into one installable package. Plugin marketplaces let teams and communities share them. Install a plugin and you get a whole workflow (say, a security review suite) rather than assembling it piece by piece.
Which mechanism do I need?
- โA repeatable procedure I want to trigger by name: write a skill
- โA big task that would flood my context: delegate to a subagent
- โSomething that must happen every time, no exceptions: add a hook
- โA bundle of the above I want to share or install: use a plugin
- โAccess to an external system (database, browser, Jira): connect an MCP server
- โA standing rule for this project: one line in CLAUDE.md
Who Claude Code Is For
Claude Code was built for developers, and developers still get the most from it. But the audience is wider than the name suggests.
Developers
For professional engineers it is a force multiplier on the boring parts: migrations, test scaffolding, dependency upgrades, understanding unfamiliar code, writing the PR description. The people who get the most value treat it like a fast junior colleague: clear briefs, plan first, review every diff, and keep CLAUDE.md honest.
Non-developers
If you can open a terminal and describe what you want, you can use Claude Code. Marketers use it to build landing pages. Analysts use it to clean CSV files and produce charts. Writers use it to manage a folder of drafts. Small business owners use it to build simple internal tools they would never have commissioned.
The learning curve for non-developers is not the AI; it is the terminal and git. Both take an afternoon. The beginner tutorial assumes zero prior experience with either.
Who should skip it
If you mainly want autocomplete while you type, an editor-integrated tool will feel better. If you never touch files or code and only need answers, the Claude app is enough. Claude Code earns its place when the output has to live in a folder.
Claude Code: Strengths and Trade-offs
- +Works on real files and runs real commands, so it can verify its own work
- +Editor-agnostic: use it with VS Code, JetBrains, Vim or nothing at all
- +CLAUDE.md gives it persistent project knowledge across sessions
- +Fine-grained permissions and plan mode keep you in control
- +Skills, hooks, subagents and plugins make it deeply customizable
- +MCP connects it to databases, browsers and third-party tools
- โNo autocomplete; it is for delegating tasks, not typing faster
- โTerminal-first, which is a hurdle for people who have never used one
- โLong sessions fill the context and need /compact or /clear
- โUsage is metered, so sloppy prompting costs more than careful prompting
- โIt can be confidently wrong; every diff still needs a human review
- โPowerful permissions mean a careless setup can do real damage
How Pricing Works
There are two ways to pay, and the numbers change often enough that you should check Anthropic's current pricing page rather than trust any article, including this one.
The first is a Claude subscription. Pro and Max plans include Claude Code with a usage allowance that resets on a rolling window. Heavier tiers get larger allowances and priority access to the most capable models. For most individuals, a subscription is the simplest option: one monthly fee, no surprise bills, and you can see how much of your window remains.
The second is API billing through the Claude Developer Platform. You pay per token consumed. This suits teams, automation, and anyone running Claude Code in scripts or CI where a personal subscription does not fit. Team and Enterprise plans layer admin controls, spend limits and shared seats on top.
Whichever route you choose, cost tracks context. A session that has read fifty files costs more per message than a fresh one, which is one more reason to /clear between tasks and to keep CLAUDE.md tight. The /cost command shows what the current session has consumed.
Two Ways to Pay for Claude Code
Claude Pro or Max. Flat monthly fee, a usage allowance that resets on a rolling window, no surprise bills. Best for individuals.
Pay per token through the Claude Developer Platform. Best for teams, scripts, CI pipelines and anyone who needs spend limits and admin controls.
Safety and Permissions
An agent that can run rm -rf deserves a serious look at safety. Claude Code's answer has several layers.
Permission prompts. Every file edit and every state-changing command asks first unless you have allowlisted it. Read-only actions (reading files, listing directories, searching) run without prompts because they cannot break anything.
Permission modes. Plan mode blocks all writes. The default mode prompts for writes. A more permissive mode auto-accepts file edits but still prompts for commands. There is also a bypass mode that skips prompts entirely, meant only for sandboxed environments such as a disposable container. Never run bypass mode on a machine you care about.
Allow and deny lists. In settings you can permanently allow safe commands and permanently deny dangerous ones. A deny rule on anything that touches production credentials means the agent physically cannot run it, no matter what the prompt says.
Hooks as guardrails. Because hooks are deterministic, a pre-tool hook can inspect every command before it executes and reject anything matching a pattern you define.
Prompt injection awareness. When the agent reads a web page or a file from an untrusted source, that content could contain instructions aimed at the model. Claude Code treats fetched content as data, and you should too: be more careful with permissions when a session touches external inputs.
Git as the undo button. Work on a branch. Commit often. If the agent goes wrong, git checkout puts everything back. This is the cheapest safety net there is, and it is the one most beginners skip.
Safe First Week with Claude Code
- โStart every non-trivial task in plan mode and read the plan
- โWork on a git branch and commit before letting it touch anything large
- โRun /init and then hand-edit CLAUDE.md with your real project rules
- โAllowlist only your test runner and linter; keep everything else prompting
- โAdd a deny rule for any command that reaches production
- โUse /clear between unrelated tasks to keep context (and cost) small
- โReview every diff line by line for the first several sessions
- โNever use bypass-permissions mode outside a disposable sandbox
Claude Code is one tool in a fast-moving category. Once you understand agents as model plus tools plus a loop, the same mental model transfers to Codex, Gemini CLI and whatever ships next year. If you want to build one of those loops yourself, the guide to building an AI agent starts from zero.
The best way to learn it is to give it a small, real task in a repo you do not mind breaking. Thirty minutes of that teaches more than any article. When you are ready for a structured path through Claude Code, Codex, Gemini, agents and video tools together, the full AI Mastery course is where the pieces connect.
Claude Code Questions and Answers
Go deeper: the full AI Mastery course
This article covers what Claude Code is. The AI Mastery course covers how to use it, alongside everything else in the modern AI toolkit. Sixty lessons across twelve modules take you from beginner to advanced through Gemini, Claude Code, Codex, building agents, Seedance video generation and building websites. Every module has quizzes, you get lifetime access, and you can preview two lessons free before deciding.
About the Author

Educational Psychologist & Academic Test Preparation Expert
Columbia University Teachers CollegeDr. Lisa Patel holds a Doctorate in Education from Columbia University Teachers College and has spent 17 years researching standardized test design and academic assessment. She has developed preparation programs for SAT, ACT, GRE, LSAT, UCAT, and numerous professional licensing exams, helping students of all backgrounds achieve their target scores.