跳转至

Claude Code CLI 2.1.235 全量可提取能力面

本文是发布 bundle 的能力地图。71 类机器清单负责穷举稳定字面量、全部目标调用点、动态表达式和结构化 schema/catalog,本文负责解释它们属于哪一层系统、哪些结论可以直接成立、哪些只能作为线索。

本文仍然是“查证据用的地图”,不是第一次阅读入口。先看 技术机制总图,覆盖深度看 52 项全面性审计,逐项产品表面分别看 29 项人工维护的核心终端参考、80 个同工厂工具注册调用点、156 个 Settings、CLI/SDK/输出协议 和 Plugins/Skills/Commands/LSP。模型与工具持续执行看 Agent Loop 专题,用户最终能看到什么看 Brief Mode 与用户可见输出,上下文/cache/compact 看 上下文治理专题,session/checkpoint/memory 看 持久化专题,动作控制看 工具、权限与 Hooks,动态扩展看 MCP、Agents 与后台协作。Auto Mode、Plugin Eval、daemon/PTY/respawn 和 Enterprise Gateway 分别下钻到 分类器专题、评估专题、Runtime Supervision 与 网关专题;Auth/Trust、Thinking/Fast、Usage/Limits、数据生命周期、Sandbox、Proxy/CA/mTLS、Active Goal、后台模型任务、Advisor 与 Ultrareview 的专用状态机从 文章总入口 进入。字段“存在”不等于分支可达,当前官网“有此功能”也不等于 2.1.235 已实现;逐项边界见 公开主张验证矩阵。

60 秒理解“能力地图”怎么用

读者问题: 在 bundle 里搜到一个环境变量、API path、feature key 或 schema property 后,怎样判断它是 2.1.235 的真实产品能力、第三方依赖、内嵌文档还是不可达线索?

一句话模型: 全量清单先从 canonical bytes 穷举候选,再用 AST/schema/catalog/native index 找到消费者、gate、默认值和状态变化,关键路径用精确二进制 Probe 验证;证据不足的条目必须停在 Heuristic 或 Boundary,不能直接写成功能。

发布 bundle 经确定性提取形成能力候选,再通过可达调用链和 Probe 进入人类结论或明确边界

贯穿场景:清单中发现 ENABLE_SOMETHING。如果它只出现在第三方 README 字符串,就只能是 heuristic;如果 typed env schema 定义了类型和默认值,还要继续找实际 access callsite;如果消费者受平台、provider 和 feature gate 控制,就要记录这些条件;只有可达分支或 Probe 产生用户可观察结果后,才能写“启用该值会改变某行为”。

层 主要材料 能证明什么 典型误用
Canonical/extracted 发布物实际携带的 packed bytes 字节确实属于该 release 冒充 Anthropic 原始仓库
Structured inventory AST callsite、typed schema、model catalog、native index 静态对象、表达式、字段和位置完整可重跑 把 identifier 数量当机制说明
Reachable mechanism consumer、branch、gate、precedence、default、failure 客户端在何种条件下改变什么状态 单个字符串命中就宣称功能存在
Exact-binary Probe 固定命令、输入、literal result、exit status 给定环境中精确版本实际发生的状态转移 外推到未触发平台、账户或服务端
Human analysis 心智模型、场景、生命周期、影响和边界 读者能理解并复核的技术结论 删除底层证据只留故事

下面的 71 类索引保留为“找证据的全量地图”。阅读时先选机制,再进入对应清单和调用点,不要从计数直接跳到产品结论。

证据等级

等级 定义 可以如何表述
Observed canonical packed bytes、CLI help、schema、明确分支、具体错误、endpoint、N-API contract 或运行探针直接证明 “存在/支持/拒绝/发送/持久化”
Derived 多个 observed 片段组成的调用链或数据流 必须给出组成证据和边界
Compatible reconstructed/ 独立实现达到相同 contract/行为 只能称兼容重建,不能称原始源码
Heuristic regex/字符串集合,可能混入依赖或文档内容 只能称候选/索引,不能冒充产品 schema

