Skip to content

Checking your reading list…

Retry verification

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Coding Agent Mastery: 23 Must-Know Terms & Cross-Tool Cheat Sheet

Coding Agent Mastery: 23 Must-Know Terms & Cross-Tool Cheat Sheet

This guide defines 23 core Coding Agent terms—from prompts and context windows to subagents and MCP—with practical examples, cross-tool comparisons, and a structured cheat sheet to turn AI from a black-box helper into a controllable engineering partner.

1. Prompt (提示词)

Prompt is the user-provided instruction that tells the Coding Agent what to do and how to do it. It is the primary input for task reception and one of the most critical factors influencing the final code output.

In practice, a Prompt typically includes task background, specific requirements, constraints (e.g., programming language, implementation approach), and expected output format. Think of it as a simplified requirements specification: the clearer the Prompt, the more accurately the agent understands the task and the closer the generated code matches expectations.

Example Prompt: <code>目标:修复当前仓库的测试失败,确保全量测试通过。 范围:仅修复导致失败的代码与必要测试;不要做无关重构。 约束:遵循现有代码风格;不要引入新依赖(除非必要并说明原因)。 验收:运行 <code>npm test</code> 全绿;输出中给出你运行过的命令与结果摘要。 信息不足:如果缺少失败日志或复现步骤,先问我 1-3 个问题。</code>

2. System Prompt (系统提示词)

System prompt is the tool's built-in default "role description/rules" that influences default behavior—such as whether the agent is cautious, runs tests first, or prefers certain output formats.

From the model's perspective, the System prompt is not a special file or hidden config; it is part of the context submitted with the user Prompt when requesting the model. Typically:

System prompt : defines the model's long-term behavior, default rules, and output contract.

User prompt : describes the specific requirements of the current task.

In an OpenAI-style Chat API request, both are sent in the messages array:

{
  "model": "gpt-5.2",
  "messages": [
    {
      "role": "system",
      "content": "你是一个谨慎的 Coding Agent,优先保证测试通过,避免无关重构。"
    },
    {
      "role": "user",
      "content": "修复当前仓库中失败的测试,确保 npm test 全绿。"
    }
  ]
}

3. Rules (规则:策略引擎/护栏)

Rules are a "policy-match → decision-execution" mechanism. When certain conditions are met, the system takes actions such as allow, prompt, or forbid—commonly used for governing high-risk operations.

The article includes cross-tool comparison diagrams (referenced as images) showing how three major tools implement Rules.

4. Memory (记忆)

Memory refers to information reusable across turns or sessions. To avoid confusion, it is best understood in three layers:

Short-term memory : current thread's conversation history and tool outputs (essentially context).

Long-term preferences : user's preferred output formats, habits (require explicit saving/configuration).

Project memory : project conventions, how to run tests, directory structure (usually stored in CLAUDE.md, GEMINI.md, AGENTS.md or skills).

Good memory significantly reduces token consumption and communication overhead.

5. Token

Token is the unit of measurement for model read/write (input tokens + output tokens). It is not a strict character count but rather "model-internal encoding fragments." Tokens directly affect:

Cost (billing/quota)

Latency (larger context → slower)

Available information volume (context window limit)

Agent stability (oversized context leads to compression/detail loss)

Common misconceptions:

Misconception A: treating tokens as character counts. Reality: code, symbols, English abbreviations, paths all affect tokenization.

Misconception B: bigger context is always better. Larger context dilutes relevance; the key is putting relevant information in.

Mini-case: For "fix tests," providing "failure logs + relevant files + run commands" is usually more token-efficient and accurate than stuffing the entire repository.

6. Checkpointing (检查点/回滚点)

Checkpointing means saving a restorable state at key nodes, enabling:

Undoing an erroneous change

Returning to a verified working version

Quickly switching between multiple solution attempts

7. Threads (线程)

A Thread is an independent session containing prompts, model outputs, and tool-call history. It determines where context history lives, where the execution environment runs, and how parallelism works:

