Files
clawgod/README_ZH.md
omar a5dd271588
Upstream Sync / sync (push) Successful in 13s
ci: drop release workflow, switch install URLs to raw/HEAD
Gitea has no /releases/latest/download/<file> shortcut (GitHub-only),
so the URL we wired up last commit served 404. Switch all user-facing
install commands to /raw/HEAD/install.{sh,ps1} -- the HEAD ref resolves
to the default branch (secure-main) without naming it, gives a stable
"always latest" URL, and survives a future branch rename.

With install no longer routed through release assets, the release
workflow becomes dead weight: secure-main is the curated branch (every
merge is manually reviewed), so every commit there is already vetted.
A separate tagged-release step duplicates that gate without adding new
information. Drop .gitea/workflows/release.yml; tag manually if you
ever want an immutable audit checkpoint.

The orphan v1.1.7-secure.1 tag + release is left in place as a
historical snapshot; harmless and can be deleted from the Gitea UI
later if desired.
2026-05-21 03:47:26 +03:00

7.8 KiB
Raw Permalink Blame History

ClawGod

English | 中文 | 日本語

Latest Released Downloads Compat Claude tested

Claude Code 上帝模式。

这不是第三方 Claude Code 客户端。 ClawGod 是作用在官方 Claude Code 之上的运行时补丁。它兼容任何版本——当 Claude Code 升级,ClawGod 会在下次启动时自动从新版本重新抽取并重新打补丁。

前置依赖

运行 ClawGod 安装脚本之前先装好:

工具 用途 安装
Claude Code(原生二进制) ClawGod 是基于你已装的官方 Bun standalone 二进制做 patch claude.ai/install.sh(macOS/Linux)或 claude.ai/install.ps1(Windows)
ripgrep Claude Code 内置 Grep tool 必需 brew install ripgrep / apt install ripgrep / winget install BurntSushi.ripgrep.MSVC
Node.js >= 18 patcher 使用 nodejs.org
Bun 运行 patched cli.js 的 runtime,缺失时自动安装 bun.sh、npm install -g bun、scoop install bun 或 choco install bun

安装

macOS / Linux:

curl -fsSL https://git.qomar.pw/omar/clawgod/raw/HEAD/install.sh | bash

Windows (PowerShell):

irm https://git.qomar.pw/omar/clawgod/raw/HEAD/install.ps1 | iex

绿色 Logo = 已 Patch。橙色 Logo = 原版。

ClawGod 效果展示

功能一览

功能解锁

补丁 效果
内部用户模式 24+ 隐藏命令(/share、/teleport、/issue、/bughunter...),调试日志,API 请求记录
GrowthBook 覆盖 通过配置文件覆盖任意 Feature Flag
Agent Teams 多智能体协作,无需额外参数
Computer Use 无需 Max/Pro 订阅即可使用屏幕控制(macOS)
Auto-mode 解锁第三方 API 用户的 auto-mode(移除 firstParty 限制)
Ultraplan 通过 Claude Code Remote 进行多智能体规划
Ultrareview 通过 Claude Code Remote 自动化 Bug 查找

限制移除

补丁 移除内容
CYBER_RISK_INSTRUCTION 安全测试拒绝提示(渗透测试、C2 框架、漏洞利用)
URL 限制 "禁止生成或猜测 URL" 指令
操作审慎 破坏性操作前的强制确认
登录提示 启动时的"未登录"提醒

视觉

补丁 效果
绿色主题 品牌色 → 绿色,一眼辨别是否已 Patch
消息过滤 显示对非 Anthropic 用户隐藏的内容

可靠性

功能 作用
1h Prompt Cache 强制启用 1h TTL allowlist(默认实际是 5m → 空闲后导致大量 cache_creation token 浪费)
第三方 Cache 修复 当 baseURL 指向非 Anthropic 域名时自动关闭 x-anthropic-billing-header。该 header 里的 cch 字段每请求都变,会让 DeepSeek / OneAPI / Bedrock / vLLM 以及所有 Anthropic 协议代理的 prompt-cache 命中率归零。不需要再自行配置 CLAUDE_CODE_ATTRIBUTION_HEADER=0。
自动重打补丁 检测到用户官方升级了 native Claude binary 时,下次启动自动重新抽取 + 重新 patch