extracted/cli.js 是 canonical JavaScript packed bytes;reverse/javascript/cli.readable.js 是可读分析视图;reverse/native/ 是原生静态分析;reconstructed/ 是兼容源码。没有 source map/debug info 时,原始 TypeScript 文件树、注释、bundle 前边界和被 tree shaking 删除的代码不可精确恢复。

全量机器清单

生成器:skill/claude-code-version-diff/scripts/extract_source_inventory.py。摘要和逐文件哈希见 source-inventory/summary.json。

环境、配置和 feature

清单 数量 说明
environment-access-identifiers 1,300 direct、environment proxy 和广义标识的并集
environment-access-callsites 2,548 AST 识别的实际访问点、accessor、fallback 和位置
direct-process-environment-accesses 453 直接 process.env 静态访问
dynamic-process-environment-callsites 143 动态 process.env[expression],保留表达式
environment-proxy-accesses 589 bundle 环境代理对象静态属性访问
environment-like-identifiers 1,048 广义环境形态 token,含依赖项
environment-schema 842 typed env builder、类型、options 和导出映射
otel-environment-variables 77 OTEL 和相关遥测变量
observability-environment-schema 71 typed env schema 的观测子集
observability-environment-defaults 23 观测变量的 ??/|| fallback 表达式
feature-flags 361 et() 静态 feature key
feature-flag-callsites 498 全部 et() 调用及动态/作用域解析状态
growthbook-keys 6 CB() 静态 GrowthBook key
growthbook-callsites 12 全部 CB() 调用及动态表达式
root-settings-keys 156 Claude Code 根 settings schema 键
root-settings-schema 160 156 direct + 4 spread,含 RHS、builder、description、enum/default/catch
schema-property-identifiers 1,165 全 bundle schema property 候选,含依赖 schema
schema-descriptions 1,150 .describe() 静态说明文本
static-enum-groups 201 静态 enum value group
user-config-directories 13 Claude 用户配置目录名集合

遥测、协议和生命周期

清单 数量 说明
tengu-identifiers 1,939 所有静态 tengu_* 标识
observability-identifiers 149 telemetry/log/debug/profile/recording 相关稳定标识
observability-templates 166 观测相关 template 及插值表达式
telemetry-endpoints 5 观测形态 endpoint 候选,含依赖示例,需按 callsite 定性
first-party-events 1,441 一方静态事件名
first-party-event-templates 3 归一化动态模板
first-party-event-callsites 2,194 全部 H/Fv 调用、参数、scope 和 payload/spread
first-party-event-fields 1,441 一方 event 到显式顶层字段映射
first-party-event-families 40 一方事件 family 计数
first-party-event-schema-fields 34 一方 internal-event envelope 字段
first-party-environment-fields 36 一方 environment envelope 字段
third-party-otel-events 26 第三方 OTEL structured event
third-party-otel-event-fields 26 OTEL event 到字段映射
otel-event-callsites 52 全部 Nd() 调用和动态事件表达式
otel-metrics 8 metric 名、unit、description
otel-spans 10 trace span 名
datadog-forwarded-events 181 Datadog allowlist
datadog-tag-fields 34 Datadog tag 字段
datadog-redacted-fields 26 Datadog 删除字段
growthbook-event-fields 15 experiment event envelope
sdk-control-subtypes 89 SDK control subtype
output-protocol-event-identifiers 44 user/agent/session/span protocol event
hook-events 31 hook lifecycle event

工具、命令、模型和 API

