forge-hub CLAUDE.md

forge-hub CLAUDE.md is an instructions file for coding agents from LinekForge/forge-hub. It costs 1,413 tokens per session, scanned A, original, MIT.

Repository instructions for Forge Hub, a TypeScript and Bun project that routes messages between channels such as WeChat, Telegram, Feishu, iMessage, and a local dashboard. A monorepo is one repository containing several related modules.

In plain words
What is it for?
Use them when developing or checking Forge Hub’s server, client, command-line tools, dashboard, test harness, or experimental scheduling engine. They include the relevant type-checking and test commands.
Why use it?
They tell a coding agent which runtime, folders, commands, and tests the project uses, reducing mistakes when working across its modules.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/linekforge/forge-hub/claude-md
Clone the repo
git clone --depth 1 https://github.com/LinekForge/forge-hub

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 forge-hub CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/linekforge/forge-hub/claude-md.svg)](https://agentmods.dev/instructions/linekforge/forge-hub/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/linekforge/forge-hub/claude-md"><img src="https://agentmods.dev/badge/instructions/linekforge/forge-hub/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,413 This file is loaded in full into every session.
When invoked 1,413 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.01413 $0.01413
Opus 5 $0.00707 $0.00707
Sonnet 5 $0.00283 $0.00283
Haiku 4.5 $0.00141 $0.00141

Measured 3d ago against content hash 510622aa1e60, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

forge-hub CLAUDE.md scanned grade A with 0 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 3d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 101 lines

How it starts

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

CLAUDE.md

为 Claude Code (claude.ai/code) 提供本仓库的工作指引。

项目概览

Forge Hub 是 Claude Code 的多通道消息总线。把微信、Telegram、飞书、iMessage、本地 Dashboard 五个通道的消息路由到 Claude Code 实例,并处理远程审批转发。

  • 运行时:Bun(不是 Node.js)
  • 语言:TypeScript,全局 strict mode
  • 无构建步骤:server/client/cli/engine 由 Bun 直接跑 TS;只有 hub-dashboard 需要 Vite 构建

Monorepo 结构

模块 成熟度 说明
hub-server/ 稳定主线 消息路由、审批、安全防线、通道管理。HTTP 路由拆分在 hub-server/routes/(health/send/approval/instances/homeland/dashboard/search),endpoints.ts 只做鉴权 + 分发
hub-client/ 稳定主线 Claude Code MCP channel(4 个工具:hub_reply / hub_send_file / hub_send_voice / hub_replay_history)
forge-cli/ 稳定主线 日常管理 CLI(fh hub ... / fh engine ...
cli.ts 稳定主线 安装入口(forge-hub install / uninstall / doctor
hub-test-harness/ 稳定主线 隔离端到端测试(8 场景,端口 9901)
hub-dashboard/ 已部署 UI React + Tailwind + Zustand(仍在迭代)
hub-app/ Preview macOS 原生客户端(Swift)
forge-engine/ 实验性 定时任务引擎(默认不启用)

构建与测试命令

各模块验证(从仓库根目录执行):

# hub-server:类型检查 + 单元测试
(cd hub-server && bun install && bunx tsc --noEmit && bun test)

# hub-client:类型检查 + 单元测试
(cd hub-client && bun install && bunx tsc --noEmit && bun test)

# forge-cli:单元测试
(cd forge-cli && bun test)

# forge-engine:类型检查 + 单元测试
(cd forge-engine && bun install && bunx tsc --noEmit && bun test)

# hub-dashboard:lint + 构建 + 测试
(cd hub-dashboard && bun install && bun run lint && bun run build && bun test)

# 集成测试
bun hub-test-harness/harness.ts    # 8 场景 harness(在 :9901 启动隔离 Hub)
fh hub self-test                    # 完整端到端(需要运行中的 Hub)

关键约定

  • 安全失败必须 fail-closed:lock / allowlist / audit / evidence 写失败必须 throw 或 fallback,不能静默放过
  • 未授权消息不进主 context:走 evidence vault + security event 聚合,通知最多 1 条/小时极简提醒
  • 外来字段必须净化:display name / 文件名 / caption 进 LLM 可见文本前走 sanitize.ts(Unicode 清洗 + entity-encode + truncate)
  • 不允许静默失败:catch 块至少 logError(...)
  • 不硬编码路径:用 which 动态查找 + env var 覆盖
  • 代码中不出现私人 ID / 密钥(测试也不行)。PR 自检:
    grep -rE '@im\.wechat|ou_[a-f0-9]{16,}|sk-ant-[a-zA-Z0-9_-]{20,}|sk-[a-zA-Z0-9_-]{20,}|[0-9]{9,10}:[A-Za-z0-9_-]{35}' .
    
  • 测试隔离:所有测试通过 test-setup.tsFORGE_HUB_DIR 重定向到 /tmp
  • 热重载:仅开发模式(FORGE_HUB_DEV=1),生产环境需要重启 Hub

Read the full file on GitHub · 101 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. 3d ago First seen · 101 lines · 1,413 tokens per session scan A 510622aa1e60

Subscribe to this mod's changes

forge-hub CLAUDE.md is an instructions file published in the GitHub repository LinekForge/forge-hub (21 stars, last pushed 3mo ago), licensed MIT. It adds 1,413 tokens to every session, about $0.0071 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.