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,174 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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,174 This file is loaded in full into every session.
When invoked 2,174 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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.02174 $0.02174
Opus 5 $0.01087 $0.01087
Sonnet 5 $0.00435 $0.00435
Haiku 4.5 $0.00217 $0.00217

Measured 6d ago against content hash 1095376cbee2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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 · 224 lines

How it starts

The opening of the file, as written. The whole thing — 224 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 状态

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 或使用豁免机制

不可强制边界(上游平台限制,npm run harness:doctor 会提示):subagent 工具调用不触发 PreToolUse(claude-code #21460 / #34692)、claude -p 非交互不触发(#40506)、perl -e / python -c 等解释器写(理论不可封)。剩余缺口靠 OS 级兜底(文件权限、容器化、CI 侧校验),详见 README「已知限制」。

补充说明

  • req:create 只负责创建骨架,不代表 REQ 已可实施
  • 只有补齐真实背景、目标、验收标准后,REQ 才能通过 hook 与 req:start

豁免机制

# 临时豁免(紧急修复、小改动)
touch .claude/.req-exempt

# 完成后删除
rm .claude/.req-exempt

Read the full file on GitHub · 224 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. 6d 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 (20 stars, last pushed 24d ago), licensed MIT. It adds 2,174 tokens to every session, about $0.0109 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,182 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

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

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