ECC
ECC 性能与成本:预算上下文、Hooks 与代理运行
测量上下文开销、hook 延迟、MCP 调用、记忆写入和人工审核时间。

你将学会
- Instrument a complete ECC task loop
- Attribute context, hook, and tool cost
- Set safe optimization budgets
开始前需要
- Basic Git and command-line usage
- Comfort reading a project README
You can explain the project, run its documented first step, and decide what to verify before adopting it.
先看结论
- Trace model, tools, hooks, MCP, tests, review, and memory as separate spans.
- Context and hook selection can dominate cost even before extra tool calls.
- Optimize budgets without removing approvals, redaction, or security hooks.
Measure the whole agent loop
ECC 的成本来自模型上下文、工具、生命周期 hooks、MCP、记忆和人工审核。固定客户端、模型、任务与版本,分别记录 token、事件、工具耗时、记忆写入和最终接受的变更。
Use one harmless repository task, fixed model/settings, and a pinned ECC revision. Record context size and generated-file count because a larger catalog can increase prompt tokens even when no extra tool runs occur.
Control context and hook overhead
Compare a minimal selected skill set with a full catalog. Track input/output tokens, hook invocations, shell duration, MCP round trips, memory writes, and failed/retried actions. A hook that performs network discovery on every tool call can dominate both latency and privacy risk.
Keep hooks idempotent and asynchronous only when the event contract allows it; hiding work in the background can improve perceived latency while making failures harder to observe. Publish event IDs and completion status in the receipt.
Turn spend into a decision
A run can consume model tokens, hosted API credits, local compute, CI minutes, and operator review time. Keep provider prices as variables unless the source and date establish them. Compare cost per verified change or per accepted review, not tokens alone.
For teams, a small canary matrix across clients reveals adapter overhead and parity gaps. A faster client that omits a security hook may be cheaper but unacceptable for the target risk profile.
Optimize and preserve guardrails
Select only needed skills, cache static manifests, batch non-sensitive lookups, and move expensive analysis to explicit commands. Never remove approval checks or redaction to win a latency benchmark. Set budgets for tokens, tool calls, wall time, and memory writes, then fail with a recoverable receipt.
After an upgrade, replay the same task and compare context, events, tests, generated files, and review outcome. The best ECC configuration is the least expensive one that still produces explainable, safe engineering work.
如何选择
| 比较维度 | 方案 A | 方案 B |
|---|---|---|
| Best when | You need predictable behavior and easy auditing | You need adaptive optimization and have reliable telemetry |
| Main risk | May leave performance on the table | Can become difficult to explain or debug |
实施步骤
- 1
Pin ECC, client, model, and a harmless repository task.
- 2
Capture tokens, hook/MCP events, tool duration, memory writes, and review time.
- 3
Compare minimal and expanded catalogs with the same task.
- 4
Replay after upgrades and enforce visible token/tool/time budgets.
可复制示例
trace_id,client,ecc_rev,skill_set,input_tokens,output_tokens
tool_ms,hook_ms,mcp_calls,memory_writes,review_ms,accepted_change,cost_variable常见问题
Does fewer tokens always mean a cheaper ECC setup?
No. A setup can use fewer prompt tokens but add slower tools, retries, or operator review. Measure the complete verified-change path.
Can I disable hooks for a benchmark?
Only in a clearly labeled comparison. Production decisions must include the approvals, redaction, and security hooks the workflow requires.
资料来源
- ECC README (captured 2026-08-31)来源核查 2026-08-31
- ECC repository来源核查 2026-08-31