Borrowing it
Nothing to install: this file belongs to atomgit-atomcode/atomcode. 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/atomgit-atomcode/atomcode/main/AGENTS.mdgit clone --depth 1 https://github.com/atomgit-atomcode/atomcodeWrote 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/atomgit-atomcode/atomcode/agents-md)<a href="https://agentmods.dev/instructions/atomgit-atomcode/atomcode/agents-md"><img src="https://agentmods.dev/badge/instructions/atomgit-atomcode/atomcode/agents-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/atomgit-atomcode/atomcode/agents-md"><img src="https://agentmods.dev/badge/instructions/atomgit-atomcode/atomcode/agents-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.04932 | $0.04932 |
| Opus 5.5 | $0.01973 | $0.01973 |
| Sonnet 5.5 | $0.00986 | $0.00986 |
| Haiku 4.5 | $0.00493 | $0.00493 |
Grade A, and why
atomcode AGENTS.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 4d 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 — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.
项目全局开发约束
适用范围与使用方式
本文件记录当前架构边界和长期开发约束,不再承担历史迁移进度报告的职责。历史方案、旧基线和已完成的 bridge 退役过程应留在 docs/,不得继续作为当前实现前提。
涉及以下范围时,设计或修改前必须先核对当前代码、调用方和近期 Git 历史:
crates/atomcode-kernel/;crates/atomcode-capabilities/;crates/atomcode-coding/的 runtime、provider、session、controller;- CLI、TUI、daemon、ACP 的 runtime、session、command/event 接入;
- daemon 中保留的历史 core JSON 单向 importer 与兼容 DTO;
- 公共协议、持久化格式、审批、安全边界或跨 crate 依赖方向。
本文件描述的是约束,不是永远正确的现状快照。若约束中的事实与当前代码冲突,以当前代码为准;先说明差异,再修正文档或实现,不得按旧路径盲目补代码。
当前架构事实
当前 coding agent 的目标调用链是:
CLI / TUI / daemon / background / ACP code
│
▼
CodingRuntimeHandle / DriverCommand
│
▼
CodingRuntime
│
▼
atomcode-kernel Agent
CodingRuntime是 coding agent 的运行时所有者;driver 不应重新持有或重建第二套 live agent 生命周期。- kernel
AgentCommand/AgentEvent是运行时执行边界。coding 产品 driver 应使用CodingRuntime;其他业务 driver 可以驱动其 L2 已装配的 kernel agent,但不得另建第二生命周期 owner,也不得把 provider、session、cd、goal、loop 等 coding 生命周期重新塞进 kernel 命令。 - core legacy
AgentClient/AgentCommand/AgentEvent、v1 engine 和atomcode-bridge已退役。不得重新引入 bridge、双 endpoint、v1/v2 选择开关或 core driver fallback。 atomcode-kernel、atomcode-capabilities、atomcode-coding的生产依赖必须保持 core-free;尤其禁止 capabilities 反向依赖 core、L2 或前端。- native
SessionManager是唯一 session 存储(SessionMeta索引、PresentationFile等旁挂);会话内容是 kernelsession词汇的事件日志,SessionSnapshot只是它的投影读法(见下一条与 0024);core session 模块与持久化 API 已退役。历史 core JSON 只允许由 daemon 私有 DTO 单向导入,禁止恢复 legacy writer、core 磁盘投影或双向持久化转换。 atomcode-corecrate 已从 workspace 删除;生产代码不得重新依赖或重建同名兼容层。历史 core JSON 只由 daemon 私有 DTO 单向导入。- coding 的装配只有一套:
parts::prepare建能力图,runtime::mount挂成 plexus 行清单(on_harness+host_rows)。手写的 kernel 中间件/钩子链(parts::assemble/build_coding_agent)与ATOMCODE_ENGINE开关已删除,不得重建第二套装配或引擎选择开关。链式当年的事件流录在crates/atomcode-coding/tests/golden/differential/,差分台对着它回归;那些 golden 不可重录(录它的引擎已经没了),要改就改文件本身并在 commit 里说明理由。 - coding runtime 里会话的唯一权威是 harness 事件日志(
docs/adr/0024-the-session-log-is-the-authority.md):SessionManager存事件格式会话——<id>.events(头一行 + 每条事实{seq, at, event},流式片段不落盘)与<id>.index(元数据,提交点),旁挂.ui/.rewind/.rewind.txn/.todos;文件名一律避开已发布版本扫描的后缀,回滚不会读到半个会话。日志由 coding 的session-store行(coding/src/session_store.rs,host 把它 swap 进session-persistence-jsonl的位置,排在建 agent 的行之前)在 runtime 持有的租约下逐条同步追加,第一次写失败即停(上报 uncertain commit,runtime fail-close),之后一条都不再写;session-native的 resume 就是重放这份日志,不得回退到快照或任何别的来源。撤销 / rewind / 恢复是追加事实(Rewound,目标不是已有前缀时整段撤回再提交目标对话,SessionManager::append_conversation_change),不重写日志;唯一的例外是重建失败时回滚自己刚追加、尚无 agent 读过的那段(truncate_events)。已发布版本存成快照的会话在打开时读时转换一次(open_for_resume/open_as_events),旧文件加.migrated挪开、不删。SnapshotHook/TranscriptHook对事件会话只写索引与旁挂,不写快照与 transcript。harness 自己的 JSONL 行在本产品里关闭;sessions/harness/下的旧 journal 不读。- 读者:recall /
/worklog用events::turn_records从日志折出每回合记录(撤回的回合标undone),网页历史读日志里的回合时间,Claude Code hooks 的transcript_path指向<id>.events;TranscriptHook已删。daemon 的无状态撤销与压缩也是追加事实(plan_conversation_change),每回合统计按visible_turns取舍。人取消时半截回复是PartialReply事实。索引记format_version,比本构建新的会话在目录里标needs_newer_version、拒绝 resume;读到不认识的事件种类同样按「更新的版本」拒读。 - 团队成员与
task子 agent 的会话同样落盘:各是一个事件会话,存成storage_id(<lead>/<name>的/换成~),索引记parent,所以目录 / picker /--continue/ recall 都不列、单独打开被拒、删 lead 时连带删;session-store在 agent 创建时给它取一份自己的租约、移除时放掉,取不到就不让它运行。成员的创建参数在日志头member里,stop等成员空闲后提交Stopped再移除;resume lead 时 team 行按children(lead)把没有Stopped的成员带回(角色按当前定义重算)。判据:harness/tests/team.rs的a_resumed_lead_brings_back_the_members_it_did_not_stop等、coding/tests/runtime_criteria.rs::a_team_is_kept_and_comes_back_with_its_lead、capabilities的a_delegated_session_is_kept_under_its_parent。
- 读者:recall /
describe_self告诉模型的每一句都由实现那件事的行(或读 patch/flag 的启动器)经self_knowledge::describes/describes_live登记,self_knowledge自己不假定挂了哪些行、不替任何领域开专用注册表。替换掉一行(swap/disable)就要接过它该说的话:session-native描述原生会话、skills-host/mcp-host描述 SKILLS/MCP、model行描述/model都是这么来的。工具自己的description()每次请求都会发给模型,不要再为工具往describe_self里写第二份;describe_self只补工具描述覆盖不到的:会话、人如何添加/配置能力、前端命令、配置文件(身份已在系统提示里由 persona 行说,不重复)。config.toml 的说明写在读它的代码旁边(coding/src/config.rs::describe_config_file,由config-file行登记;可安全编辑的设置目录由atomcode_config::settings::describe_catalog渲染)。判据在harness/tests/self_knowledge.rs与coding/tests/runtime_criteria.rs的the_agent_is_told_where_its_session_really_is、a_capability_the_runtime_mounts_itself_still_describes_itself、a_runtime_configured_from_a_file_describes_the_file。- 凭据(API key、token)绝不进入行配置:配置树是可打印的数据(
dump_runtime原样渲染每行 config),也绝不进入describe_self的任何回答。需要凭据的行由宿主注册一个持有凭据的插件实例并swap过去(tool-web-keyed是范例)。判据coding/tests/mount_wiring.rs::a_configured_credential_never_enters_the_config_tree。 - 产品目录是宿主交进来的数据:库(kernel/capabilities/coding/harness 行/review/auth/codingplan/tui)不写
.atomcode字面量、不读ATOMCODE_HOME,只收atomcode_capabilities::ProductDirs(或从它取出的目录);harness 行经product-dirs缝取(atomcode_harness::product_dirs(ctx))。解析环境只在宿主:atomcode_coding::config::product_dirs_from_env()。名字只在atomcode-config/src/distribution.rs写一次,gates/product-dir.sh基线为 0。判据coding/tests/runtime_criteria.rs::a_runtime_under_another_name_keeps_to_its_own_dirs。 - daemon/TUI 的 live/provider/UI 投影必须直接使用 kernel/coding 中立类型;持久化读取必须先得到严格 native 聚合。不得借转换层恢复旧 engine 命令、第二 runtime owner、core session 磁盘模型或静默 fallback。
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.
- 4d ago Changed · -80 lines · -2,907 tokens per session 0eca7efd6278
- 25d ago Changed · +109 lines · +5,315 tokens per session 8967d174e5e6
- 1mo ago Changed · +3 lines · +228 tokens per session 7af8cd95f96e
- 1mo ago First seen · 124 lines · 2,296 tokens per session scan A 6561acc7978d
atomcode AGENTS.md is an instructions file published in the GitHub repository atomgit-atomcode/atomcode (206 stars, last pushed today), licensed MIT. It adds 4,932 tokens to every session, about $0.0197 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.
Other instructions, from other repositories
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).
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.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).
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.
vscode copilot-instructions.md
Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).
deno copilot-instructions.md
Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.