跳转到内容

What is Claude Code?

此内容尚不支持你的语言。

Claude Code is Anthropic’s official AI coding assistant — a terminal-native, agent-first CLI tool that brings Claude’s intelligence directly into your development workflow. Unlike IDE-dependent copilots, Claude Code operates where developers already live: the terminal.

Claude Code occupies a unique position in the AI coding assistant landscape. It’s not a plugin, not an IDE extension, and not a web chat interface. It’s a standalone CLI application that functions as an autonomous coding agent with deep filesystem access, shell execution capabilities, and multi-turn conversational context.

Key positioning principles:

  • Terminal-native: Works in any terminal emulator — iTerm2, Kitty, Ghostty, Windows Terminal, etc.
  • Agent-first: Designed from the ground up as an autonomous agent, not a suggestion engine
  • No IDE dependency: Works with any editor, any workflow, any project
  • Full project awareness: Reads, writes, and navigates entire codebases autonomously

Claude Code is built on a modern TypeScript stack optimized for CLI performance:

The entire application runs on Bun, Jarred Sumner’s JavaScript runtime. Bun provides:

  • Significantly faster startup than Node.js
  • Built-in TypeScript transpilation
  • bun:bundle feature flags for dead code elimination at build time
// src/tools.ts — Feature flag gating via Bun's build-time DCE
import { feature } from 'bun:bundle'
const SleepTool =
feature('PROACTIVE') || feature('KAIROS')
? require('./tools/SleepTool/SleepTool.js').SleepTool
: null

The terminal user interface is built with Ink, a React renderer for CLIs. This gives the TUI the same component model as web applications — props, state, hooks, and composability.

// src/main.tsx — React/Ink rendering
import React from 'react'
import { launchRepl } from './replLauncher.js'

Command-line argument parsing uses @commander-js/extra-typings, a type-safe variant of Commander.js:

src/main.tsx
import { Command as CommanderCommand, InvalidArgumentError, Option }
from '@commander-js/extra-typings'

Schema validation throughout the codebase uses Zod v4:

src/Tool.ts
import type { z } from 'zod/v4'
export type Tool<
Input extends AnyObject = AnyObject,
Output = unknown,
P extends ToolProgressData = ToolProgressData,
> = {
readonly inputSchema: Input // Zod schema for tool input validation
// ...
}
DependencyPurpose
@anthropic-ai/sdkOfficial Anthropic API client
chalkTerminal string styling
lodash-esUtility functions (memoize, mergeWith, etc.)
picomatchGlob pattern matching
markedMarkdown parsing (for CLAUDE.md)
strip-ansiANSI escape code stripping
AspectClaude CodeCopilot
InterfaceTerminal CLIIDE plugin
ModeAgent (autonomous multi-step)Suggestion (inline completion)
File scopeEntire projectCurrent file + context
Shell accessFull bash/zsh executionNone
IDE requirementNoneVS Code, JetBrains, etc.
AspectClaude CodeCursor
InterfaceTerminal CLICustom IDE (VS Code fork)
Lock-inNo editor lock-inRequires Cursor IDE
Agent modePrimary modeSecondary feature
Multi-file editingNative, agent-drivenComposer feature
Model providerAnthropic (+ Bedrock/Vertex)Multiple providers
AspectClaude CodeAider
ProviderAnthropic (official)Multi-provider
ArchitectureReact/Ink TUI, agent loopPython, text-based
Tool system30+ built-in toolsGit-focused tooling
MCP supportNativeLimited
Security modelMulti-layer permissionsBasic

Claude Code features a sophisticated multi-agent system. The AgentTool allows the main agent to spawn sub-agents for complex tasks:

// src/tools.ts — Core tool pool includes AgentTool at the top
export function getAllBaseTools(): Tools {
return [
AgentTool, // Sub-agent spawning
TaskOutputTool, // Background task monitoring
BashTool, // Shell execution
GlobTool, // File pattern matching
GrepTool, // Content search
FileReadTool, // File reading
FileEditTool, // Surgical file editing
FileWriteTool, // File creation
// ... 30+ more tools
]
}

Claude Code implements a defense-in-depth permission model:

  • Permission modes: default, plan, auto, bypassPermissions
  • Tool-level permissions: Each tool declares isReadOnly(), isDestructive(), checkPermissions()
  • Hook system: Pre/post tool-use hooks for custom validation
  • Pattern matching: Rule-based allow/deny with glob patterns

A hierarchical instruction system that loads project-specific context:

Managed memory → /etc/claude-code/CLAUDE.md
User memory → ~/.claude/CLAUDE.md
Project memory → ./CLAUDE.md, .claude/CLAUDE.md, .claude/rules/*.md
Local memory → ./CLAUDE.local.md

Files closer to the working directory take higher precedence. The @include directive allows composing instructions from multiple files.

Beyond the interactive REPL, Claude Code provides a programmatic SDK via QueryEngine:

src/QueryEngine.ts
export class QueryEngine {
async *submitMessage(
prompt: string | ContentBlockParam[],
options?: { uuid?: string; isMeta?: boolean },
): AsyncGenerator<SDKMessage, void, unknown> {
// Full query lifecycle management
}
}

This powers integrations like the VS Code extension, desktop app, and CI/CD pipelines.

5. MCP (Model Context Protocol) Integration

Section titled “5. MCP (Model Context Protocol) Integration”

Native support for MCP servers, allowing Claude Code to connect to external tools and data sources:

src/tools.ts
export function assembleToolPool(
permissionContext: ToolPermissionContext,
mcpTools: Tools,
): Tools {
const builtInTools = getTools(permissionContext)
const allowedMcpTools = filterToolsByDenyRules(mcpTools, permissionContext)
return uniqBy(
[...builtInTools].sort(byName).concat(allowedMcpTools.sort(byName)),
'name',
)
}
CapabilityDescription
Multi-file editingAgent reads, writes, and edits files across the entire project
Shell executionRuns arbitrary shell commands with permission controls
Web search/fetchBuilt-in web search and URL fetching tools
Git integrationDeep git awareness for diffs, branches, and commits
Notebook editingJupyter notebook cell editing support
Session managementResume, share, and manage conversation sessions
Cost trackingReal-time token usage and cost monitoring
Auto-compactionAutomatic context management for long conversations
  • Professional developers working in terminal-centric workflows
  • DevOps/SRE engineers who need AI assistance in SSH sessions
  • Open-source contributors working across multiple projects and editors
  • Teams needing consistent AI tooling across diverse development environments
  • Feature implementation: “Add dark mode support to the settings page”
  • Bug fixing: “Debug why the API returns 500 on large payloads”
  • Code review: “Review the changes in this PR for security issues”
  • Refactoring: “Migrate from callbacks to async/await in the auth module”
  • DevOps tasks: “Set up GitHub Actions CI for this project”
  • Documentation: “Generate API docs for the user service”