清单 数量 说明
builtin-tool-identifiers 29 提取器维护的 core name allowlist 与 bundle 静态 assignment 的交集;是人工参考集合,不是完整 _Z()/j7() 装配数组、bundle 全部注册调用点或 request-time 工具数
tool-registrations 80 canonical bundle 中同一 Yi({...}) 工厂的 AST 注册调用点;77 个 name 可直接解析、3 个保留动态 expression。两个 e.name 工厂还能由本版调用参数静态展开为 4 个名称;实际请求仍受 host、feature、entitlement、session、Tool Search 和动态 registry 过滤
known-tool-catalog 188 工具归一化 catalog,含 internal/hosted/静态 MCP
named-component-identifiers 182 name+description 组件,含依赖组件
slash-command-identifiers 103 local/local-jsx/prompt slash command
model-identifiers 37 Claude model literal
model-catalog 17 完整 baked model 条目及 resolved pricing
model-pricing-tiers 6 输入/输出/cache/web-search 定价 tier
model-aliases 4 family alias 及 provider-specific resolution
model-catalog-metadata 1 schema version、latest family、best/default 元数据
anthropic-beta-identifiers 53 date-suffixed beta/API version literal
api-paths 99 静态 API path
api-path-templates 119 动态 API/path template 和插值表达式
http-route-identifiers 19 METHOD /path route 标识
runtime-requires 54 静态 runtime require() target

存储、错误和网络

清单 数量 说明
claude-storage-namespaces 32 Claude storage key factory namespace
storage-namespaces 41 全 bundle namespace,含依赖
error-message-literals 2,248 Error/TypeError/RangeError 静态 literal
error-message-callsites 4,831 全部 Error/TypeError/RangeError 调用及参数/scope
error-message-templates 1,526 error 第一个参数的 template/expression 记录
diagnostic-message-literals 830 T() debug/diagnostic literal
diagnostic-message-callsites 5,403 全部 T() 调用及参数/scope
diagnostic-message-templates 4,438 diagnostic 第一个参数的 template/expression 记录
static-string-literals 85,095 260,838 次 quoted-string occurrence 的全量归组
template-literals 25,187 30,114 次 template occurrence 的全量归组
urls 557 静态 URL
url-templates 236 URL template 和插值表达式
endpoint-hosts 179 URL 归一化 host

Build、package 和 runtime

  • arm64 signed Mach-O standalone,包含 Bun __BUN.__bun payload。
  • 15 个 packed 文件逐字节恢复:主 bundle、5 个 JS loader、5 个 .node、Chart.js、Highlight.js、Mermaid、HTML payload。
  • 主 bundle banner 为 // @bun @bytecode @bun-cjs。
  • 完整 JSC bytecode 204,740,576 bytes 已确定性 gzip 保存,可重新解压校验。
  • 主 bundle 同时包含产品代码、第三方依赖、内嵌文档/skills、schema 和静态资源,因此任何广义 regex 清单必须区分一方产品面与依赖面。
  • runtime requires 覆盖 Node/Bun 内置模块和打包运行时依赖;它是加载面,不是 npm lockfile。
  • 版本、build time、Git SHA、DD sourcemap group、签名 identity、Team ID 和 packed offsets 已结构化保存在 analysis/version.json。

CLI、命令和输出协议

  • 标准化顶层 option/command 见 analysis/cli-surface.txt,用于避免终端换行噪声。
  • 交互、--print、text/JSON/stream-json 输入输出、partial message、structured output JSON Schema、budget、fallback model、resume/fork/session ID 均有 CLI/schema 证据。
  • 103 个 slash command 是静态 command object 的保守集合;feature-gated、host 注入或动态 plugin command 可能不在集合中。
  • 89 个 SDK control subtype 和 44 个 protocol event 覆盖 init、control request/response、hook、task progress、session/thread/outcome 等协议面。
  • stream 输出能够携带 assistant text/thinking、tool use/result、hook、subagent、task progress、system init 和最终 result。
  • --handle-uri 有额外参数注入防护;输入格式、schema validation、unknown subtype 和状态转换错误均可从错误清单追踪。

Settings、环境、schema 和 enum

  • 根 settings schema 恢复 156 个 direct 键和 4 个 spread;结构化清单保存每个 RHS、builder、description、enum、default/catch 和未解析 spread。
  • 1,165 schema property、1,150 description、201 enum group 是更广集合,包含 SDK、MCP、OTEL、依赖库和内嵌文档 schema,不能全部称为用户 setting。
  • settings 来源包含 policy/managed、flag、user、project、local、CLI 和 host/remote 注入;不同字段有 scope、trust、remote policy 和 merge precedence。
  • project/local 不允许覆盖某些 user-only setting,例如本版本新增的 spellcheck。
  • environment 既有 direct process.env,也有统一代理和 host-safe env union;2,548 个实际访问点、143 个动态 key 和 842 个 typed schema entry 可逐项比较。1,300 并集仍是调用线索,不代表 1,300 个公开支持变量。
  • safe mode、bare mode、managed settings、strict policy helper keys、remote managed settings 都会改变加载面。

模型、provider、auth 和 beta

  • 17 条内置 model catalog 同时记录 family、所有 provider ID、knowledge cutoff、context window、output limit、6 个 pricing tier、capabilities、default/各档 effort、fallback、image limit 和 advisor rank;4 个 alias 记录默认及 provider-specific resolution。
  • provider 面包括 first-party、Bedrock、Vertex、Foundry、Anthropic AWS、Anthropic Google Cloud、Mantle、gateway/企业 base URL。
  • auth 面包括 Claude subscription OAuth、API key、auth token、managed key、apiKeyHelper、AWS/GCP helper、WIF、mTLS、proxy auth 和 host credential file。
  • credential helper 有 TTL、权限和输出校验;credentials file 要求严格文件权限。
  • 53 个 date-suffixed beta identifier 同时包含 Anthropic beta、provider API version 和内嵌文档字符串,需回到 callsite 确认是否运行时使用。
  • model literal 集合包含当前和前瞻 catalog 条目;出现字符串不等于该账号/组织当前可用。

Session、transcript、memory、cache 和 storage

  • session 支持 create/resume/continue/fork、显式 ID、alias/name、archive/delete、从 PR 或 remote/cloud 恢复。
  • transcript 使用 JSONL/stream storage,支持 v5 storage namespace、session alias、history、checkpoint、attachment、tool result、task state。
  • Claude 自有 32 个 storage namespace 覆盖 global config、project/local state、sessions、aliases、transcript、history、log、telemetry、memory/cache 等;完整名单单独保存,并在 Storage 专题下钻 legacy/V5 transcript 压实、torn tail、shared inode 和并发尾追加保护。
  • auto-memory、CLAUDE.md、skills、plugins、project memory、remote memory、scratchpad、memory sync 都有独立门控。
  • prompt cache 会区分稳定 system prefix 和 cwd/env/git/LSP 等机器动态内容;本版本修复 LSP reconnect 导致的 cache invalidation。
  • auto-compact、manual compact、context limit、cold compact、1M context、compaction OTEL span/event 均可追踪。
  • file checkpointing、local checkpoint commit、resume consistency、retention sweep 和 storage migration 都有事件/错误/schema 证据。

Agent、subagent、team、worktree 和后台任务

  • custom agent、default agent、subagent type、model/effort/tool/permission inheritance、agent SDK 和 hosted/cloud agent 均存在。
  • Task/TaskCreate/TaskGet/TaskList/TaskOutput/TaskUpdate、SendMessage、Enter/ExitWorktree 是静态工具面的一部分。
  • team name、parent session/agent、subagent span、teammate idle、task completed、跨会话 message 都有协议/hook/telemetry 字段。
  • Git worktree 可隔离 agent,支持 tmux/iTerm2 pane、cleanup 和 policy/sandbox path 注册。
  • background task、daemon、PTY host、rendezvous、remote control worker、cloud workflow、ultrareview/autofix-pr 等拥有独立事件 family 和错误路径;进程 owner、attach、adopt/respawn 与 Storage 投影见 Runtime Supervision。
  • 本版本对缺少 default agent、后台云事件流重复扫描、SendMessage 过大消息做了明确修复。

权限、沙箱、网络、凭据和本地风控

完整稳定 token 见 analysis/risk-control-surface.txt。核心控制链:

  • permission mode:default、acceptEdits、auto、dontAsk、plan、bypassPermissions;
  • tool rules:allow/ask/deny,CLI allowed/disallowed tools,managed-only rules;
  • Auto classifier:rule/mode/hook/sandbox/safety/classifier decision source,无法评估走 blocking path;确定性前置层、可信规则、两阶段 XML verdict、fail-closed 和 setup/hash 见 Auto Mode 专题;
  • circuit breaker:dangerous removal、peer isolation 等类别可不受普通 bypass 影响;
  • Bash/Git:命令拆分、只读识别、cwd、.git 植入、symlink、bare repo、hook 风险和 fail-closed;
  • filesystem sandbox:allow/deny read/write、failIfUnavailable、unsandboxed command policy;
  • runtime:macOS sandbox、Linux seccomp/bwrap、Windows isolation user;
  • network:domain allow/deny、strict allowlist、managed-domain-only、Unix socket、local bind、Mach/XPC/Apple Events;
  • credentials:env/file deny/mask、regex capture、JWT claim、sentinel/fake JWT、host-bound injection;
  • trust:workspace trust、MCP headersHelper、plugin/skill/hook、CLAUDE.md external include;
  • enterprise:allowed MCP、available models、forced org、process wrapper、policy helpers、managed permission sources。

这是客户端本地执行风控,不等于 Anthropic 服务端账号评分、关联风控、滥用检测或封禁策略。bundle 不包含的服务端规则不能逆向出来。

MCP、hooks、plugins、skills 和 LSP

  • MCP 支持 stdio、HTTP/SSE/SDK、registry、OAuth、headers、headersHelper、dynamic tool/resource/prompt、strict config 和 enterprise allowlist。
  • 31 个 hook event 覆盖 tool、permission、prompt、session、subagent、compact、notification、config、worktree、team/task 生命周期。
  • PreToolUse 可 allow/deny/ask/defer 或改写 input;改写后重新进入权限检查。
  • hook transport 包括 command、HTTP 和 SDK callback;HTTP header 只允许显式 env allowlist。
  • plugin 支持 directory、ZIP、URL、marketplace、install/update/enable/disable、eval、doctor;plugin/skill attribution 有 hash/redaction 路径。plugin eval 的 case trust、with/without ablation、六类 grader、3 票多数、partial/Delta 和 scaffold 风险见 Plugin Evaluation Harness。
  • skills 可来自 bundled、user、project、plugin、account/remote sync;safe/bare/policy/compliance 会分别关闭部分来源。
  • LSP 覆盖 server lifecycle、diagnostic、tool、推荐、plugin integration、disconnect/reconnect 和 prompt cache 交互。

IDE、Chrome、Computer Use 和原生模块

  • IDE 自动连接、VS Code panel/session restore、selection/context、diff、diagnostic、focus 和 extension install 均存在。
  • Chrome bridge 有 connection/tool-call lifecycle、timeout/error、permission/onboarding 和默认 enable setting。
  • Computer Use 原生输入模块支持 keyboard、mouse、scroll、position、accessibility permission;Swift 模块支持 display/window/region capture、installed app、ESC event tap、bundle ID。
  • image processor 支持 clipboard、resize/fit、JPEG/PNG/GIF/TIFF/WebP;audio capture 支持 permission、record/play/status;URL handler 处理 macOS URL event。
  • 5 个模块 contract、原始/重建双跑和架构边界见 reconstructed/EVIDENCE.md。

Cloud、remote、CCR、BYOC、workflow 和 artifacts

  • remote session、Remote Control、CCR、teleport、cloud session/self-hosted environment、daemon worker、session ingress token 都有 API/环境/schema 证据。
  • Enterprise Gateway 另有本地可达的 OIDC/device flow、Gateway session、managed settings、provider/model mapping、CRI/JWKS/webhook、spend/Postgres、OTLP 和 admin route;完整顺序及外部 IdP/provider 边界见 Enterprise Gateway Runtime。
  • BYOC runner 注入 provider、OTEL、remote/session token、stage root、memory dir、activity FD、watchdog 和 update-disable 环境。
  • workflow、artifact、chart、Mermaid、syntax highlight、HTML payload、file upload/download、send file、design sync、projects tool 是独立能力面。
  • cloud/self-hosted 能力受组织 policy、compliance taint、nonessential traffic、provider 和 entitlement/feature gate 控制。
  • API path 清单混合本地 server route、Anthropic endpoint、managed agents 内嵌文档和依赖字符串;19 个 METHOD /path 标识更适合 route-level diff。

遥测、日志、实验和性能诊断

完整说明见 telemetry.md。覆盖:

  • 一方事件双层 pre-init queue、采样、batch、失败持久化、重试和 401 无认证重试;
  • 第三方 OTEL metrics/logs/traces、protocol、content redaction、attribute limit;
  • Datadog allowlist、字段删除、tag、归一化和 peer rate bound;
  • GrowthBook experiment;
  • error reporting、secret scrubber、Perfetto bridge/integration surface(recorder/file 未观察)、startup/query profiling、debug/diagnostic/frame/session logs。

Install、update 和 doctor

  • 顶层 install/update/doctor、auto updater、native/package install method、protected update、channel、update feed、restart prompt 均有证据。
  • CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC 和 auto-update policy 可以禁止 update lookup/download。
  • doctor 检查安装、配置、权限、MCP/plugin/LSP、shell、sandbox、network 和 telemetry 状态;具体诊断文本进入 830 项 diagnostic 清单。
  • 本版本修复后台 update 完成后 Update installed 提示的保留。

UI、输入、可访问性和 voice

  • 终端 alternate screen、screen reader/accessibility、Vim mode、key binding、multi-line input、mention/slash highlight、selection、diff sidebar、brief transcript、timestamps、progress/status line 均有 settings/event/error 证据。
  • spellcheck 支持 aspell/hunspell/ispell、语言、颜色、长驻进程、timeout 和失败后 session-disable。
  • voice/audio 包含 permission、capture/playback、file transcription、组织 policy/compliance gate。
  • image/artifact/chart/Mermaid/HTML preview 和 accessibility label/notification 是 bundled UI 能力。
  • 本版本的列表缩进、方向键+Enter、Shift+Tab permission、Vim 状态、HTML entity、VS Code focus 修复均能在 release note 和 source literal/branch 互证。

API、错误、重试、rate limit 和 compact

  • API client 包括 first-party Messages、Bedrock、Vertex、Foundry、Anthropic AWS/Google Cloud、Mantle/gateway adapter。
  • request 构建覆盖 model alias/provider ID、betas、thinking/effort、tools、streaming、prompt cache、structured output、compaction/context management。
  • retry 覆盖 network、timeout、429/5xx、overloaded、auth refresh、fallback model/provider、watchdog 和 max retries;不同路径的 retry 语义需按 callsite 分开。
  • rate limit、service tier、token/cost、cache read/write、web search、context/output limit 在 schema/model catalog/telemetry 中均有字段。
  • 2,248 个 error literal 和 830 个 diagnostic literal 是去重静态集合;4,831/5,403 个完整调用点以及 1,526/4,438 个动态模板参数另存 JSONL,不再只留在 canonical source。
  • compact 覆盖自动/手动、关闭时的 context-limit 提示、compaction event/span、summary/retention 和 resume consistency。

维护规则

每个新版本必须:

  1. 从发布 executable 重新提取 canonical packed bytes,不复制旧版本清单。
  2. 运行 source inventory extractor,并让 validator 在临时目录重生成后逐文件比较。
  3. 对 summary.json 中每个清单做 count/added/removed diff。
  4. 把新字面量先归类为 product、dependency、embedded docs 或 heuristic,再写能力结论。
  5. 更新 telemetry、risk-control、native contract、README 和 release delta。
  6. 更新机制总图、公开主张验证、Agent Loop、session/checkpoint/memory、tools/permissions/hooks、MCP/Agents/background、resilience,以及 Auth/Trust、Thinking/Fast、Usage/Limits、数据生命周期、Sandbox、Proxy/CA/mTLS、Active Goal、后台模型任务、Advisor、Ultrareview 专题;每项实质变化解释旧/新状态、gate、threshold、failure 和 user impact。
  7. 扫描所有可发布文件中的采集机 home、workspace 和 credential-shaped value;只允许 extracted/、reverse/ 保留发布产物自身携带的上游构建路径证据。
  8. 要求 completionAudit 的全部布尔项为 true 且 knownStaticExtractionGaps 为空;不可恢复边界只能是发布产物本身不存在的运行时/服务端/构建前信息。