harness-scope

harness-scope is a command for Claude Code from hahaxiang27/FlowHarness. It costs 30 tokens per session (2,935 once invoked), scanned A, original, MIT.

A workflow that creates a boundary statement for a development sprint, listing what is included, excluded, and constrained by dependencies. A sprint is a planned period of focused development work.

In plain words
What is it for?
Use it to define the boundaries of a sprint from its plan, project rules, feature plan, and existing module structure.
Why use it?
It makes the limits of the work explicit, reducing scope creep and giving later reviews a clear reference point.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions CLAUDE.md; mentions subagents.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/hahaxiang27/flowharness/harness.scope
Clone the repo
git clone --depth 1 https://github.com/hahaxiang27/FlowHarness

Made for: Claude Code.

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-scope

README.md
[![agentmods](https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.scope.svg)](https://agentmods.dev/commands/hahaxiang27/flowharness/harness.scope)
Your own site
<a href="https://agentmods.dev/commands/hahaxiang27/flowharness/harness.scope"><img src="https://agentmods.dev/badge/commands/hahaxiang27/flowharness/harness.scope.svg" alt="Measured on agentmods" height="20"></a>
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,935 The whole file, excluding the scripts and references it only reads on demand.
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.00030 $0.02935
Opus 5 $0.00015 $0.01468
Sonnet 5 $0.00006 $0.00587
Haiku 4.5 $0.00003 $0.00294

Measured 5d ago against content hash ea3f10f2a580, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

harness-scope 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 5d 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.

commands/harness.scope.md · 250 lines

How it starts

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

Harness Scope 声明生成

关联 Constitution 原则 XI · 模块边界纪律。

上下文管理: 保持当前上下文(需要 CLAUDE.md / spec / plan 多处对照)

指令

为当前 Sprint 生成 .harness/scope/sprint-<N>.yaml,作为 boundary-reviewer 的输入和 evaluator L2.4 的对照标的。

读取以下文件:

  1. .harness/scope/_template.yaml — scope schema 模板
  2. CLAUDE.md(项目根)— 已有的"焦点 / 出范围"叙述(如存在)
  3. .harness/sprints/sprint-<N>.md — 当前 Sprint 计划
  4. specs/[FEATURE_ID]/plan.md — 本 feature 的 Project Structure 段(如存在)
  5. .harness/prompts/boundary-reviewer.md — 用于 discovery 模式调用

输入参数(用户可选提供)

  • Sprint 编号: $ARGUMENTS 或从 .harness/sprints/ 推断当前最新 Sprint
  • 模式: --interactive 强制走交互问答;不传时按"自动推断 → 用户确认"流程

执行步骤

Step 1 · 推断 Sprint 编号 + 当前 Feature
  • Sprint N: 用户参数 → 否则从 .harness/sprints/sprint-*.md 取最大值
  • Feature ID: 从 sprint-N.md 的目标段或当前分支名解析
  • 若文件缺失或冲突 → 报错并要求用户传 Sprint 编号
Step 2 · 自动收集机械字段

按项目现有结构探测模块命名空间或源码根:

  1. 优先读取 specs/[FEATURE_ID]/plan.md 的 Project Structure / Source Code 段
  2. 其次读取项目现有构建、包管理或模块声明文件
  3. 再从 [SOURCE_ROOT] 下的顶级目录、路径别名或命名空间声明推断最长公共前缀
  4. 探测失败 → 交互问用户:"本项目用于边界扫描的模块路径前缀是什么?"

dependency_rulesmetadata 直接从 _template.yaml 复制默认值,不修改。

Step 3 · 推断 in_scope / out_of_scope(按优先级三选一)

优先级 A · CLAUDE.md 已有的"焦点/出范围"表(最优)

如果 CLAUDE.md 包含形如下表的段落("焦点" / "Sprint 焦点" / "in-scope" 等关键词触发):

| 模块 | 文件数 | 出范围理由 |
|---|---|---|
| `[MODULE_A]` | 126 | 本 Sprint 不投入 |
| `[MODULE_B]` | 17 | 非当前 [FEATURE_ID] 范围 |

→ 直接 lift 到 yaml:

  • 列在表中的模块 → out_of_scopereason 取自该列
  • CLAUDE.md 文中提到"焦点 N 模块"且明确列出的 → in_scope
  • 其余在源码树中存在但 CLAUDE.md 未提及的模块 → 列入 unclassified,第 4 步交互确认

优先级 B · spec + plan 推断(次优)

如果 CLAUDE.md 没有这张表:

  • specs/[FEATURE_ID]/plan.md 的 Project Structure / Source Code 段,列出本 feature 涉及的模块 → in_scope
  • [SOURCE_ROOT] 下的所有顶级模块,未列入 in_scope 的默认入 out_of_scopereason: "本 feature plan 未涉及"
  • 这种情况准确度中等,必须 100% 走 Step 4 用户确认

优先级 C · 交互问答兜底

如果 A 和 B 都不可用:

  1. 列出 [SOURCE_ROOT] 下所有顶级模块及文件数
  2. 问:"本 Sprint 主要在哪几个模块写代码?(输入逗号分隔模块 id 或路径)" → in_scope
  3. 问:"剩余 N 个模块默认归 out_of_scope(保留不投入),有要例外的吗?" → 调整
  4. 对每个 out_of_scope 模块问一句 reason(可批量复用:"非当前 [FEATURE_ID] 范围" 等)

Read the full file on GitHub · 250 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. 5d ago First seen · 250 lines · 30 tokens per session scan A ea3f10f2a580

Subscribe to this mod's changes

harness-scope is a command published in the GitHub repository hahaxiang27/FlowHarness (4 stars, last pushed 2mo ago), licensed MIT. It adds 30 tokens to every session and 2,935 once invoked, about $0.0002 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-31.