Local threads : operate directly on your local workspace but require stricter gates/sandboxes to reduce risk.

Cloud threads : run in isolated environments with cloned repos, suitable for parallel delegation and cross-device work.

8. Context (上下文)

Context is the collection of information the Coding Agent can "see" at once: file contents, selected snippets, command outputs, conversation history, project documentation, etc.

Example: You ask "Why does this API return 500?"

Good context: route file + controller + relevant middleware + recent error stack trace.

Bad context: just "API 500, help me fix."

9. Context Window (上下文窗口)

Context window is the model's maximum token capacity for a single context. When exceeded, the system must:

Summarize/compress (retain key points)

Discard irrelevant history

Process in batches (phased/modular)

Recommendations:

Long tasks should use "phased acceptance": summarize key points after each phase, then continue.

If the tool provides commands like /compress, /compact, /clear, treat them as "tidying the desk—putting unneeded papers away."

10. Context Files (上下文文件/项目说明文件)

Context files are project-level manuals for the agent. They store long-lived information in the repo so the agent follows the same conventions every time.

Tool-specific names (shown in cross-tool comparison diagrams): CLAUDE.md, GEMINI.md, AGENTS.md.

What to include:

How to install dependencies, run tests/build (with commands)

Code style/formatting rules

Key directories and module responsibilities

Common pitfalls (e.g., must generate code first, need specific env vars)

Delivery requirements (PR description template, mandatory Test Evidence)

Common pitfalls:

Pitfall A: writing a long README-style introduction. Better: write an "executable manual" (commands, paths, constraints, acceptance criteria).

Pitfall B: stuffing all background causing bloat. Better: put "frequently used but stable" content here; put "domain knowledge/complex workflows" in skills (load on demand).

11. Compact (压缩/摘要)

Compact replaces long conversation history or large details with summaries to reduce context usage, allowing long tasks to continue. However, compression may lose critical details.

Before compressing, explicitly preserve:

Confirmed requirements and scope

Key design decisions (why this approach)

Run/verification commands (DoD)

Risks and rollback strategies

Post-compression self-check: have the agent restate its next steps via a checklist to confirm no drift.

12. Hooks (钩子:自动化与门禁)

Hooks are event-driven automations that trigger actions (run scripts, check, notify, block) on specific events.

Three most common uses:

Quality automation: auto format/lint/test after file changes.

Danger interception: block high-risk commands, sensitive file writes.

Completion verification: force output of checklist/evidence before finishing (e.g., must provide Test Evidence).

13. Tools (工具/工具调用)

Tools are the agent's "hands and feet": read/write files, search, run commands, access external systems. Tools turn the agent from "guessing" to "verifying":

Reading files reduces hallucination.

Running tests enables self-verification.

Grep/search accelerates impact analysis.

14. Skills (技能/SOP)

Skills package Standard Operating Procedures (SOPs) into reusable units containing steps, checklists, output contracts, and resources (scripts/reference materials), loaded/triggered on demand.

Skills vs. Prompts:

Prompts (custom prompts) are like reusable phrasing/templates, usually invoked explicitly, and may not be shared across repos (product-dependent).

