Leaders Insights
Leaders Insights

Stay at the top of your field, a little every day.

DomainsMarketingDataFinanceAI
ResourcesLearnTestToolsBlogGlossary
© 2026 Leaders Insights — All rights reserved.
Tracks/AI Essentials/Claude & the Anthropic ecosystem/Claude Code/Claude code: an agentic coder in your terminal
1/5+180 XP

Claude Code

1Claude code: an agentic coder in your terminal+1802Core workflows: plan, edit, run, review+1803Power features: skills, subagents, hooks, and settings+2004Parallel subagents: fanning work out across fresh contexts+2105Loops and autonomous runs: /loop, iteration, and scheduling+210

Claude code: an agentic coder in your terminal

# Claude code: an agentic coder in your terminal

Claude Code reads your project, plans a change, edits across multiple files, and runs commands on your behalf, all from your terminal or IDE. It is not a chat window where you paste snippets. It is an agent that lives inside your repository, sees your real file tree, and acts on it with your permission.

You already understand the agentic loop in the abstract: observe, plan, act, check the result, repeat. This lesson shows you that loop running on actual code, where the "tools" are reading files, writing files, and executing shell commands. We will walk through a concrete task (fix a failing test and explain the change) and look closely at the permission prompts that keep you in control.

What Claude code actually is

Claude Code is a command-line tool from Anthropic that wraps Claude in an agent harness with file and shell access. You run it inside a project directory. It builds an understanding of your codebase, proposes a plan, and executes steps, pausing to ask before anything consequential happens.

The key mental shift: in the Claude apps you bring context to the model. With Claude Code, the model goes and gets its own context. It greps your files, opens the ones that matter, reads your package.json or pyproject.toml, and runs your test suite to see what is actually broken. You are not curating the context window by hand anymore.

context window
The context window is the maximum amount of text (measured in tokens) a language model can process at once, including both the input prompt and the generated output.
View full definition →

It works in your terminal directly, and it also plugs into IDEs like VS Code and JetBrains. The official starting point is the Claude Code documentation.

Installing it

Claude Code installs as a single command. You need Node.js available first.

bash
npm install -g @anthropic-ai/claude-code

Then move into any project and start it:

bash
cd my-project
claude

On first run it walks you through authentication. You can sign in with a Claude account (Pro or Max plans include Claude Code usage) or use an Anthropic APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.View full definition → key billed through the Console. Once authenticated, you are dropped into an interactive session inside your project.

The agentic loop, made concrete

Let us make this real. Imagine a small Python project with a failing test. Your suite reports:

FAILED tests/test_cart.py::test_apply_discount - AssertionError: assert 90.0 == 95.0

You do not know yet whether the bug is in the test or the code. You type one instruction:

> Fix the failing test in tests/test_cart.py and explain the change you made.

Here is what happens, step by step, and why each step matters.

Step 1: It explores before it acts

Claude Code does not start editing. It first runs read-only commands to orient itself. It might run your test command to reproduce the failure, then open tests/test_cart.py and the source file it imports, likely cart.py.

This is the "observe" phase of the loop, and it is doing it against your real files, not a description you typed. Reading files and listing directories are low-risk actions, so depending on your settings these may happen without interrupting you.

Step 2: It forms a plan

Claude Code reasons about what it found. Maybe apply_discount multiplies by the discount rate instead of subtracting it, so a 10 percent discount on a 100 dollar cart returns 10.0 instead of 90.0, and the test expectation of 90.0 is correct. The bug is in the source, not the test.

For multi-step work it often writes out a short plan, sometimes as a checklist it tracks as it goes. You can read the plan before any code changes, which is your first chance to redirect it if it misunderstood the goal.

Step 3: It proposes an edit, and asks permission

Now it wants to change cart.py. This is where the first real permission prompt appears. Claude Code shows you a diff: the exact lines it wants to remove and add. Nothing is written to disk until you approve.

cart.py
-     return price * discount_rate
+     return price * (1 - discount_rate)

Do you want to make this edit?
  > Yes
    Yes, and don't ask again for this session
    No, tell Claude what to do differently

You see precisely what will change. You can accept, reject, or steer. This diff-then-approve pattern is the heart of why the tool is safe to use on real code: no silent edits.

Step 4: It runs the command, and asks again

After applying the edit, Claude Code wants to verify its work by re-running the tests. Executing a shell command is a separate, more sensitive action than editing a file, so it prompts again:

Claude wants to run:
  pytest tests/test_cart.py

  > Yes
    Yes, and don't ask again for pytest commands
    No

You approve. The tests run. Claude Code reads the output, sees green, and reports back.

Step 5: It closes the loop and explains

Because you asked it to explain, it summarizes: the discount function was multiplying the price by the rate rather than applying the rate as a reduction, the fix subtracts the discount from full price, and the previously failing assertion now passes. The "check the result" phase of the agentic loop happened by actually running your tests, not by Claude guessing whether its change worked.

That is the whole loop: explore, plan, edit (with approval), run (with approval), verify, explain.

Permissions are the safety model

The reason an agent with shell access is not terrifying is the permission system. Understand it and you will use Claude Code with confidence.

By default, Claude Code treats actions by risk level. Reading and searching files is permissive. Writing files prompts you with a diff. Running shell commands prompts you with the exact command. Anything that touches the network or runs something destructive gets a prompt every time.

You can tune this. The "Yes, and don't ask again" options let you grant standing permission for a specific tool or command pattern within a session, so you are not approving the same harmless pytest invocation twenty times. You can also configure an allowlist and denylist of commands in your project settings so the rules persist across sessions.

For higher autonomy you can grant broader permissions deliberately, and for untrusted work you can run Claude Code in a sandboxed or restricted mode. The principle is that *you* choose the leash length. The default is conservative on purpose.

Claude Code in 20 minutes

Watch on YouTube

Knowledge check

1. What is the fundamental distinction between using Claude Code and using the Claude chat apps?

2. How does the lesson describe the agentic loop as it applies to coding with Claude Code?

3. Why does Claude Code pause to ask for permission before certain actions?

MULTIPLE CHOICE

4. Select ALL correct statements about what Claude Code is and how it operates.

Select all the correct answers.

MULTIPLE CHOICE

5. Select ALL correct statements about installing and running Claude Code.

Select all the correct answers.

Where it fits with the rest of the Claude ecosystem

Claude Code is not a separate intelligence. It is Claude (the same model family you use in the apps and the Messages APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.View full definition →) wired into a coding agent harness. Knowing how it relates to the other pieces helps you reachreachThe number of unique people exposed to your message in a given period. Unlike impressions, reach counts each person once, no matter how often they see it.View full definition → for the right tool.

CLAUDE.md: persistent project memory

Drop a file named CLAUDE.md in your project root and Claude Code reads it automatically at the start of every session. This is where you put project conventions, the command to run tests, architectural notes, and "don't touch this directory" warnings. It is durable instructions that survive across sessions, so you are not re-explaining your project every time.

markdown
# Project: checkout-service

## Commands
- Test: `pytest -q`
- Lint: `ruff check .`

## Conventions
- All prices are in integer cents, never floats.
- Do not edit files in `legacy/` without asking.

MCP: giving Claude Code new tools

You met the Model Context Protocol earlier as the open standard that lets Claude talk to external tools and data sources. Claude Code is an MCP client. You can connect MCP servers to give it abilities beyond files and shell: query your database, read your issue tracker, hit an internal APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.View full definition →. The Model Context Protocol site is the reference, and the same connectors you use in the Claude apps largely apply here too.

GitHub integration

Claude Code works with your Git workflow naturally. It can create branches, write commits with sensible messages, and open pull requests. Anthropic also offers a GitHub integration so you can tag Claude on an issue or pull request and have it propose changes directly in the repo, asynchronously, without your terminal open. Explore the official tools at github.com/anthropics.

The Claude Agent SDK: when you want to build, not just use

Claude Code is a finished product. The same agent harness underneath it is available as the Claude Agent SDK, so you can build your own agents with file access, tool use, and the permission patterns you just saw. If you find yourself wanting a custom internal agent for, say, triaging logs or maintaining docs, that is the SDK's job. Claude Code is the off-the-shelf coding agent; the Agent SDK is the kit for building your own.

Practical habits that make it work well

A few patterns separate frustrating sessions from productive ones.

Give it a way to check itself. The single highest-leverage thing is a working test command. When Claude Code can run tests, it self-corrects. The discount example worked cleanly because pytest gave it a ground-truth signal. Without tests, it is editing partly blind.

Scope your requests. "Fix this failing test" is a great instruction because it is verifiable and bounded. "Refactor the whole payment system" invites a sprawling, hard-to-review diff. Break large work into steps you can approve one at a time.

Read the plan, then the diffs. Your review is part of the loop. The permission prompts are not bureaucracy; they are the moments where your judgment enters. Skimming a diff before approving catches the occasional wrong turn early.

Use CLAUDE.md instead of repeating yourself. Every constraint you state out loud more than once belongs in that file.

Key Takeaways

  • Install with npm install -g @anthropic-ai/claude-code, run claude inside a project, and authenticate with a Claude plan or an APIAPIApplication Programming Interface: a standardised interface that lets applications communicate and exchange data without knowing each other's internal workings.View full definition → key.
  • Claude Code runs a real agentic loop on your codebase: it explores files, plans, edits with a diff you approve, runs commands you approve, and verifies by running your tests.
  • The permission system is the safety model. File edits show a diff before writing; shell commands prompt with the exact command. You control the leash length with allowlists and "don't ask again" grants.
  • Add a CLAUDE.md with your test command, conventions, and off-limits directories so the agent carries durable context across sessions.
  • ReachReachThe number of unique people exposed to your message in a given period. Unlike impressions, reach counts each person once, no matter how often they see it. for MCP servers and the GitHub integration to extend it, and for the Claude Agent SDK when you want to build your own agent on the same harness.

What to do, from this lesson

These actions are compiled in the role's Playbook.

  • Add a CLAUDE.md with test command, conventions, and off-limits directories
See the full action playbook →

Next

Core workflows: plan, edit, run, review

View full definition →
reachreachThe number of unique people exposed to your message in a given period. Unlike impressions, reach counts each person once, no matter how often they see it.View full definition →