what-is-claude-code.mdx

April 1, 2026 · View on GitHub

One sentence definition

Claude Code is an agentic coding system running in a local terminal. It's not a chatbot that gives advice - it reads code, changes files, runs commands, and debugs programs directly in your project directory, with full shell capabilities.

Technical positioning: terminal-native agentic system

The key to understanding Claude Code lies in three words:

Positioning keywordsMeaning
Terminal-nativeNative CLI application, not IDE plug-in, not web interface, not API wrapper
AgenticAI autonomous decision-making tool call chain, not a "question and answer" chat mode
Coding systemFor the whole process of software engineering, not a general Q&A tool

Architectural level differences from similar tools (not feature list):

ToolsArchitecture PatternsRun LocationTool Execution
Claude CodeTerminal-native agentic loopLocal processDirect shell execution
Cursor / CopilotIDE-integrated autocomplete + chatIDE in-processLSP / IDE API
AiderCLI chat → git patchlocal processmainly file operations
ChatGPT / Claude.aiCloud chat + artifactsBrowser/cloudSandbox container

Core difference: Claude Code has full shell access - which means it can do anything you can do in the terminal, but it also requires corresponding security mechanisms to restrict this ability.

End-to-end example: from input to output

When you type bun run dev There is a TypeScript error, help me fix it in the terminal, what happens to the system?

┌─────────────────────────────────────────────────────────┐
│ 1. Entry layer (cli.tsx → main.tsx) │
│ feature() = false, MACRO injection, start Commander.js CLI │
├─────────────────────────────────────────────────────────┤
│ 2. Interaction layer (REPL.tsx — React/Ink) │
│ PromptInput captures user input → UserMessage joins the session │
├─────────────────────────────────────────────────────────┤
│ 3. Orchestration layer (QueryEngine.ts) │
│Manage turn life cycle, token budget, compaction trigger │
├─────────────────────────────────────────────────────────┤
│ 4. Core loop (query.ts — Agentic Loop) │
│ Assemble context → Call API → Collect streaming response → Call parsing tool │
│ → Permission check → Execute tool → Result return → Call API again → Loop │
├─────────────────────────────────────────────────────────┤
│ 5. Tool execution (BashTool.call / FileEditTool.call / ...) │
│ Actual execution: read files, run commands, search code... │
├─────────────────────────────────────────────────────────┤
│ 6. Communication layer (claude.ts → Anthropic API) │
│ Streaming HTTP, supports Bedrock/Vertex/Azure multiple providers │
└─────────────────────────────────────────────────────────┘

Specific to this error repair scenario, a typical agentic loop may include multiple rounds of tool calls:

TurnAI DecisionTool CallResults
1Look at the error message first`Bash("bun run dev 2>&1head -30")`
2Locate the fileRead("src/utils/foo.ts")Source code content
3Search for related type definitionsGrep("interface Foo", "src/")Type definition location
4Fix codeFileEdit(old, new)Code modified
5Verification and repair`Bash("bun run dev 2>&1head -10")`

Each step is made by AI autonomously - it decides which tool to use, what parameters to pass, and when to stop. This is what "agentic" means.

What it is not

  • Not an IDE plug-in: no graphical interface, no dependency on VS Code or any IDE
  • Not an API wrapper: it has its own tooling system, permission model, context engineering, session management
  • Not a chatbot: The output is not plain text, but actual file modifications and command execution
  • Not a brainless executor: Every sensitive operation has permission check and user confirmation link

Start entry dissection

The real code entry is src/entrypoints/cli.tsx, which does three key things:

// 1. Inject runtime polyfill - feature() always returns false
const feature = (_name: string) => false;

// 2. Inject build-time macros
globalThis.MACRO = { VERSION: "2.1.888", BUILD_TIME: ..., };

// 3. Declare the build target
globalThis.BUILD_TARGET = "external"; // External build (not internal to Anthropic)
globalThis.BUILD_ENV = "production";
globalThis.INTERFACE_TYPE = "stdio"; // Standard I/O interaction

Control flow is then passed to src/main.tsx:

  1. Commander.js parses command line parameters
  2. Initial authentication, telemetry, policy restrictions
  3. Load tool list (getTools())
  4. Launch REPL (launchRepl()) or pipeline mode (-p)

Why choose terminal

Terminals are not limitations, but choices. It brings unique capabilities:

  • Full shell access: can run any command line tool without writing plugins for each capability
  • Project Native: Work directly in the project directory, understand the file system structure and git status
  • Composability: Pipeline mode (echo "..." | claude -p) allows embedding CI/CD and automation processes
  • Low Latency: No Electron overhead, React/Ink rendered TUI is extremely responsive

The price is that users need to adapt to the command line interface - but because of this, it attracts developers who need real control of the development environment.