Skills are like governable process assets, commonly supporting: directory structure (scripts/resources), progressive disclosure (don't dump full text into context by default), team sharing with priority overrides.

15. Plugins/Extensions (插件/扩展)

Plugins/Extensions solve "package a set of capabilities so others can install and use immediately"—e.g., commands, hooks, skills, MCP configs, even LSP.

16. MCP (Model Context Protocol)

MCP is a protocol/interface standard for plugging external "tool/context providers" into the agent. Many critical contexts live outside the code repo (internal docs, ticket systems, DB schemas, design specs, language servers). MCP lets the agent "fetch on demand" instead of relying on manual copy-paste.

17. LSP (Language Server Protocol)

LSP is the unified protocol between editors/tools and "language server processes." Common capabilities: go-to-definition, find references, type diagnostics, completion, refactoring hints. It elevates code understanding from "text guessing" to "semantic navigation":

Where a symbol is defined

Where a function is called

Type/diagnostic info—especially valuable for large repos.

18. Sandbox (沙箱)

Sandbox is an isolation mechanism that restricts the agent's executable actions to a controllable scope, reducing risk of accidental system modification, data leakage, or misoperation. When the agent can run commands and write files, sandbox + permissions form the "bottom safety net."

What sandboxes typically isolate:

Filesystem scope : only read/write workspace (or specific dirs), preventing system file damage.

Command execution : limit allowed commands, timeouts, resource caps to avoid runaway or misoperation.

Network/external access : some environments restrict internet or allow only whitelisted services.

Credentials/env vars : prevent exposing sensitive tokens to unnecessary steps/tools.

19. LLM Gateway (大模型网关)

LLM gateway is an enterprise/team "unified entry point" that hides multiple model providers/versions behind a single auth and call interface. It typically handles:

Routing & selection : choose model by task type (fast/cheap/strong reasoning).

Permissions & audit : who called what, whether sensitive policies triggered.

Rate limiting & quotas : prevent abuse and cost overruns.

Logging/tracing/redaction : aid debugging and compliance (avoid sending sensitive data to third parties).

20. Agents (代理/后台任务)

Agents are not just models but "entire systems capable of executing tasks." In CLI products, they appear as runnable task units (potentially parallel, with status visibility).

21. Subagent (子代理/专职工种)

Subagent treats the main agent as Tech Lead (responsible for decomposition, orchestration, aggregation) and subagents as "specialized roles" (e.g., test engineer, security auditor, documentation engineer).

Usage (security boundaries critical): grant subagents minimal tool permissions:

Security audit: Read/Grep only.

Test augmentation: add Write.

Need to run commands: only then grant Bash.

22. Remote Subagents (远程子代理)

Remote subagents execute in remote/isolated environments (still orchestrated by the main agent), commonly used for:

Parallel processing of multiple subtasks

Stronger isolation (security/resources/network)

Offloading long-running tasks to background or cloud

23. AI Native Team (AI 原生团队)

AI native team doesn't mean "using AI to write code" but embedding agents into every SDLC phase so the process natively supports 'agent collaboration'.

SDLC (Software Development Life Cycle) typical phases: Requirements → Design → Implementation → Testing → Review → Release → Monitoring/Rollback → Retrospective.

How to implement:

Requirements : use prompt templates to clarify DoD (scope/acceptance/risks).

Design : solidify conventions via context files; use subagents for design review checklists when needed.

Implementation : main agent orchestrates, subagents divide labor; tools execute changes.

Quality gates : hooks auto format/lint/test; rules/permissions block dangerous ops; sandbox reduces collateral damage.

Delivery : skills generate PR descriptions/release notes (with risks, rollback, test evidence); MCP pulls external info (tickets/docs/language services) when needed.

Rollback & retrospective : checkpointing (Git/rewind) + structured logs ensure traceability.

Concept Cheat Sheet Categories (Part 02)

The article organizes the 23 terms into nine layers for quick reference:

Input & Instruction Layer (what you tell the agent)

Policy & Guardrails Layer (what it can do, confirmation requirements)

Context Layer (what the model "sees")

Memory & Reuse Layer (cross-turn, cross-project reuse)

Engineering Capabilities Layer (making agent "deliverable")

Execution Organization Layer (how it runs, parallelism)

Metrics & Cost Layer (why it's slow, expensive, or drifts)

Protocols & Integration Layer (connecting external systems)

Confusing Pairs Comparison (easy-to-mix concepts)

Each layer is illustrated with cross-tool comparison diagrams (referenced as images in the source).

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

AI-assisted developmentLLMMCPprompt engineeringLSPSDLCCoding Agentsubagent

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion