claude-better-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseclaude-better
claude-better
Skill by ara.so — Daily 2026 Skills collection.
claude-better由 ara.so 开发的Skill — 2026年度每日技能系列。
claude-betterWhat It Does
核心特性
- Faster cold starts: goes from 182ms → 49ms;
--helpsession bootstrap from 311ms → 102mschat - Lower memory: sustained interactive sessions drop from ~412MB → ~83MB RSS
- Drop-in compatible: 100% pass rate on primary command forms, 100% exit-code match, 98.7% byte-for-byte output parity
- Zero migration cost: existing scripts, aliases, and muscle memory continue to work unchanged
- 更快的冷启动速度:命令耗时从182ms降至49ms;
--help会话启动从311ms降至102mschat - 更低的内存占用:持续交互会话的RSS从
412MB降至83MB - 可直接替换:核心命令形式通过率100%,退出码100%匹配,逐字节输出一致性达98.7%
- 零迁移成本:现有脚本、别名、使用习惯无需任何改动即可继续使用
Availability
可用性
⚠️ Source code is provided for selected high-profile customers only and available upon request. Contact the maintainer at krzyzanowskim/claude-better for access.
If you have access, install as described in your onboarding materials. The binary is a drop-in replacement — substitute it wherever you invoke .
claude⚠️ 源代码仅向选定的高优先级客户提供,可按需申请。请通过 krzyzanowskim/claude-better 联系维护者获取访问权限。
如果你有访问权限,请按照接入材料中的说明安装。该二进制文件是可直接替换的替代版本,你可以在任何调用的地方替换使用它。
claudeInstallation (Once You Have Access)
安装(获得访问权限后)
bash
undefinedbash
undefinedTypical binary drop-in replacement pattern
Typical binary drop-in replacement pattern
Place the claude-better binary in your PATH before the original claude
Place the claude-better binary in your PATH before the original claude
export PATH="/path/to/claude-better/bin:$PATH"
export PATH="/path/to/claude-better/bin:$PATH"
Verify it's being picked up
Verify it's being picked up
which claude
claude --version
```bashwhich claude
claude --version
```bashOr alias it explicitly without touching PATH
Or alias it explicitly without touching PATH
alias claude='/path/to/claude-better/bin/claude-better'
undefinedalias claude='/path/to/claude-better/bin/claude-better'
undefinedKey Commands
核心命令
claude-betterbash
undefinedclaude-betterbash
undefinedShow help (cold start: ~49ms vs 182ms baseline)
Show help (cold start: ~49ms vs 182ms baseline)
claude --help
claude --help
Check auth status (warm start: ~58ms vs 146ms baseline)
Check auth status (warm start: ~58ms vs 146ms baseline)
claude auth status
claude auth status
Start an interactive chat session (~102ms bootstrap vs 311ms baseline)
Start an interactive chat session (~102ms bootstrap vs 311ms baseline)
claude chat
claude chat
One-shot non-interactive command (~131ms vs 428ms baseline)
One-shot non-interactive command (~131ms vs 428ms baseline)
claude -p "Summarize this file" < input.txt
claude -p "Summarize this file" < input.txt
All standard flags pass through unchanged
All standard flags pass through unchanged
claude --model claude-opus-4-5 chat
claude --output-format json -p "List 3 facts about Rust"
undefinedclaude --model claude-opus-4-5 chat
claude --output-format json -p "List 3 facts about Rust"
undefinedConfiguration
配置
claude-betterbash
undefinedclaude-betterbash
undefinedStandard Claude CLI env vars are respected
Standard Claude CLI env vars are respected
export ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
export ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
The tool reads ~/.claude/ config directory as normal
The tool reads ~/.claude/ config directory as normal
No migration of config files needed
No migration of config files needed
undefinedundefinedPerformance Characteristics
性能表现
| Scenario | Baseline | claude-better | Improvement |
|---|---|---|---|
| 182ms | 49ms | 73% faster |
| 146ms | 58ms | 60% faster |
| 311ms | 102ms | 67% faster |
| One-shot command | 428ms | 131ms | 69% faster |
| RSS after 30min session | 412MB | 83MB | 80% less |
| Streaming jitter p95 | 91ms | 24ms | 74% lower |
| 场景 | 原版基线 | claude-better | 提升幅度 |
|---|---|---|---|
| 182ms | 49ms | 快73% |
| 146ms | 58ms | 快60% |
| 311ms | 102ms | 快67% |
| 单次非交互命令 | 428ms | 131ms | 快69% |
| 30分钟会话后RSS | 412MB | 83MB | 少80% |
| 流式传输抖动p95 | 91ms | 24ms | 低74% |
Scripting Patterns
脚本使用模式
Since compatibility is 100%, all existing scripting patterns work unchanged:
bash
#!/usr/bin/env bash由于兼容性为100%,所有现有脚本使用模式无需改动即可生效:
bash
#!/usr/bin/env bashExisting Claude CLI scripts work without modification
Existing Claude CLI scripts work without modification
Non-interactive pipeline usage
Non-interactive pipeline usage
echo "Explain this error:" | cat - error.log | claude -p /dev/stdin
echo "Explain this error:" | cat - error.log | claude -p /dev/stdin
Exit code handling (100% compatible)
Exit code handling (100% compatible)
if claude auth status; then
echo "Authenticated"
else
echo "Not authenticated — run: claude auth login"
exit 1
fi
if claude auth status; then
echo "Authenticated"
else
echo "Not authenticated — run: claude auth login"
exit 1
fi
JSON output parsing
JSON output parsing
claude --output-format json -p "What is 2+2?" | jq '.content'
```bash
#!/usr/bin/env bashclaude --output-format json -p "What is 2+2?" | jq '.content'
```bash
#!/usr/bin/env bashLong-lived interactive session — memory pressure is significantly reduced
Long-lived interactive session — memory pressure is significantly reduced
Useful on memory-constrained machines (laptops, CI runners)
Useful on memory-constrained machines (laptops, CI runners)
claude chat
undefinedclaude chat
undefinedCompatibility Notes
兼容性说明
- CLI surface: 100% compatible with targeted Claude CLI command forms
- Exit codes: 100% match on documented exit-code behavior
- Output parity: 98.7% byte-for-byte; 100% semantic parity after whitespace/timestamp/terminal-width normalization
- Tested environments: macOS (Apple Silicon), Linux, containerized CI
- Tested against: 1,200 synthetic invocations, 87 flag combinations, 42 interactive flows, 14 failure-mode scenarios
- 命令界面:与目标Claude CLI命令形式100%兼容
- 退出码:文档记录的退出码行为100%匹配
- 输出一致性:逐字节一致性为98.7%;经过空白符/时间戳/终端宽度归一化后,语义一致性为100%
- 测试环境:macOS(苹果芯片)、Linux、容器化CI
- 测试覆盖:1200次模拟调用、87种标志组合、42种交互流程、14种故障模式场景
Troubleshooting
故障排查
Binary not found after install
bash
undefined安装后找不到二进制文件
bash
undefinedEnsure claude-better/bin is earlier in PATH than original claude
Ensure claude-better/bin is earlier in PATH than original claude
echo $PATH | tr ':' '\n' | grep -n claude
which claude # should point to claude-better
**Unexpected output differences**
```bashecho $PATH | tr ':' '\n' | grep -n claude
which claude # should point to claude-better
**输出差异不符合预期**
```bash1.3% of outputs differ before normalization (timestamps, whitespace, terminal width)
1.3% of outputs differ before normalization (timestamps, whitespace, terminal width)
If a script breaks on exact output matching, add normalization:
If a script breaks on exact output matching, add normalization:
claude -p "..." | tr -s ' ' | sed 's/[[:space:]]*$//'
**Auth not recognized**
```bashclaude -p "..." | tr -s ' ' | sed 's/[[:space:]]*$//'
**无法识别认证信息**
```bashclaude-better reads the same auth store as the original CLI
claude-better reads the same auth store as the original CLI
If auth fails, re-authenticate via the standard flow:
If auth fails, re-authenticate via the standard flow:
claude auth login
**Falling back to original CLI**
```bashclaude auth login
**回退到原版CLI**
```bashIf you hit an edge case, unset the alias/PATH change to revert instantly
If you hit an edge case, unset the alias/PATH change to revert instantly
unalias claude
unalias claude
or
or
export PATH="<original-path-without-claude-better>"
undefinedexport PATH="<original-path-without-claude-better>"
undefinedArchitecture Notes (For Contributors / Evaluators)
架构说明(面向贡献者/评估者)
The performance gains come from specific implementation choices documented in the README:
- Zero-copy streaming pipeline for token output (reduces streaming jitter)
- Precomputed command registry instead of dynamic startup discovery (cuts cold-start time)
- Aggressively bounded allocation for session state (drives memory reduction)
- Lazy subsystem initialization — only the active command path pays startup cost
- Compatibility shim layer that preserves flags/behavior without carrying the full original stack
性能提升来自README中记录的特定实现选择:
- 令牌输出采用零拷贝流式管道(降低流式传输抖动)
- 使用预计算命令注册表替代动态启动发现(缩短冷启动时间)
- 会话状态采用严格边界的内存分配(实现内存占用降低)
- 子系统懒加载:仅活跃命令路径需要支付启动成本
- 兼容垫片层:保留所有标志/行为,无需承载完整的原版技术栈