Claude Better Cli

作者 reason-machines2384a003145a无许可证83 个星标收录于 2026年10月8日更新于 2026年10月8日仓库3个月前更新

Compatibility-first Claude CLI reimplementation with faster startup, lower memory, and drop-in command compatibility

AI 生成的概览

介绍一个兼容优先的 Claude CLI 重实现,启动更快、内存更低,且仅按需提供。

功能
该技能介绍 claude-better:一个可直接替换 Claude CLI 的重实现,声称冷启动更快、常驻内存更低,并保持命令级兼容。内容涵盖通过调整 PATH 顺序或设置别名来安装、常用命令、沿用原有环境变量与配置目录的配置方式、性能数据、脚本用法与故障排查。它产出的是说明与 shell 片段,而非自身生成的文件或代码。
适用场景
当你希望了解、安装或评估用 claude-better 替换标准 Claude CLI 时使用。适用于关注 CLI 启动性能、受限设备上的内存占用,或想确认命令是否可直接替换的场景。由于二进制文件获取受限,主要对已获得访问权限的人有用。
运行要求
需要 claude-better 二进制文件,文档称其仅按需提供给特定客户;该技能不附带脚本。还需已有的 Claude CLI 环境、ANTHROPIC_API_KEY 与 ~/.claude 配置目录,以及用于修改 PATH 或别名的 shell。

claude-better

Skill by ara.so — Daily 2026 Skills collection.

claude-better is a compatibility-first reimplementation of the Claude CLI focused on aggressive performance improvements: up to 73% faster startup and up to 80% lower resident memory, while maintaining 100% command-level compatibility with the original Claude CLI.

What It Does

  • Faster cold starts: --help goes from 182ms → 49ms; chat session bootstrap from 311ms → 102ms
  • 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

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.

Installation (Once You Have Access)

bash
# Typical binary drop-in replacement pattern# Place the claude-better binary in your PATH before the original claudeexport PATH="/path/to/claude-better/bin:$PATH"
# Verify it's being picked upwhich claudeclaude --version
bash
# Or alias it explicitly without touching PATHalias claude='/path/to/claude-better/bin/claude-better'

Key Commands

claude-better mirrors the Claude CLI surface exactly. All commands you know work as-is:

bash
# Show help (cold start: ~49ms vs 182ms baseline)claude --help
# Check auth status (warm start: ~58ms vs 146ms baseline)claude auth status
# Start an interactive chat session (~102ms bootstrap vs 311ms baseline)claude chat
# One-shot non-interactive command (~131ms vs 428ms baseline)claude -p "Summarize this file" < input.txt
# All standard flags pass through unchangedclaude --model claude-opus-4-5 chatclaude --output-format json -p "List 3 facts about Rust"

Configuration

claude-better reads the same configuration as the original Claude CLI. No new config format is required.

bash
# Standard Claude CLI env vars are respectedexport ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
# The tool reads ~/.claude/ config directory as normal# No migration of config files needed

Performance Characteristics

ScenarioBaselineclaude-betterImprovement
--help cold start182ms49ms73% faster
auth status warm146ms58ms60% faster
chat bootstrap311ms102ms67% faster
One-shot command428ms131ms69% faster
RSS after 30min session412MB83MB80% less
Streaming jitter p9591ms24ms74% lower

Scripting Patterns

Since compatibility is 100%, all existing scripting patterns work unchanged:

bash
#!/usr/bin/env bash# Existing Claude CLI scripts work without modification
# Non-interactive pipeline usageecho "Explain this error:" | cat - error.log | claude -p /dev/stdin
# Exit code handling (100% compatible)if claude auth status; then  echo "Authenticated"else  echo "Not authenticated — run: claude auth login"  exit 1fi
# JSON output parsingclaude --output-format json -p "What is 2+2?" | jq '.content'
bash
#!/usr/bin/env bash# Long-lived interactive session — memory pressure is significantly reduced# Useful on memory-constrained machines (laptops, CI runners)claude chat

Compatibility 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

Troubleshooting

Binary not found after install

bash
# Ensure claude-better/bin is earlier in PATH than original claudeecho $PATH | tr ':' '\n' | grep -n claudewhich claude  # should point to claude-better

Unexpected output differences

bash
# 1.3% of outputs differ before normalization (timestamps, whitespace, terminal width)# If a script breaks on exact output matching, add normalization:claude -p "..." | tr -s ' ' | sed 's/[[:space:]]*$//'

Auth not recognized

bash
# claude-better reads the same auth store as the original CLI# If auth fails, re-authenticate via the standard flow:claude auth login

Falling back to original CLI

bash
# If you hit an edge case, unset the alias/PATH change to revert instantlyunalias claude# orexport PATH="<original-path-without-claude-better>"

Architecture 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

来源与署名

来源:reason-machines/trending-skills位于skills/claude-better-cli提交2384a00

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架