medharness: Instructions file for Codex

AGENTS.md

medharness AGENTS.md is an instructions file for Codex, OpenCode from charliehzm/medharness. It costs 896 tokens per session, scanned A, original, Apache-2.0.

A project instruction file for AI coding collaborators such as Codex and Claude Code. It explains how to join an existing project, what files to read, and which safety rules and handoff steps to follow.

In plain words
What is it for?
Use it to guide session startup, repository checks, compliance review, change planning, testing, release notes, and end-of-session handoff notes.
Why use it?
It prevents an assistant from treating a mature repository like a new project or skipping important project rules. It also makes work easier for the next collaborator to continue.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is charliehzm/medharness's own configuration. It tells Codex and OpenCode how to work on medharness 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 medharness configures →

Reuse

Borrowing it

Nothing to install: this file belongs to charliehzm/medharness. 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/charliehzm/medharness/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/charliehzm/medharness

Made for: Codex, OpenCode.

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 medharness AGENTS.md

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

agentmods 80×15 button for medharness AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/charliehzm/medharness/agents-md"><img src="https://agentmods.dev/badge/instructions/charliehzm/medharness/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 896 This file is loaded in full into every session.
When invoked 896 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.00896 $0.00896
Opus 5 $0.00448 $0.00448
Sonnet 5 $0.00179 $0.00179
Haiku 4.5 $0.00090 $0.00090

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

Security

Grade A, and why

medharness 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 11d 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.

AGENTS.md · 107 lines

What it actually says

AGENTS.md · 给所有 AI 协作者(codex / Claude Code / others)

Codex 自动加载本文件。Claude Code 自动加载 CLAUDE.md。 两份文件职责不同

  • CLAUDE.md 是"项目级 system context"(红线 + Skill 索引 + 拒绝行为)
  • AGENTS.md(本) 是"AI 协作者接手协议"(如何上岗、如何工作)

0. 你正在加入一个有历史的项目

不要把这当作新仓库。

这个项目:

  • 已经发布 v1.0.0(社区版首个稳定发布)
  • 已经有完整的 12 步 + 5 步双通道 SOP
  • 已经有 23 Skill / 8 MCP / 9 Hook 完整体系

你的任务不是从零设计,是接手并推进


1. 必读入口(5 分钟)

按顺序:

  1. HANDOFF.md ← 主入口,必先读
  2. CLAUDE.md ← 红线
  3. README.md ← 对外定位
  4. .memory/项目档案.md ← 项目身份(fork 后跑 customize.py)

读完跑:

git log --oneline -20 && git status
bash dryrun_e2e_v2.sh

2. 你的工作循环

每个会话开始

cat HANDOFF.md
git log --oneline -20

每条响应

  • 第一句话定位阶段(DEV / TEST / OPS)
  • 引用文件用 path:line 格式
  • 大改动先 plan,不直接 edit
  • 触及 PHI / 模型 / 审计 → 显式合规自检

每个会话结束

  • 更新 CHANGELOG.md(如有 release-worthy 改动)
  • 写交接 note(≤ 5 行)

3. 红线(任何会话适用)

  1. PHI 永不裸入 prompt
  2. 模型按 allowlist 路由
  3. 审计全量记录
  4. 测试数据合规(合成 + 指纹)
  5. License 永久 Apache 2.0 / CC BY-SA 4.0

CLAUDE.md §1


4. 升级路径

涉及 LEGAL / COMMS / PARTNER / COMMERCIAL / STRATEGY → 停手等人。 详 HANDOFF/07-escalation.md


5. 给 codex 的额外提示

如果你是 codex(OpenAI Codex / o1-codex / 类似):

  • 你可能默认 PR-first(直接提 PR)。但本项目先 plan、后改、再 PR
  • 你可能默认 self-merge。本项目永远不 self-merge(需 maintainer review)。
  • 你可能默认裁剪 context。本项目不要裁剪 .claude/skills/ / mcp/(这些是核心 IP)。
  • 你可能默认调云 LLM API。本项目所有 LLM 调用必经 mcp-model-router

如有冲突 → 以本项目约定为准。


6. 给 Claude Code 的额外提示

如果你是 Claude Code:

  • 优先读 CLAUDE.md(你已自动加载)
  • HANDOFF.md 是补充,不重复 CLAUDE.md
  • 用 Skill 系统:21 + 2 micro,已注册在 .claude/skills/
  • 用 Sub-agent:6 个,已注册在 .claude/sub_agents/
  • Hook 已在 .claude/settings.json 配好(warn 默认)

7. 一句话

像守墓人一样守护,像园丁一样照料,像建筑师一样推进。

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. 11d ago First seen · 107 lines · 896 tokens per session scan A 62de5871db78

Subscribe to this mod's changes

medharness AGENTS.md is an instructions file published in the GitHub repository charliehzm/medharness (86 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 896 tokens to every session, about $0.0045 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.

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

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 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