Borrowing it
Nothing to install: this file belongs to Yapie0/carboncode. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/Yapie0/carboncode/main/CLAUDE.mdgit clone --depth 1 https://github.com/Yapie0/carboncodeWrote 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.
[](https://agentmods.dev/instructions/yapie0/carboncode/claude-md)<a href="https://agentmods.dev/instructions/yapie0/carboncode/claude-md"><img src="https://agentmods.dev/badge/instructions/yapie0/carboncode/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.
<a href="https://agentmods.dev/instructions/yapie0/carboncode/claude-md"><img src="https://agentmods.dev/badge/instructions/yapie0/carboncode/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02028 | $0.02028 |
| Opus 5.5 | $0.00811 | $0.00811 |
| Sonnet 5.5 | $0.00406 | $0.00406 |
| Haiku 4.5 | $0.00203 | $0.00203 |
Grade A, and why
carboncode 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.
How it starts
The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
Carbon Code is a Chinese-first, DeepSeek-native terminal coding agent (@carboncode/cli, bins carboncode / ccode), derived from DeepSeek-Reasonix and productized for personal developer workflows. Architecture is opinionated around three pillars: immutable prefix caching, tool-call repair, and tiered flash→pro cost control.
Canonical rules (authoritative — follow these)
AGENTS.md— project rules, PR merge principles, naming/scope, license/attribution. Read before any non-trivial change.CARBON.md— working knowledge: stack, commands, product rules, watch points.- The agent itself loads project rules from
AGENTS.mdthenCARBON.md(read priority order insrc/memory/project.ts:AGENTS.md→CARBON.md→ legacyREASONIX.md→AGENT.md; the legacy two are read-only fallbacks and are not present in this repo).
This file complements those two with an architecture map of src/. It does not restate their rules.
Dev workflow
Node 22+, ESM ("type": "module"). Scripts:
npm run build— tsup +scripts/copy-dashboard-vendor-css.mjs(library + CLI + dashboard bundles, then dashboard CSS copy)npm run dev—tsx src/cli/index.ts(no subcommand);npm run chat—tsx src/cli/index.ts chatnpm run test/npm run test:watch/npm run test:coverage— Vitestnpm run test:mutation— Stryker on load-bearing modules (loop, context-manager, core, shell, plan, repair)npm run lint/npm run lint:fix/npm run format— Biome oversrc testsnpm run typecheck—tsc --noEmitfor src andtsc --noEmit -p dashboardnpm run verify— build + lint + typecheck + test in one shot
Run npm run verify before claiming work is done. Git hooks (simple-git-hooks): pre-commit lint, pre-push verify.
Architecture map (src/)
- CLI & commands —
src/cli/index.ts(entry; importscli/heap-limit-launch.tsFIRST for heap re-exec), Commander program, lazy-importedsrc/cli/commands/*. Top-level commands: setup, code, chat, run, acp, desktop (internal JSON-RPC for the desktop client), stats, doctor, commit, sessions, prune-sessions, events, replay, diff, mcp (list/search/install/browse/inspect), version, update, index. Interactive modes use Ink;src/cli/ui/App.tsxis the main TUI (~4.5k lines).src/cli/resolve.tsresolves precedence (per-setting flag >--preset> config.preset >auto). - Agent engine —
src/loop.tsCacheFirstLoop.step(input)is the turn loop (AsyncGenerator ofLoopEvent);src/loop/*(types, escalation, healing, messages, force-summary, thinking, env),src/context-manager.ts(fold/force-summary/preflight thresholds 50/70/80/95% of ctxMax),src/memory/runtime.ts(ImmutablePrefix + AppendOnlyLog + VolatileScratch),src/frame/(TUI grid primitives — fixed-width cell/row frames),src/core/(events, inflight, pause-gate, pause-policy, reducers, event-redaction, eventize). - Repair —
src/repair/(index.tsorchestrates scavenge → truncation → storm passes for malformed DeepSeek tool calls;flatten.tsschema flatten runs at loop construction). - Tools —
src/tools.ts(ToolRegistryregister/dispatch, plan-mode enforcement, schema flatten/re-nest, result post-processing),src/tools/*(filesystem, shell, shell-chain, web, memory, plan/plan-core, subagent, skills, choice, todo, scaffold, jobs),src/tools/fs/(edit with LCS diff, patch, glob, outline, search),src/tools/shell/parse.ts(allowlist) +exec.ts. Cross-cutting:src/hooks.ts,src/skills.ts,src/at-mentions.ts,src/at-mentions-url.ts. - Model client / net —
src/client.ts(DeepSeekClient: undici SSE streaming, ~11-min (660s) timeout, retry, cache-token usage),src/retry.ts,src/tokenizer.ts(encode-only V4 tokenizer,data/deepseek-tokenizer.json.gz),src/net/proxy.ts,src/adapters/(JSONL event sink/source),src/ports/(ModelClient/MemoryStore/CheckpointStore/EventSink/HookRunner/ToolHost interfaces). - Config / env —
src/config.ts(~/.carboncode/config.json, API key bridge, presets, project permissions, sensitive-path config, MCP),src/env.ts,src/workspaces.ts,src/frontmatter.ts,src/gitignore.ts. - Context / memory / transcript —
src/memory/(session JSONL persistence, user/project/subdir memory, runtime prefix),src/session-title.ts,src/transcript/(log/replay/diff). Sessions/data live under~/.carboncode/sessions/,~/.carboncode/memory/{global,<projectHash>}/. - Semantic index —
src/index/semantic/(builder, store JSONL append-only + linear cosine scan, embedding via Ollama/OpenAI-compat, chunker, tool, ollama-launcher, preflight),src/index/config.ts. Complements lexical grep. - i18n —
src/i18n/(index.tst()/tObj(),types.tsschema,zh-CN.tsprimary,EN.tsfallback). Chinese is first-class; English is fallback only. - Integration surfaces —
src/mcp/(client + stdio/SSE/streamable-http transports, registry, spec, catalog, reconnect, latency),src/acp/(Agent Client Protocol over stdio: server/protocol/dispatch/gates),src/qq/(QQ bot WebSocket channel + access control),src/server/(loopback dashboard HTTP +api/*routes). - Telemetry —
src/telemetry/(usage JSONL at~/.carboncode/usage.jsonl, pricing/stats, subagent distillation). Local-only, no network calls. - Library barrel —
src/index.tsre-exports the public API.
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.
- 2mo ago First seen · 56 lines · 2,028 tokens per session scan A e6bcbf1e1603
carboncode CLAUDE.md is an instructions file published in the GitHub repository Yapie0/carboncode (199 stars, last pushed 2mo ago), licensed MIT. It adds 2,028 tokens to every session, about $0.0081 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.
carboncode CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| carboncode CLAUDE.mdYapie0/carboncode | Instructions file | 199 | 2mo ago | MIT | A | 2,028 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 275k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |