{
  "markdown": "# Hunch\n\n## Your repo remembers why — and teaches every coding agent how the project works.\n\n[![npm version](https://img.shields.io/npm/v/@davesheffer/hunch?color=2742ff&label=npm)](https://www.npmjs.com/package/@davesheffer/hunch)\n[![GitHub stars](https://img.shields.io/github/stars/davesheffer/hunch?color=2742ff&label=%E2%98%85%20star)](https://github.com/davesheffer/hunch)\n[![license](https://img.shields.io/npm/l/@davesheffer/hunch?color=2742ff)](LICENSE)\n\nEvery new AI coding session can read your code. It cannot automatically see why your team chose this design, which alternative already failed, what an odd-looking line protects, or how this repository expects work to be explained and reviewed.\n\nThat is how settled decisions get reopened, fixed bugs return, and technically plausible changes arrive feeling foreign to the project.\n\n**Hunch is evidence-backed deterministic project intelligence for the AI coding tools you already use.** It gives Claude, Codex, Cursor, Copilot, Windsurf, Antigravity and other MCP clients the same durable understanding of your codebase:\n\n- why the code is shaped this way;\n- how the repository communicates, reviews and builds;\n- what depends on the code about to change; and\n- which trusted decisions, fixes and architectural boundaries the result must preserve.\n\nFor precise rules your team has explicitly trusted, the promise is **Never Twice**: an agent may propose a different direction, but it cannot quietly re-make a decided decision or re-introduce a fixed failure without Hunch surfacing the conflict and its evidence.\n\nMemory starts advisory. Nothing blocks until a human deliberately trusts a precise rule and opts into strict enforcement.\n\n## Start in five minutes\n\nRequires Node 22.13+ and a Git repository.\n\n```bash\nnpm i -g @davesheffer/hunch\ncd your-repo\nhunch init\nhunch backfill --since 90d   # optional: seed memory from recent history\n```\n\nReload your coding assistant, then ask a normal question:\n\n> Why is this built this way?\n\n`hunch init` indexes the repository, installs local lifecycle hooks and connects supported assistants without replacing their existing configuration. The next session receives the relevant story with its sources, not a giant transcript or generic prompt wall.\n\nLifecycle coverage depends on the harness; MCP connectivity alone does not establish automatic grounding or enforcement.\n\nTo update Hunch and configured harness pins for the current repository:\n\n```sh\nhunch update\n```\n\nAgents receive an instruction to run this when you ask **“update Hunch”** in generated Hunch guidance. Restart active harnesses afterward.\n\nCheck integrations after upgrading Hunch or switching assistants:\n\n```sh\nhunch integrations check\nhunch integrations repair-pins\nhunch integrations check --harness claude --probe --require mcp\nhunch integrations check --harness codex --require context,edit-blocking\n```\n\nCapabilities are reported as **verified**, **advisory-only**, **unsupported** or **untested**. `--require` fails unless every named capability is verified.\n\nThe Codex integration currently supplies MCP and instructions, with no native lifecycle adapter. The opt-in `--probe` verifies a fresh MCP process, not whether an existing host session or model actually followed the memory.\n\nUse `hunch integrations check` in CI to prevent pin drift; add `--require` for capabilities your workflow cannot operate without.\n\n## One evidence loop, not another model\n\n```text\nGit history + ADRs + corrections + tests + repository conventions\n                              │\n                              ▼\n                  Hunch's evidence graph\n                 /            │             \\\n      engineering memory   Project DNA   reviewed landscape\n                 \\            │             /\n                              ▼\n             role-shaped, budgeted context delivery\n                              │\n                              ▼\n             Claude / Codex / Cursor / any MCP agent\n                              │\n                              ▼\n                  deterministic change receipt\n```\n\nHunch is not the agent and is not the workflow engine. The model thinks; Hunch holds deterministic, evidence-backed state about the project and validates what must remain true.\n\n## What Hunch understands\n\n| Layer | What it adds |\n| --- | --- |\n| **Engineering Memory** | Decisions, rejected alternatives, corrections, bug lineage, findings and rationale a future session would otherwise miss. |\n| **Code Graph** | Symbols, calls, imports, dependencies, components, blast radius and architectural reachability across supported languages/configuration. Memory itself works with any language. |\n| **Project DNA** | Revision-specific, evidence-backed observations about how a repository communicates and works: vocabulary, contribution habits, review expectations, engineering conventions and culture. |\n| **Engineering Landscape** | Durable links from product/capability to system, repository, service, interface, data, delivery resources, runbooks, ownership, dashboards and SLOs. |\n| **Validated Delivery** | The smallest relevant evidence for the current builder/reviewer/architect, with provenance, currentness, omissions, authority and a content-addressed receipt. |\n| **Native Change Proof** | A sealed exact-change artifact binding revisions, DNA, base/result graphs, memory, blast radius, conformance, guard verdict and explicit gaps without granting workflow authority. |\n| **Change Gate + Constitution** | Deterministic checks for trusted constraints and architectural intent. Policies are compiled, proved, inspected and explicitly activated by a human. |\n\nReadable JSON in `.hunch/` is the repository-scoped source of truth. SQLite is a fast, rebuildable projection. Git keeps the state portable, reviewable and reversible.\n\n## Project DNA: help the agent work like it belongs here\n\nProject DNA is Hunch's evidence-bound model of **how a repository communicates and works**. It is not a persona, does not impersonate a maintainer and does not turn frequent behavior into policy.\n\nThe deterministic baseline reads an exact Git revision, bounded commit history and committed convention files. The current release can also accept bounded, caller-authorized pull-request/review evidence. Every evidence batch is validated and sealed; raw collaboration text does not enter the profile.\n\nEach trait keeps its category, confidence, freshness, repository revision and evidence hash. Hunch can include only the relevant DNA in normal context, explain how an artifact matches repository conventions and show profile change between revisions.\n\n```bash\nhunch dna inspect\nhunch dna context\nhunch dna diff <older-ref> <newer-ref>\n```\n\nDNA may shape orientation, terminology and advisory Project Match checks. It cannot create or override a decision, constraint, finding, conformance rule, policy or permission.\n\nRead the [Project DNA contract](docs/project-dna.md) and broader [Project DNA vision](docs/project-dna-engine.md).\n\n## Day-to-day\n\n| Command | Use it for |\n| --- | --- |\n| `hunch context \"<task>\" --profile builder` | Get a bounded builder/reviewer/architect brief before work starts |\n| `hunch why <file-or-symbol>` | See decisions, bugs, constraints and blast radius behind code |\n| `hunch structure [target]` | Inspect indexed repository shape without repeated search rounds |\n| `hunch findings [scope]` | Inherit known-but-unfixed gaps instead of rediscovering them |\n| `hunch check --working` | Review the current tree against trusted project rules |\n| `hunch conform` | Prove the code still satisfies recorded architectural intent |\n| `hunch impact origin/main` | See the dependency and memory surface of a branch |\n| `hunch compare branch-a branch-b` | Rank candidate changes by invariant/decision conflicts |\n| `hunch prove origin/main --public-only` | Produce a publication-safe `hunch.change-proof/1` artifact for an exact committed change |\n| `hunch landscape review` | Inspect a hash-bound repository landscape without writing authority |\n| `hunch now` | See recent memory and live decision-backed roadmap |\n| `hunch escalations` | See questions that genuinely require a human answer |\n| `hunch doctor` | Diagnose setup, provider, index or overlay problems |\n\nWhen you are ready for deterministic enforcement:\n\n```bash\nhunch firmness strict\nhunch check --staged --strict\n```\n\nCaptured memory cannot silently hard-block on its own.\n\n## Deterministic organizational state — next product direction\n\nRepository memory solves one version of a larger problem.\n\nAs organizations give every employee an agent that can work across CRM, email, messaging, repositories and other tools, the agents become probabilistic writers/readers of the same organization. If each one independently reconstructs what was decided, what was already done or what is still owed, the organization gets multiple conflicting realities.\n\nThe active roadmap asks whether Hunch can become the deterministic state layer between those agents and the organization:\n\n> **Agents are probabilistic. Organizations need deterministic state. Hunch is the state layer between them.**\n\nThe target is **one product, one authorized state graph and one versioned state contract** across repository, user, team and organization scopes.\n\nPlanned state includes:\n\n- decisions currently in force;\n- verified action receipts / what was done;\n- commitments and due-state;\n- entities and relationships;\n- code/system changes with proof;\n- repository/user/team/org DNA;\n- derived current state with exact dependencies/invalidation.\n\nAgents continue to own live connector mechanics. Hunch must **not** become a managed proxy that fetches Gmail, CRM, WhatsApp or GitHub on an agent's behalf.\n\nInstead:\n\n```text\n                  Hunch deterministic state\n                        ↑       ↓\nagent -> deterministic action gate -> connector -> source system\n```\n\nHunch may hold durable state **about** external work with credential-free provenance pointers, but should not mirror raw source-system contents into a universal cache.\n\nThe first real-world pilot is **Sofia**, a working operations agent over CRM, Gmail and WhatsApp. Sofia's approved actions, follow-ups, customer/source relationships and cited summaries map naturally to action receipts, commitments, entities/relationships and dependency-bound state.\n\nThe pilot measures whether Sofia and a second, different agent stop re-deriving contradictory state when the deterministic state is delivered before they answer or act.\n\nRead [Deterministic organizational state](docs/deterministic-state.md) and the [roadmap](ROADMAP.md).\n\n### Naming\n\nThe product is still **Hunch**. A possible hosted-platform name, **Nuryel**, is intentionally deferred until the state contract and Sofia pilot have evidence. Rename work is not the deliverable.\n\n## Share one living repository memory with your team\n\nThe current release can keep a team's **repository-scoped** memory in a dedicated private Git repository, separate from the code.\n\nToday Hunch does not host that shared Git repository; teammates/CI use normal Git access and one maintainer connects it:\n\n```bash\nnpm i -g @davesheffer/hunch@1.23.3\nhunch shared --repo git@github.com:acme/project-hunch-memory.git\ngit add .gitignore .hunch/team.json\ngit commit -m \"chore: connect shared Hunch memory\"\ngit push\n```\n\nTeammates then install the same version and run:\n\n```bash\nnpm i -g @davesheffer/hunch@1.23.3\ngit pull\nhunch init\nhunch doctor\n```\n\nThe committed pointer contains a credential-free repository locator and branch. Local clone paths, preferences and private overlays stay ignored. MCP sessions refresh shared memory at tool boundaries; failed pushes can be retried by later capture or `hunch shared --sync`.\n\nUse `hunch firmness off` to pause hook enforcement without deleting history. Use `hunch shared --repo <url> --no-auto-commit` when captures should remain local until explicit `hunch shared --sync`.\n\nThis existing Git-sharing feature is not the same thing as the planned organization/team/user state service. The roadmap extends the git-native model rather than declaring today's shared-memory repository to be an organization control plane.\n\n## Trust boundaries that stay visible\n\n- **Local-first today.** Repository Hunch works without a hosted service or telemetry. Git remains the repository-scoped authority.\n- **Hosted state is a roadmap extension, not a shipped claim.** Organization/team/user state will require authenticated scope/visibility, idempotency and durability while preserving git-native truth.\n- **Private when needed.** `hunch private --repo <url>` keeps sensitive repository reasoning in a separate overlay; public CI/documentation remain public-only.\n- **Human authority.** Observations, generated drafts, imported ADRs, discovered landscape records and proved policy candidates do not silently become trusted truth.\n- **Deterministic core.** Indexing, retrieval receipts, currentness, conformance, Project DNA discovery and policy evaluation do not require a model.\n- **Agents own execution.** Hunch state does not silently grant connector permissions, send messages or become a source-system proxy.\n- **No surprise synthesis bill.** Optional drafting can use a selected Claude Code, Codex or Cursor subscription CLI, a local OpenAI-compatible endpoint or deterministic fallback. Public remote endpoints require explicit opt-in.\n- **Traceable releases.** npm packages and the VS Code extension are content-addressed, verified against public registries and tied back to exact source tags.\n\n## What changed after v1.19\n\nThe v1.19 correction-search benchmark remains scoped evidence, but it no longer describes the whole product.\n\n- **v1.20 — one validated path from reason to result.** Role-shaped context, reviewed Engineering Landscape fragments, exact change identity, PHP graph support and hash-bound ADR review moved source, provenance, currentness, omissions and human authority through one delivery contract.\n- **v1.21 — Project DNA.** Hunch gained deterministic, revision-specific repository profiles, bounded DNA context delivery, explainable Project Match checks and auditable profile deltas.\n- **v1.22 — authorized collaboration evidence.** Hosts can contribute bounded PR/review evidence to Project DNA through a typed, sealed contract without raw collaboration persistence or policy-authority change.\n- **v1.23 — native change proof and proof-carrying evidence work.** Exact Git change identity, graph before/after, decisions/constraints, blast radius and Change Gate result can be bound into a sealed evidence artifact without granting authority.\n\nSee the [changelog](CHANGELOG.md) for release detail and the [roadmap](ROADMAP.md) for active work.\n\n## Learn more\n\n- [Full documentation](https://www.hunchmemory.com/docs)\n- [Copy-paste cookbook](https://www.hunchmemory.com/cookbook)\n- [Deterministic organizational state](docs/deterministic-state.md)\n- [Project DNA](docs/project-dna.md)\n- [Native change proof](docs/change-proof.md)\n- [Engineering Landscape Graph](docs/engineering-landscape.md)\n- [Hunch roadmap](ROADMAP.md)\n- [VS Code extension](vscode-extension/README.md)\n- [Architecture benchmark](bench/architectural-conformance.md)\n- [Contributing](CONTRIBUTING.md)\n\nApache-2.0\n",
  "bytes": 15288,
  "sha": "b97843cb4a64ca49ed790a28545ec58d30e96a9568fb216847f820064524aeaa",
  "repo_slug": "davesheffer/hunch",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_davesheffer_hunch_7afdd37a/readme"
}