hunch AGENTS.md

Repository instructions for Hunch, an engineering-memory system that stores past decisions, bug history, constraints, components, and policies. They explain which Hunch queries to use while working in the repository.

In plain words
What is it for?
Use them at the start of a task to find relevant context, repository structure, and proven runbooks. They also help check constraints, review escalated decisions, and record or apply engineering knowledge.
Why use it?
They help coding agents preserve the reasons behind existing code instead of relying only on files or personal memory. They also identify decisions that require a human answer.

Instructions file for CodexOpenCode

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 instructions/davesheffer/hunch/agents-md
Clone the repo
git clone --depth 1 https://github.com/davesheffer/hunch

Made for: Codex, OpenCode.

Per session 1,510 This file is loaded in full into every session.
When invoked 1,510 The same file โ€” it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 98% copy Near-identical to another mod 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 $0.01510 $0.01510
Opus 5 $0.00755 $0.00755
Sonnet 5 $0.00302 $0.00302
Haiku 4.5 $0.00151 $0.00151

Measured 2d ago against content hash 693c4071f8a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

hunch 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 2d 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.

Origin

This is a copy

98% identical to hunch copilot-instructions.md โ€” 2 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

AGENTS.md ยท 55 lines

How it starts

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

AGENTS.md

๐Ÿง  Hunch (Engineering Memory)

This repo has Hunch โ€” a curated graph of why the code is the way it is (decisions, bug history, invariants). It currently holds 193 decisions, 2 bugs, 10 constraints, 19 components, 3 policies, 1 open findings.

Consult Hunch via the hunch_* MCP tools โ€” pick by MOMENT, not from memory:

Orient (session/task start):

  • hunch_context(target) โ€” the minimal relevant slice for what you're about to do; a task phrase falls back to the closest graph matches. Call FIRST.
  • hunch_structure(target?) โ€” the indexed shape of the repo/dir/file/symbol โ€” orient from the graph, not grep rounds.
  • hunch_runbook(task) โ€” the proven steps for a recurring task, before re-deriving them.
  • hunch_escalations() โ€” the decisions only the HUMAN can make (including one exact imported ADR at a time, topic conflicts, and policy calls). Normally empty; when it isn't, ASK the user inline โ€” an entry is a question, silence is never approval. Apply an ADR answer only through hunch_review_imported_adr with its printed source and review hashes.
  • hunch now (CLI) โ€” recent decisions + the live roadmap; hunch log โ€” the memory-move timeline (every capture/adopt/supersede/prune/repair, each revertable).

Before designing / choosing an approach:

  • hunch_why(target) โ€” why a file/symbol is shaped this way (decisions, bugs, constraints) โ€” including what was already REJECTED.
  • hunch_current_decision(topic) โ€” the one live answer for a topic (history + rejected included).
  • hunch_bug_lineage(symptom_or_symbol) โ€” has this failed before? what was the root cause?
  • hunch_compare(candidates) โ€” rank candidate branches/commits by fewest invariant hits.
  • hunch_query(query) โ€” free-text search when nothing above fits.

Before editing:

  • hunch_check_constraints(scope) and hunch_get_dependents(symbol) / hunch_blast_radius(target) โ€” invariants in scope + who you'd break. (The pre-edit hook injects this per file automatically; call these for PLANNING breadth.)
  • hunch_findings(scope?) โ€” known-but-unfixed gaps in the area (past audits, measurements, incidents) so you inherit them instead of re-discovering them.

Read the full file on GitHub ยท 55 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. 2d ago First seen ยท 55 lines ยท 1,510 tokens per session scan A 693c4071f8a8

Subscribe to this mod's changes

hunch AGENTS.md is an instructions file published in the GitHub repository davesheffer/hunch (6 stars, last pushed 2d ago), licensed Apache-2.0. It adds 1,510 tokens to every session, about $0.0076 per session on Opus 5. A static security scan graded it A with 0 findings. It is 98% identical to hunch copilot-instructions.md, differing in 2 lines, and is treated as a copy.