使用

claude              # 已 Patch 的 Claude Code(替换官方 launcher)
clawgod             # 同 `claude`,显式且永远生效的入口
claude.orig         # 原版未修改版本(自动备份)

clawgod 是一个无歧义的入口:Windows 上即便 claude.exe 抢占了 claude.cmd,clawgod.cmd 始终生效;即便官方自动更新覆盖了 claude,clawgod 仍跑 patched 版本。

配置

首次启动会自动生成 ~/.clawgod/provider.json。填入 apiKey 即可跳过 OAuth 登录,对接任何 Anthropic 协议端点。

{
  "apiKey": "sk-ant-...",
  "baseURL": "https://api.anthropic.com",
  "model": "",
  "smallModel": "",
  "timeoutMs": 3000000
}
  • 填写 apiKey:ClawGod 注入 ANTHROPIC_API_KEY 并与 ~/.claude/settings.json 隔离。可用于 Anthropic 官方、DeepSeek,以及任何 OpenAI-compatible 网关;baseURL 指向非 Anthropic 域名时,还会自动注入 ANTHROPIC_AUTH_TOKEN 以适配网关鉴权。
  • 留空 apiKey:走 OAuth 路径,执行一次 claude auth login,~/.claude 下的 subagents / skills / MCP 配置继续有效。

工作原理

从 @anthropic-ai/claude-code v2.1.113 起,npm 包不再带 cli.js——它只是个 thin loader 转发到平台特定的 Bun standalone 二进制。ClawGod 这样适配:

  1. 在 ~/.local/share/claude/versions/ 定位用户已装的 Bun native binary
  2. 从 __BUN segment(Mach-O / ELF / PE)抽出嵌入的 cli.js 源码
  3. 抽出嵌入的 .node 原生模块(audio-capture、image-processor、computer-use-*、url-handler)放到 ~/.clawgod/vendor/
  4. 把 /$bunfs/... 虚拟路径重写到本地 vendor 路径
  5. 应用 23 条正则 patch(跨版本兼容,同一组 regex 覆盖多个 release)
  6. claude / clawgod launcher 在 Bun runtime 下跑 patched cli.js

~/.clawgod/.source-version 标记当时被 patch 的版本号。每次启动 wrapper 比对它和 versions/ 里最新二进制;如果用户走官方途径升级了 Claude Code,下次启动会自动重打补丁。

更新

直接照常跑 claude update 即可。 ClawGod 把这条命令 patch 成走自己的 installer——从 npm 拉 Anthropic 当前发布(@anthropic-ai/claude-code-<plat>@latest)、重新提取 cli.js、重新打补丁、重写 launcher。所以上游 claude update 命令对用户依然如常工作——一条命令拿到最新 Claude + 补丁仍然生效。

如果你想直接调 installer(效果一样,两条路径都会拉同一个上游 release 并重新 patch):

macOS / Linux:

curl -fsSL https://git.qomar.pw/omar/clawgod/raw/HEAD/install.sh | bash

Windows:

irm https://git.qomar.pw/omar/clawgod/raw/HEAD/install.ps1 | iex

如果你想脱离 ClawGod、使用 Anthropic 原本的 claude update(它会写到自己管的目录、并把我们的 launcher 替换掉),请先卸载:

bash ~/.clawgod/install.sh --uninstall

卸载

macOS / Linux:

curl -fsSL https://git.qomar.pw/omar/clawgod/raw/HEAD/install.sh | bash -s -- --uninstall
hash -r  # 刷新 shell 缓存

Windows:

irm https://git.qomar.pw/omar/clawgod/raw/HEAD/install.ps1 -OutFile install.ps1; .\install.ps1 -Uninstall

卸载会把 claude.orig 还原成 claude,并移除 clawgod 别名。

安装或卸载后,如果命令未立即生效,请重启终端或执行 hash -r。

许可证

GPL-3.0 — 与 Anthropic 无关,风险自负。

Star History

Star History Chart