forks: Instructions file for Claude Code

CLAUDE.md

forks CLAUDE.md is an instructions file for Claude Code from cicbyte/forks. It costs 1,385 tokens per session, scanned A, original, MIT.

A set of instructions for working on Forks, a Git repository manager with a web interface for local GitHub copies, written in Chinese.

In plain words
What is it for?
Use it when building, running, linting, formatting, or changing the Go and Vue parts of Forks.
Why use it?
It gives an agent the project background, build commands, configuration settings, and folder structure needed to work in the repository.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is cicbyte/forks's own configuration. It tells Claude Code how to work on forks 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 forks configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cicbyte/forks. 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/cicbyte/forks/master/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/cicbyte/forks

Made for: Claude Code.

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 forks CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/cicbyte/forks/claude-md/github.svg)](https://agentmods.dev/instructions/cicbyte/forks/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/cicbyte/forks/claude-md"><img src="https://agentmods.dev/badge/instructions/cicbyte/forks/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 forks CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/cicbyte/forks/claude-md"><img src="https://agentmods.dev/badge/instructions/cicbyte/forks/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,385 This file is loaded in full into every session.
When invoked 1,385 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.01385 $0.01385
Opus 5.5 $0.00554 $0.00554
Sonnet 5.5 $0.00277 $0.00277
Haiku 4.5 $0.00138 $0.00138

Measured 2mo ago against content hash 5217830bf507, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

forks 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 2mo 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 · 112 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

项目概述

Forks 是一个 Git 仓库管理工具,提供 Web UI 管理本地克隆的 GitHub 仓库。后端 Go + Gin,前端 Vue 3 + Naive UI,前后端分离,前端通过 //go:embed web/dist 嵌入到 Go 二进制中。

构建与运行

后端:

go build -o forks        # 构建
./forks serve             # 启动服务 (默认 :8080)
./forks serve -p 9090     # 指定端口
./forks serve --token xxx # 启用 Bearer Token 认证

环境变量配置:

  • FORKS_PORT — 服务端口(优先级低于 -p 参数,默认 8080)
  • FORKS_ADDRESS — 监听地址(默认 0.0.0.0)
  • FORKS_HOME — 数据目录(默认 ~/.forks/)
  • FORKS_REPO_PATH — 仓库存储路径

首次运行会交互式要求输入仓库存储路径,数据保存在 ~/.cicbyte/forks/。

前端:

cd web
npm install
npm run dev       # 开发服务器 (localhost:3000)
npm run build     # 构建到 web/dist/
npm run lint      # ESLint 检查
npm run format    # Prettier 格式化

前端构建后需要重新 go build 才能将新前端嵌入二进制。

Node 要求: ^20.19.0 || >=22.12.0

架构

main.go              → 入口,embed web/dist 资源
├── cmd/
│   ├── root.go      → Cobra 根命令,DB/日志初始化,建表
│   └── serve.go     → 所有 HTTP 路由和业务逻辑(Gin)
├── common/           → 全局变量(Db, LogFile)
├── models/           → 数据结构(GitRepoInfo, ProxyConfig, GitPlusConfig)
├── utils/            → 配置路径管理、GitHub API、JSON 工具、分页
├── assets/           → 嵌入资源桥接
└── web/              → Vue 3 前端 SPA
    └── src/
        ├── api/         → Axios API 调用
        ├── views/       → 页面组件
        ├── components/  → 通用组件
        ├── stores/      → Pinia 状态管理
        └── router/      → Vue Router

关键设计决策

  • serve.go 是单体路由文件:所有 API 路由、SSE 事件流、业务逻辑都在 cmd/serve.go 中(约 3700+ 行),没有分层 controller/service。
  • SQLite 数据库:使用 go-sqlite3(需 CGO),表结构在 cmd/root.go 中通过 CREATE TABLE IF NOT EXISTS 创建,字段变更通过 ALTER TABLE ADD COLUMN 兼容旧数据。
  • SSE 实时推送:长时间操作(clone、pull、reset、scan、batch-clone)通过 SSE 推送进度,使用临时 token 认证。
  • Git Smart HTTP:通过 git-upload-pack --stateless-rpc 实现只读镜像克隆,路径 /git/{source}/{author}/{repo}.git。Docker 环境需 git config --global --add safe.directory '*'。
  • 代理支持:运行时代理配置存储在内存中(currentProxyConfig),支持 HTTP/SOCKS5,Git 命令和 GitHub API 调用都走代理。
  • GitHub API:通过 utils/github.go 获取仓库元信息(stars、forks、topics 等),未使用 SDK,直接 HTTP 请求 GitHub REST API。
  • 剪贴板兼容:web/src/utils/clipboard.js 统一封装,优先 navigator.clipboard,fallback 到 execCommand('copy') 兼容 HTTP 环境。

Read the full file on GitHub · 112 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. 2mo ago First seen · 112 lines · 1,385 tokens per session scan A 5217830bf507

Subscribe to this mod's changes

forks CLAUDE.md is an instructions file published in the GitHub repository cicbyte/forks (11 stars, last pushed 6mo ago), licensed MIT. It adds 1,385 tokens to every session, about $0.0055 per session on Opus 5.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.

Related

forks CLAUDE.md compared with instructions from other repositories

forks CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
forks CLAUDE.mdcicbyte/forksInstructions file116mo agoMITA1,385Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode