Clawd-Companion: Instructions file for Claude Code

CLAUDE.md

Clawd-Companion CLAUDE.md is an instructions file for Claude Code, Codex from Doulor/Clawd-Companion. It costs 1,660 tokens per session, scanned B, a copy of Clawd-Companion AGENTS.md, MIT.

A set of release instructions for Clawd Companion, including version updates, local builds, artifact naming, tags, and GitHub Releases.

In plain words
What is it for?
Use it when releasing Clawd Companion, bumping its version, building installers, renaming executable and blockmap files, and preparing the automated GitHub release.
Why use it?
It prevents release files and update metadata from using mismatched names or versions. It also defines the expected sequence for preparing and publishing a release.

Instructions file for Claude CodeCodex

Written for Claude Code and Codex: SessionStart hook event, but also reads ~/.codex or $CODEX_HOME. Also seen: reads .claude/ paths; mentions Claude Code; mentions Codex.

This is Doulor/Clawd-Companion's own configuration. It tells Claude Code and Codex how to work on Clawd-Companion itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Clawd-Companion configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Doulor/Clawd-Companion. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Doulor/Clawd-Companion/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/Doulor/Clawd-Companion

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Clawd-Companion CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/doulor/clawd-companion/claude-md/github.svg)](https://agentmods.dev/instructions/doulor/clawd-companion/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/doulor/clawd-companion/claude-md"><img src="https://agentmods.dev/badge/instructions/doulor/clawd-companion/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Clawd-Companion CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/doulor/clawd-companion/claude-md"><img src="https://agentmods.dev/badge/instructions/doulor/clawd-companion/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,660 This file is loaded in full into every session.
When invoked 1,660 The same file — it is already loaded in full.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 86% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01660 $0.01660
Opus 5 $0.00830 $0.00830
Sonnet 5 $0.00332 $0.00332
Haiku 4.5 $0.00166 $0.00166

Measured 10d ago against content hash b8af0a8ca0d4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

Clawd-Companion CLAUDE.md scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- `format`:`"json"`(Claude Code 用 `~/.claude/settings.json`)或 `"toml"`(Codex 用 `~/.codex/config.toml`)

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

4. 通过 `child_process.spawn` + `detached: true` + `unref()` 启动,不阻塞 forwarder 退出
Origin

This is a copy

86% identical to Clawd-Companion AGENTS.md — 48 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

CLAUDE.md · 100 lines

How it starts

The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Clawd Companion 项目指南

发布流程

当用户说"提交release"或类似表述时,自动执行以下流程:

  1. 版本号递增:运行 npm run version:patch(或 version:minor / version:major)同步更新 package.jsonpackage-lock.json
    • 如果用户主动指定了版本号(如"发布1.4.0"),可使用 npm run version:patch -- 1.4.0 或手动执行 node scripts/bump-version.mjs 1.4.0
    • 永远不要覆盖已有的 GitHub Release
  2. 本地构建(可选,CI 会自动构建):运行 npm run dist 生成安装包
  3. 文件重命名:将生成的 exe 和 blockmap 文件名从空格格式改为连字符格式(如 Clawd Companion Setup 1.3.3.exeClawd-Companion-Setup-1.3.3.exe),以匹配 latest.yml 中的文件名
  4. 提交推送:git add → commit → tag → push(tag 格式 v{版本号}
  5. 创建 Release:推送 tag 后,CI 工作流 .github/workflows/release.yml 会自动构建并发布到 GitHub Release。如需手动发布,使用 gh release create

版本号规则

  • 当前版本存储在 package.jsonversion 字段
  • 每次发布自动 patch 递增,除非用户明确指定
  • latest.yml 中的文件名必须与上传到 Release 的文件名完全一致
  • scripts/bump-version.mjs 负责同步 package.jsonpackage-lock.json 两个文件的版本

Release 文件命名规范

  • 上传到 GitHub Release 的文件必须使用连字符格式:Clawd-Companion-Setup-{版本号}.exe
  • electron-builder 生成的文件使用空格格式:Clawd Companion Setup {版本号}.exe
  • 必须在构建后重命名:exe 和 blockmap 文件都需要从空格格式改为连字符格式
  • latest.yml 中的文件名必须与重命名后的文件名完全一致
  • CI 中的重命名步骤在 .github/workflows/release.yml 的 "Rename artifacts to match latest.yml" 中自动完成

构建命令

  • npm run build — 编译 TypeScript + Vite 构建
  • npm run dist — 构建 + electron-builder 打包
  • npm run dist:validate — 校验 latest.yml 文件名一致性
  • npm run typecheck — 仅做类型检查(不发包)
  • npm test — 运行 hook-forwarder 单元测试(vitest)
  • npm run version:patch / version:minor / version:major — 同步更新 package.json 和 package-lock.json 的版本号

持续集成 (CI/CD)

  • .github/workflows/ci.yml:push / PR 触发,运行 typecheck + 测试(windows-latest)
  • .github/workflows/release.yml:tag 触发(v*.*.*),自动构建、产物重命名、上传到 GitHub Release

Claude Code 启动时自动启动本应用

默认关闭,需要用户在配置面板 → 应用行为 中开启「Claude Code 启动时自动启动本应用」开关。

开关实现细节:

  1. 主程序把开关状态写入标记文件 ~/.clawd-companion/auto-start-with-cli.flag
  2. forwarder 在 SessionStart 时先 ping 127.0.0.1:47634/health,如果主程序已在运行则直接复用
  3. 如果主程序未运行,根据 forwarder 所在位置判断是 dev 还是 prod 布局:
    • Dev: <project>/dist/hook-forwarder/index.jsnpm start in 项目根
    • Prod: <install>/resources/hook-forwarder/index.js<install>/Clawd Companion.exe
  4. 通过 child_process.spawn + detached: true + unref() 启动,不阻塞 forwarder 退出
  5. 环境变量覆盖(高级用户):CLAWD_COMPANION_AUTOSTART=1 强制开启,=0 强制关闭

Read the full file on GitHub · 100 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 100 lines · 1,660 tokens per session scan B b8af0a8ca0d4

Subscribe to this mod's changes

Clawd-Companion CLAUDE.md is an instructions file published in the GitHub repository Doulor/Clawd-Companion (40 stars, last pushed 2mo ago), licensed MIT. It adds 1,660 tokens to every session, about $0.0083 per session on Opus 5. A static security scan graded it B with 2 findings (reads agent configuration directories, runs shell commands). It is 86% identical to Clawd-Companion AGENTS.md, differing in 48 lines, and is treated as a copy.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens

deepseek-harness AGENTS.md

AGENTS.md instructions for deepseek-ai/deepseek-harness, covering agents.md, pre-stable apis and released session data, repository layout, commands and host sandbox failures.

deepseek-ai/deepseek-harness · 3,735 tokens