bare-eval

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Bare Eval — Isolated Evaluation Calls

Bare Eval — 隔离式评估调用

Run
claude -p --bare
for fast, clean eval/grading without plugin overhead.
CC 2.1.81 required. The
--bare
flag skips hooks, LSP, plugin sync, and skill directory walks.
运行
claude -p --bare
,以在无插件开销的情况下快速、干净地完成评估/评分。
需要CC 2.1.81版本。
--bare
标志会跳过钩子、LSP、插件同步以及skill目录遍历。

When to Use

适用场景

  • Grading skill outputs against assertions
  • Trigger classification (which skill matches a prompt)
  • Description optimization iterations
  • Any scripted
    -p
    call that doesn't need plugins
  • 根据断言评分skill输出
  • 触发器分类(判断哪个skill匹配提示词)
  • 描述优化迭代
  • 任何无需插件的脚本化
    -p
    调用

When NOT to Use

不适用场景

  • Testing skill routing (needs
    --plugin-dir
    )
  • Testing agent orchestration (needs full plugin context)
  • Interactive sessions
  • 测试skill路由(需要
    --plugin-dir
  • 测试Agent编排(需要完整插件上下文)
  • 交互式会话

Prerequisites

前置条件

bash
undefined
bash
undefined

--bare requires ANTHROPIC_API_KEY (OAuth/keychain disabled)

--bare模式需要ANTHROPIC_API_KEY(OAuth/钥匙串功能已禁用)

export ANTHROPIC_API_KEY="sk-ant-..."
export ANTHROPIC_API_KEY="sk-ant-..."

Verify CC version

验证CC版本

claude --version # Must be >= 2.1.81
undefined
claude --version # 版本必须 >= 2.1.81
undefined

Quick Reference

快速参考

Call TypeCommand Pattern
Grading
claude -p "$prompt" --bare --max-turns 1 --output-format text
Trigger
claude -p "$prompt" --bare --json-schema "$schema" --output-format json
Optimize
echo "$prompt" | claude -p --bare --max-turns 1 --output-format text
Force-skill
claude -p "$prompt" --bare --print --append-system-prompt "$content"
调用类型命令格式
评分
claude -p "$prompt" --bare --max-turns 1 --output-format text
触发器
claude -p "$prompt" --bare --json-schema "$schema" --output-format json
优化
echo "$prompt" | claude -p --bare --max-turns 1 --output-format text
强制指定skill
claude -p "$prompt" --bare --print --append-system-prompt "$content"

Invocation Patterns

调用模式

Load detailed patterns and examples:
Read("${CLAUDE_SKILL_DIR}/references/invocation-patterns.md")
加载详细模式与示例:
Read("${CLAUDE_SKILL_DIR}/references/invocation-patterns.md")

Grading Schemas

评分Schema

JSON schemas for structured eval output:
Read("${CLAUDE_SKILL_DIR}/references/grading-schemas.md")
用于结构化评估输出的JSON Schema:
Read("${CLAUDE_SKILL_DIR}/references/grading-schemas.md")

Pipeline Integration

流水线集成

OrchestKit's eval scripts (
npm run eval:skill
) auto-detect bare mode:
bash
undefined
OrchestKit的评估脚本(
npm run eval:skill
)会自动检测bare模式:
bash
undefined

eval-common.sh detects ANTHROPIC_API_KEY → sets BARE_MODE=true

eval-common.sh会检测ANTHROPIC_API_KEY → 设置BARE_MODE=true

Scripts add --bare to all non-plugin calls automatically

脚本会自动为所有非插件调用添加--bare参数


**Bare calls:** Trigger classification, force-skill, baseline, all grading.
**Never bare:** `run_with_skill` (needs plugin context for routing tests).

**Bare模式调用场景:** 触发器分类、强制指定skill、基准测试、所有评分场景。
**禁止使用Bare模式场景:** `run_with_skill`(路由测试需要插件上下文)。

Performance

性能对比

ScenarioWithout --bareWith --bareSavings
Single grading call~3-5s startup~0.5-1s2-4x
Trigger (per prompt)~3-5s~0.5-1s2-4x
Full eval (50 calls)~150-250s overhead~25-50s3-5x
场景不使用--bare使用--bare性能提升
单次评分调用~3-5秒启动时间~0.5-1秒2-4倍
触发器测试(单提示词)~3-5秒~0.5-1秒2-4倍
完整评估(50次调用)~150-250秒开销~25-50秒3-5倍

Rules

规则

Read("${CLAUDE_SKILL_DIR}/rules/_sections.md")
Read("${CLAUDE_SKILL_DIR}/rules/_sections.md")

Troubleshooting

故障排查

Read("${CLAUDE_SKILL_DIR}/references/troubleshooting.md")
Read("${CLAUDE_SKILL_DIR}/references/troubleshooting.md")

Related

相关资源

  • eval:skill
    npm script — unified skill evaluation runner
  • eval:trigger
    — trigger accuracy testing
  • eval:quality
    — A/B quality comparison
  • optimize-description.sh
    — iterative description improvement
  • Version compatibility:
    doctor/references/version-compatibility.md
  • eval:skill
    npm脚本 — 统一的skill评估运行器
  • eval:trigger
    — 触发器准确性测试
  • eval:quality
    — A/B质量对比
  • optimize-description.sh
    — 描述迭代优化
  • 版本兼容性:
    doctor/references/version-compatibility.md