术语表

CCA-F 考试的关键术语,从课程与备考指南交叉链接而来。

.claude/rules/(规则目录)
A directory of scoped rule files (with YAML frontmatter and glob matching) that load only when matching files are in context. Per-path rules keep the prompt small while still steering behavior for the relevant code.
@路径导入
Syntax inside `CLAUDE.md` (e.g. `@docs/style-guide.md`) that pulls another file’s contents into context instead of pasting them inline. It keeps memory files small and lets shared docs stay single-sourced.
/compact(压缩上下文)
A Claude Code command that summarizes the conversation so far, shrinking the working context while preserving key decisions. Use it during long sessions to keep the context window focused before it fills up.
/memory(记忆管理)
A Claude Code command for viewing and editing the loaded memory files (`CLAUDE.md` at each scope). It lets you inspect and curate the persistent instructions Claude carries into every turn.
AgentDefinition(智能体定义)
A declarative specification of a subagent — its name, system prompt/role, the tools it may use, and (optionally) model. Defining agents as configuration rather than ad-hoc code makes capabilities reviewable, reusable, and scoped to least privilege.
智能体循环
The repeating cycle in which Claude reasons, emits a `tool_use`, receives a `tool_result`, and continues until `stop_reason` is `end_turn`. This loop — not a single call — is what turns the model into an agent that can act on the world.
Bash(命令执行工具)
A built-in Claude Code tool that runs shell commands (tests, builds, git). Because it can be destructive, it is a prime candidate for scoped permissions (e.g. `Bash(pnpm test:*)`) and hooks.
批量评审
Using the Message Batches API to run large-scale, non-interactive review or evaluation jobs at the 50% batch discount. It suits offline grading, regression checks, or scoring many items where a 24-hour turnaround is acceptable.
思维链
Prompting the model to reason step by step before answering, improving accuracy on multi-step problems. The reasoning can be requested in a scratchpad or visible plan; for code, ask for a brief plan before the diff.
CLAUDE.md(项目记忆文件)
A Markdown memory file Claude Code auto-loads to learn project conventions, commands, and constraints. Files merge by precedence — enterprise/user (`~/.claude/CLAUDE.md`) then project (`./CLAUDE.md`) then nested directories — so versioned rules persist and are reviewable.
上下文窗口
The maximum number of tokens (system prompt + conversation + tool results + the response) the model can attend to at once. Exceeding it causes truncation or errors, so managing what occupies the window is a core architecture concern.
custom_id(自定义标识)
A caller-assigned identifier (1–64 chars, alphanumeric/hyphen/underscore) attached to each request in a Message Batch. Because batch results return in arbitrary order, the `custom_id` is how you map each result back to its originating request.
Edit(编辑工具)
A built-in Claude Code tool that applies a precise string replacement to a file you have already read. It enables surgical, reviewable changes rather than rewriting whole files.
end_turn(回合结束)
The `stop_reason` value indicating Claude completed its reply naturally and is handing control back. In an agentic loop, `end_turn` is the normal signal to stop iterating and surface the final answer.
错误传播
The risk that an early mistake (a bad tool result, a wrong assumption) flows downstream and corrupts later steps in an agent loop. Surfacing structured errors, validating outputs, and escalating uncertainty all limit how far errors spread.
明确的验收标准
Stating concrete, checkable success conditions in the prompt (what "done" means) rather than relying on the model to infer intent. Sharp criteria reduce ambiguity and make outputs easier to validate automatically.
Explore 子智能体
A read-only subagent used for read-heavy codebase investigation, returning a concise summary so the main session’s context stays small. It embodies subagent isolation applied to exploration.
少样本提示
Including a small number (typically 2–4) of input/output examples in the prompt to demonstrate the desired format and behavior. Examples drawn from real, in-style data steer output far more reliably than abstract instructions alone.
fork_session(会话分叉)
Branching a session by copying its history up to a point into a new session with its own id, leaving the original untouched. Like `git branch`, it lets you explore alternative paths in parallel without losing prior work (CLI: `claude --resume <id> --fork-session`).
Glob(文件匹配工具)
A built-in Claude Code tool that lists files matching a pattern (e.g. `src/**/*.ts`). It is the fast first step for locating files by name before reading or editing them.
Grep(内容搜索工具)
A built-in Claude Code tool that searches file contents by regex, returning matching files or lines. It locates code by *what it does* rather than its filename, complementing Glob.
幻觉
Confident generation of content that is unsupported or false — invented facts, APIs, or citations. Mitigations include grounding with retrieved context, provenance annotations, schema/validation checks, and asking the model to admit uncertainty.
无头 CI/CD
Using headless Claude Code inside pipelines to automate tasks like fixing tests or opening PRs, branching on JSON output (including `total_cost_usd`) and keeping the agent on a tight turn budget. The merge gate stays the same as for humans: the branch must pass CI.
无头模式
Running Claude Code non-interactively via `claude -p "<task>"`, typically with `--output-format json` for a parseable result and `--allowedTools` to pre-approve tools. It is the entry point for CI/CD and scripted automation.
HITL 升级机制
A policy that routes a task to a human when the agent is uncertain, hits a permission boundary, or detects a high-risk action. Well-designed escalation captures the hard cases without forcing humans to review routine ones.
钩子
Deterministic, event-driven callbacks (e.g. before/after a tool runs, or on session events) that execute code to enforce guarantees the model should not be trusted to self-impose. Use hooks for must-always rules like formatting, secret-blocking, or audit logging.
钩子 vs 提示
The design tradeoff between enforcing behavior with deterministic hooks versus requesting it in the prompt. Prefer hooks for non-negotiable, mechanically verifiable rules and prompts for judgment-based guidance the model should weigh.
中心辐射式架构
A multi-agent topology where one orchestrator (the hub) delegates to specialized subagents (the spokes) that report back, with no spoke-to-spoke communication. It is the canonical pattern for parallelizable, decomposable work and contrasts with brittle deep agent chains.
人类参与(HITL)
Inserting human approval or judgment at high-stakes or ambiguous points in an agent workflow. HITL gates (e.g. confirm before a destructive action, or escalate low-confidence cases) bound risk where full automation is unsafe.
增量式排查
A debugging workflow that narrows scope step by step — Glob/Grep to locate, Read to confirm, then a targeted Edit — instead of loading the whole codebase at once. It keeps context lean and reasoning focused.
is_error(错误标记)
A boolean on a `tool_result` block that marks the tool execution as failed. It lets Claude distinguish a tool error from a successful-but-empty result and decide whether to retry, escalate, or adjust its plan.
JSON Schema(JSON 模式)
A vocabulary for describing the structure, types, and constraints of JSON data. In Claude, tool `input_schema` is JSON Schema; a well-specified schema is the contract that makes tool calls and structured output reliable.
中间内容遗失
The tendency of long-context models to attend best to information at the beginning and end of the context and overlook content buried in the middle. It motivates placing critical instructions and data near the edges of the prompt.
MCP 配置
Declaring which MCP servers a client connects to and how (command, args/url, transport, env/secrets), typically in a config file or `.mcp.json`. Scoping servers and their credentials carefully is part of least-privilege tool design.
MCP 资源
One of the three MCP primitives (alongside tools and prompts): read-only, addressable context such as a file, database row, or document that a server exposes for the model to read. Resources supply data; tools perform actions.
MCP 传输层
The channel carrying JSON-RPC messages between MCP client and server. Options are **stdio** (server runs as a local subprocess over stdin/stdout), **Streamable HTTP** (the current network standard), and **SSE** (the legacy HTTP transport, now deprecated).
Message Batches API(批处理接口)
An asynchronous endpoint for submitting many Messages requests at once for processing within a 24-hour window at a 50% token discount. Each request carries a unique `custom_id`, and results are retrieved later — ideal for high-volume, non-interactive work like evaluation or bulk extraction.
Messages API(消息接口)
The primary Claude endpoint (`POST /v1/messages`) for sending a list of alternating `user`/`assistant` turns and receiving a model response. It returns structured content blocks (text, `tool_use`) plus metadata such as `stop_reason` and token usage.
模型上下文协议(MCP)
An open, JSON-RPC-based protocol that standardizes how AI clients connect to external servers exposing tools, resources, and prompts. MCP decouples capability providers from clients, so one server (e.g. for a database or API) works across any MCP-aware host.
模型决策 vs 硬编码逻辑
The decision of whether to let the model reason about a step or to implement it as fixed code/control flow. Hardcode the deterministic, high-stakes, or cheaply-specified parts; reserve the model for ambiguous, judgment-heavy decisions.
多轮审查
Improving output by running additional review passes — the model (or a separate reviewer agent) critiques and revises a first draft against criteria. It trades extra tokens/latency for higher quality on important deliverables.
并行执行
Running independent subtasks concurrently — e.g. fanning out several subagents or issuing multiple tool calls at once — to cut wall-clock latency. It only applies when subtasks have no ordering dependency; sequential work needs prompt chaining instead.
权限模型
Claude Code’s allow/ask/deny controls governing which tools can run with or without confirmation. Pre-approve safe, idempotent tools and gate destructive ones; in automation, pass `--allowedTools` explicitly so runs complete without prompts.
计划模式
A Claude Code mode where the model explores and proposes a change set **without writing files or running mutating tools**, pending approval. It catches wrong-file or wrong-architecture mistakes before they cost a round-trip and is recommended for any non-trivial change.
计划模式 vs 直接执行
The choice between proposing a plan first (safe, reviewable, better for multi-file or risky work) versus executing immediately (fast, fine for trivial edits). Matching mode to task risk is a Domain 3 design decision.
渐进式摘要
Periodically compressing accumulated conversation or work into a running summary so the context window stays small while key facts survive. It is the core technique behind `/compact` and long-running agent memory.
提示缓存
A feature that caches stable prefix content (long system prompts, tool definitions, documents) via `cache_control` so repeated requests skip re-processing it. Cache reads cost a fraction of normal input tokens, cutting latency and price for prompts with a large fixed prefix.
提示链
Decomposing a complex task into a sequence of steps where each step’s output feeds the next. Chaining improves reliability for ordered, dependent work; use it when later steps genuinely require earlier results, otherwise prefer parallel fan-out.
来源标注
Tagging facts in context (or in output) with their source so the model and reviewers can trace claims back to evidence. Provenance supports grounding, reduces hallucination, and makes outputs auditable.
Read(读取工具)
A built-in Claude Code tool that reads a file’s contents (optionally a line range) into context. Reading before editing is required so changes are grounded in the actual current text.
模式设计
Crafting a JSON Schema with clear field names, descriptions, required fields, and enums so the model produces valid, unambiguous output. Good schema design — especially descriptive field docs — is one of the strongest levers for structured-output quality.
草稿区
A dedicated space (often a delimited section or hidden reasoning) where the model works through intermediate steps before producing a final answer. Scratchpads externalize chain-of-thought and keep reasoning separable from the deliverable.
会话
A persisted conversation thread (history, state, and context) that an agent runtime can resume later. Sessions let long-running or interrupted work continue without rebuilding context from scratch.
会话管理
The practice of creating, persisting, resuming, and forking sessions to control an agent’s memory and continuity over time. Good session hygiene keeps context relevant and recoverable across long or multi-stage tasks.
技能
A packaged, model-invoked capability — a folder with a `SKILL.md` (name + description) plus optional scripts and resources — that Claude loads on demand when its description matches the task. Skills extend behavior with reusable, progressively-disclosed expertise.
斜杠命令
A reusable, parameterizable prompt template invoked with `/name`, defined as a Markdown file under `.claude/commands/`. Slash commands turn repeated workflows (e.g. `/review`, `/release`) into versioned, shareable shortcuts.
stdio 传输
An MCP transport where the client launches the server as a local subprocess and exchanges newline-delimited JSON-RPC over stdin/stdout. Best for local, single-user tools; it avoids network setup but does not serve remote clients.
stop_reason(停止原因)
A field on every Messages API response stating why generation stopped. Core values are `end_turn` (finished naturally), `tool_use` (Claude wants you to run a tool), `max_tokens` (hit the output cap), and `stop_sequence` (matched a custom stop string); `pause_turn` can appear with long-running server tools.
分层抽样
Selecting context (or evaluation items) so each meaningful subgroup is represented, rather than taking an arbitrary or front-loaded slice. In context engineering it ensures diverse, representative material fits within the token budget.
Streamable HTTP 传输
The current recommended MCP network transport: the server is an independent process handling many clients over HTTP POST/GET, optionally streaming responses with SSE. It supersedes the older standalone SSE (HTTP+SSE) transport.
流式传输
Receiving a Messages API response incrementally as server-sent events (set `stream: true`) instead of one final payload. Streaming lowers perceived latency for interactive UIs and lets clients render tokens as they arrive.
结构化错误
Returning tool failures as machine-readable, descriptive payloads (with `is_error: true` and a clear message) instead of opaque strings or silent failures. Structured errors let Claude diagnose the cause and self-correct within the agentic loop.
结构化输出
Output produced in a machine-readable schema (usually JSON), commonly obtained by forcing a schema-shaped tool with `tool_choice`. It lets downstream systems consume model results programmatically instead of parsing prose.
子智能体
A separate agent instance, with its own context window and tool set, that an orchestrator delegates a focused task to. Subagents isolate context (keeping the main thread clean) and enable parallelism, but cannot see each other directly.
子智能体隔离
The property that each subagent runs in a fresh, separate context window and returns only a summary to its caller. Isolation prevents context pollution and lets noisy, read-heavy work happen without bloating the orchestrator’s window.
令牌预算
The deliberate allocation of the context window across system prompt, instructions, retrieved context, history, and response. Budgeting forces tradeoffs — what to keep, summarize, or drop — so the most relevant content stays in scope.
工具描述
The natural-language `description` and per-parameter docs on a tool definition that tell the model when and how to use it. Clear, specific descriptions are the primary driver of correct tool selection and argument filling.
工具范围限定
Granting an agent or subagent only the minimal tool set it needs for its job (least privilege). Tight scoping reduces error surface, prevents unintended destructive actions, and keeps the model focused on relevant capabilities.
tool_choice(工具选择策略)
A request parameter that controls tool invocation: `auto` (model decides), `any` (must call some tool), `tool` (must call a named tool), or `none` (forbid tools). Forcing a tool is the standard way to coerce structured output via a single schema-shaped tool.
tool_result(工具结果)
A content block sent back in a `user` turn that returns the output of a `tool_use` request, keyed by its `tool_use_id`. Setting `is_error: true` signals the tool failed so Claude can recover or retry.
tool_use(工具调用)
A content block in which Claude requests that a named tool be invoked with a JSON `input`. When present, `stop_reason` is `tool_use`; the application executes the tool and returns the result as a `tool_result` block in the next user turn.
校验-重试循环
Validating model output against a schema or checks (linter, tests), and feeding failures back so the model self-corrects. Distinguish syntax errors (always safe to retry) from semantic errors (may need a sharper criterion or a human).