harness-lab: Instructions file for Claude Code

AGENTS.md

harness-lab AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from Joe-rq/harness-lab. It costs 2,895 tokens per session, scanned A, original, MIT.

A project-governance template for guiding people or AI agents through requirements, design, review, testing, release, and handover. It is not an application framework and leaves the business logic and technology choices to each project.

In plain words
What is it for?
Use it to structure software work with requirement records, session-start checks, progress handovers, review, quality assurance, and release steps.
Why use it?
It provides a shared way to organise work and project knowledge instead of relying on informal conversation, while making its single-user and collaboration limits clear.

Instructions file for Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: SessionStart hook event, but also the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is Joe-rq/harness-lab's own configuration. It tells Claude Code, Codex and OpenCode how to work on harness-lab 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 harness-lab configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Joe-rq/harness-lab. 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/Joe-rq/harness-lab/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/Joe-rq/harness-lab

Made for: Claude Code, 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 harness-lab AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/joe-rq/harness-lab/agents-md"><img src="https://agentmods.dev/badge/instructions/joe-rq/harness-lab/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,895 This file is loaded in full into every session.
When invoked 2,895 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.02895 $0.02895
Opus 5.5 $0.01158 $0.01158
Sonnet 5.5 $0.00579 $0.00579
Haiku 4.5 $0.00290 $0.00290

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

Security

Grade A, and why

harness-lab 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 1mo 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 · 239 lines

How it starts

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

AGENTS.md

Harness Lab 是一个 研发治理层模板,不是业务运行时框架。

它的目标是让任何接手该仓库的人或 agent,都能按一致的入口、状态和交付物推进工作,而不是依赖口头上下文。

项目定位

本仓库固定的是治理协议,不固定的是业务实现。

固定内容:

  • REQ 生命周期
  • 设计、评审、QA、发布的交付物
  • 索引优先的上下文加载顺序
  • 进度交接和经验沉淀机制
  • 会话启动协议和实施前检查点
  • SessionStart hook 强制机制

由目标项目自己决定的内容:

  • 技术栈
  • 目录结构
  • 架构分层
  • 测试、构建、发布命令
  • 领域规则和安全边界

已知限制

单用户设计:本框架面向个人开发者,不具备以下能力:

  • 多租户/权限系统
  • 并发控制(多人同时操作会导致数据丢失)
  • 认证机制
  • 审计日志

如需团队协作场景,请考虑使用 Linear、Jira 等成熟的项目管理工具。

目录导航

.
├── AGENTS.md
├── CLAUDE.md
├── context/
│   ├── business/
│   ├── tech/
│   ├── experience/
│   ├── invariants/
│   └── references/
├── docs/
│   ├── plans/
│   └── specs/
├── requirements/
│   ├── INDEX.md
│   ├── REQ_TEMPLATE.md
│   ├── in-progress/
│   ├── completed/
│   └── reports/
├── scripts/
│   ├── session-start.js      # 会话启动脚本
│   ├── req-check.js          # PreToolUse REQ 检查
│   └── req-cli.mjs           # REQ 生命周期 CLI
├── skills/
│   ├── README.md
│   ├── plan/
│   ├── review/
│   ├── qa/
│   └── ship/
└── .claude/
    ├── progress.txt
    └── settings.example.json  # hook 配置示例

强制机制

1. SessionStart Hook

为确保治理协议被执行,建议配置 SessionStart hook:

  1. 复制 .claude/settings.example.json 到 .claude/settings.local.json
  2. 确保 scripts/session-start.js 可执行(Windows 下无需 chmod)
  3. 新会话开始时会自动显示当前 REQ 状态

状态语义契约(唯一真相源):

  • 机器状态的唯一真相源是事件账本(.claude/events/*.jsonl、.claude/worktrees/*/events/*.jsonl)。会话启动只渲染 buildProgressProjection() 的投影结果,不解析任何手写文件来推导状态。
  • Current phase 只有一个语义:当前活跃 REQ 所处的阶段。无活跃 REQ 即 idle;"被阻塞"由搁置列表(suspendedReqs)表达,不复用 phase。
  • Last updated 只由工作事件更新。session_started / session_ended 只表示会话开关,不改变它——打开会话不等于有进展。
  • "最近事件"是流水窗口(最近 8 条 / 共 N 条),只说明最近发生了什么,不等于当前状态。
  • .claude/progress.txt 不参与状态判定:CLI 会在 create/start/block/complete 时改写其头部字段,其余内容是人的笔记。会话启动把该文件原文照登(含其 Current phase: 等行),仅供人阅读,不作为机器状态。

2. PreToolUse Hook

在 Write/Edit/NotebookEdit 操作与 Bash 写命令前强制检查 REQ 状态与写入范围:

触发条件:Write / Edit / NotebookEdit / Bash 写命令(纯读如 ls/grep/cat 放行)
检查内容:
  1. 当前是否有活跃 REQ
  2. REQ 是否有实际内容(非模板状态)
  3. REQ 状态是否为 draft
  4. 写入文件是否超出当前 REQ 的 Scope Control / 只读边界
输出:如无活跃 REQ、REQ 为模板状态或写入越界,输出阻断信息并拒绝操作
行为:硬阻断,必须先创建并填写 REQ 或使用豁免机制

Read the full file on GitHub · 239 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. 1mo ago Changed · +15 lines · +721 tokens per session 27f19aba6171
  2. 2mo ago First seen · 224 lines · 2,174 tokens per session scan A 1095376cbee2

Subscribe to this mod's changes

harness-lab AGENTS.md is an instructions file published in the GitHub repository Joe-rq/harness-lab (23 stars, last pushed 1mo ago), licensed MIT. It adds 2,895 tokens to every session, about $0.0116 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

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).

microsoft/vscode · 9,715 tokens

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,461 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

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).

microsoft/vscode · 2,750 tokens

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.

denoland/deno · 3,077 tokens