Repository navigation
Releases
v6.1.0
Grain 6.1.0 states a convention, a norm or a co-change partner only when it beats chance or the rest of the repository, so what it tells you is more often true. It finds dependencies with the same code as Yggdrasil 6.1.0, shows what changes together with grain cochange, measures a stretch of work with grain measure, and offers every command over MCP. The core of the family (Yggdrasil, Grain, Jarl and Horde) ships under one number, so this minor release includes a few changes that ask something of you: Before you upgrade lists them, and Upgrading from 6.0.0 walks through the steps.
Before you upgrade
- Type-only imports count as dependencies. Grain reads a TypeScript or JavaScript type-only import (
import type,typeof import('./m')and the other forms) as a dependency between modules, as Yggdrasil 6.1.0 does. Expect the relations they imply in your next proposal and ingrain checkandgrain report. - The six original MCP tools answer with the command line's text.
grain_where,grain_how,grain_what,grain_check,grain_statusandgrain_reportkeep their names and fields. Passjson: truewherever your client reads their JSON. - MCP paths are absolute. The server does not run in your directory, so it takes an absolute path in every field the command resolves against its working directory, such as
repo,out,graph,proposal,content,family-candidates, andgrain_propose'sout-dirandjson. A path inside the repository, such asgrain_check'sfile, can stay relative. A number field takes a number, and a field the tool does not list is refused. Pass absolute paths forrepoand the other path fields. grain exportno longer carriesagentShareandlastByAgent(see Removed), and the schema staysgrain-export/1. Drop those two fields from any script that reads the export.- Grain's family candidates have their own file and unique ids.
grain proposewrites its look-alike groups to.family-candidates.grain.json, separate from the.family-candidates.jsonYggdrasil's miner writes, andyg advisereads it from Yggdrasil 6.1.0 on. Each id now names the partition and the group (family-grain-<partition>-<group>), so a family you dismissed or deferred appears once more under its new id; dismiss or defer it again. grain completenesstakes at least one file. Called with none, it prints its usage and exits 1, so a script that builds the list should pass at least one.
Upgrading from 6.0.0
- Update the plugin in each host you use:
claude plugin update grain@grain-marketplaceand restart the session,copilot plugin update grain,codex plugin marketplace upgrade grain-marketplace, or in Cursorgit pullin your clone of Grain and Developer: Reload Window. Grain needs Node 22 or newer and git, as before. - Upgrade Yggdrasil to 6.1.0 alongside it, and pin the exact versions of the family tools your pipeline runs. Horde 6.1.0 needs Grain 6.1.0 or newer.
grain proposechecks whether theygit finds accepts the newrootparent for top-level types; with noygonPATHit writesroot, which Yggdrasil 6.1.0 accepts and 6.0.0 does not, and says so. - Give the first Grain command in each repository a little longer: it rebuilds the store and reads the whole history once.
- Update MCP clients and scripts: absolute paths for
repoand the other path fields, only the fields each tool lists,json: truewherever you read JSON from the six original tools, and noagentShareorlastByAgentfromgrain export. - In a repository that adopted a Grain proposal before 6.1.0, run
grain propose --family-candidates .yggdrasilonce from the repository root to giveyg adviseGrain's families; it writes.yggdrasil/.family-candidates.grain.json. Dismiss or defer again any family that shows under its new id. - In the same repository, drill an adopted rule with
yg drill --aspect <id>. TheCORPUS.mdbeside its cases names--dirand--corpus grain-proposal, which record the run as an external hold-out thatyg adviseand the health reading leave out; a new proposal'sCORPUS.mdnames the plain command.
Added
- The MCP server offers every command as a tool (
grain_propose,grain_advise,grain_decide_steerand the rest), with the command's flags as its fields;grain_helpreturns the full usage. A call ends on cancel or after 10 minutes (60 forproposeandselftest; seeGRAIN_MCP_TIMEOUT_MSandGRAIN_MCP_LONG_TIMEOUT_MS). grain cochangeshows which files, directories or nodes change together more often than chance and scores a proposed split into parts (--partition);grain measure --from <commit> --to <commit>compares one part of the repository at two commits. Their--jsondocuments aregrain-cochange/1andgrain-measure/1.grain advisedrafts rules the graph could take on (kind: ruleitems): agrain decide boundarythe graph does not enforce yet, and a convention inside one node that no rule states.grain propose --scope <nodes and paths>proposes a graph for one part of the repository, and--shape typescovers each file by its type and writes a node only where one type sits inside another (--shape nodesstays the default).grain proposewrites its look-alike groups beside the proposed graph, soyg adoptinstalls them andyg advisesuggests a rule for each;--family-candidates <path>and--no-family-candidateschoose another place or none, and Grain leaves another producer's file alone.grain reportnames the smallest set of dependencies that breaks each dependency cycle between modules, with the file and line of each reference, also inreport --json(cycleCuts) and the proposal's refactor backlog.grain where,checkandreviewcarrylocationin their JSON (the module a path belongs in and whether it exists yet), andgrain completeness --jsongivesgrain-completeness/1.grain selftest --nulland--cochangemeasure how often Grain's claims survive shuffled evidence and how often its co-change partners come true, andgrain oracle scorealso scores ownership units.- Vue and Svelte components join the architecture through their
<script>imports, and more Ruby and C++ files read as those languages (Gemfile,.gemspec,.cppm,.ixxand others). - Copilot CLI and Codex load the plugin from the portable Agent Plugins 1.0 layout.
Changed
- Architecture norms ("files here do not import that module"), "never X" statements, group conventions, value sets and commit shapes now have to beat chance or the rest of the repository before Grain states them. Expect different findings from
grain checkandgrain proposeon the same code: fewer false ones, and some new ones, such as a boundary no file has ever crossed. - Co-change partners are the files that change beside yours more often than chance would bring them there, so busy files such as a changelog stay out of the list.
grain proposeoffers a short list of below-the-bar candidate rules, each passing the same test as a convention: 37 and 61 on Grain and Yggdrasil, down from about 500 and 740.- Grain spots a fading convention on a repository of any age, and
checkstops flagging new code under a convention the new code has left behind. - Grain parses with Yggdrasil 6.1.0's grammars, so a relation in a proposal is one
yg checksees, and it reads newer syntax such as TypeScriptusing, C++20 modules and C# 14 extension blocks. grain decide listmarks a boundary promoted once the architecture graph forbids it, and Grain leaves that import toyg check.- The skill and the session-start note point the agent to the MCP tools first, with the command line as the fallback.
Fixed
- Dependencies: Grain resolves imports the way each language's toolchain does in Java, Kotlin, C#, Rust, Go, Python, Ruby, C, C++, PHP, TypeScript and JavaScript, and on a case-insensitive file system (the macOS and Windows default) it matches a file only under the exact name its directory lists, so a new proposal carries more real relations and fewer false ones.
- Proposals:
yg adoptaccepts a proposal for code with dependency cycles, becausegrain proposebreaks each cycle at its weakest dependency and lists the cut inREFACTOR-BACKLOG.md. A rule whose drill cases could not all run stays unverified, and over an existing graph thenext:line previews withyg adopt <out> --replace --dry-run. - Mining skips the root
.yggdrasil/, so the drill corporayg adoptinstalls there stay out of conventions and co-change. - Every family candidate has a unique id and reports its measured
tightness. grain checkgives one consistent verdict when a narrow convention and a wider one disagree about a function.- Dev containers: in VS Code attached to a container, the hooks and the MCP server exit 0 with one line when the plugin path is missing inside, and the MCP server maps a container path to the host through the containers' mounts.
- The MCP server stops the running command on
SIGTERM,SIGINTorSIGHUP, and answerspingwhile a command runs. - Windows: the hooks accept short and differently cased paths,
grain proposefinds an npm-installedyg, and files with Windows line endings read as they do elsewhere.
Removed
- Grain treats every commit the same, whether a person or an agent made it, and no longer reports who wrote the code. That retires the agent-authored share and its alarm in
statusandreport, the "held mostly by agent-authored code" note, andagentShareandlastByAgentingrain export. A repository written mostly with an agent gets more conventions: 163 instead of 90 on Yggdrasil.
Full Changelog: v6.0.0...v6.1.0
v6.0.0
Added
grain proposewrites graphs in the 6.0.0 format; loading one needs Yggdrasil 6.0.0 or newer.
Changed
- Marketplace renamed to
grain-marketplace:/plugin install grain@grain-marketplace. Also installable from the same repository via GitHub Copilot CLI, Codex CLI and Cursor. grain proposeno longer writescharter.mdbeside a proposed component. What it opens with is now the component's own description; conventions and co-change partners are a live answer fromgrain explain,grain whereandgrain completenessinstead.- A
boundarydecision recorded withgrain decide boundarynow also appears in whatgrain proposewrites, as a forbidden dependency in the proposed graph. grain advise's count of places a finer cut would help now separates places it could not read from places it could read but found too coarse.- Session start in a repository that already has an architecture graph now says so and points at
yg prime, and names how to installygwhen it isn't onPATH. - Session start now warns when the repository's index is sparse.
grain propose's report now names how many of its rules look ready to earn enforcement once Yggdrasil is installed, on a run with no Yggdrasil CLI to check them itself.
Fixed
- The checks proving
grain proposeworks with Yggdrasil and Horde now install Yggdrasil the way an adopter would, not a local build standing in for it.
0.4.0 — from clone to graph
Experimental. The measured record behind every claim, negatives included, ships with the build.
Added
- From a repository with no architecture graph to a proposed one, in a single command. It reads your code and your whole commit history and writes a complete draft: the kinds of part your repository is made of, the parts themselves, what depends on what, where those dependencies run in circles, and the rules your own code already keeps — each rule carrying the evidence that produced it and the count of places that break it today. It never touches a graph you already have. Yggdrasil accepts the draft with one command, and when Yggdrasil is on hand the preview of how much of your code the new rules would refuse runs before you decide anything.
- For a repository that already has a graph: what its own history says about it. Where a finer split of one part beats the current one on that part's own evidence, and which parts change together with nothing in the graph connecting them.
- Keeping the difference between the draft it wrote and the graph you actually accepted, and scoring itself against it in both directions. It records structure and paths, never the contents of your files, prints what it would store before storing anything, and writes nothing until you say so.
- Dependencies between parts are now resolved for thirteen languages. The other supported languages keep the conventions answers only.
Changed
- What the tool is for. Mining the first graph for a repository that has none is now the first thing it does. The questions it has always answered — where does this belong, does my change match how this repository does things — work exactly as before, and are now the second thing.
0.3.0 — released as a portfolio piece, results attached
Grain 0.3.0 is released as a portfolio piece. Development paused on 2026-09-02, and this release ships with the complete measured record, negatives first: docs/results.md.
The verdict
On every task where it was measured, an agent with grep, cat and its own judgement produced the same diff, in the same place, with the same number of tool calls as an agent with grain. Two paired trials on this build — 25 runs with grain across 6 task pairs on 5 repositories — produced zero diffs changed by a grain answer. The one demonstrated effect in the project's history (trial 3, 0.1.0) came from a placement note that spoke unbidden before the write, not from an answer to a question.
The engine is in the best state it has ever been, and there is no evidence that it helps anyone. Both are true at once.
What is in the build
- 23 tree-sitter grammars, 26 commands, hooks for Claude Code / Codex / Cursor / Copilot, an MCP server,
grain export. - One objective (two-part MDL) and one loss constant (λ = 8); no name lists, no tuned thresholds beyond that constant.
- Seven honesty instruments in CI over a SHA-pinned 25-repository corpus: claim auditor, declaration recall, surface cross-check, disclosure fixtures, ranking harness with automatic ground truth, scale ladder, command reachability.
- New since the previous 0.3.0 commit:
grain obligation <path>(precision 0.958, coverage 0.048, disclosed),completenessrewritten,whereon named queries +0.184 hit@3, three high-severity fabrication classes fixed (Python dotted heritage, Kotlinby-delegation, Rust'static), chunked history serialisation that no longer dies silently on 80k-commit repositories, structureddisclosures[]on JSON surfaces. - 2181 tests, CI on node 22 and 24.
What is not
- No measured productivity benefit for coding agents on ordinary tasks. Hard tasks — where an agent without grain demonstrably fails — were never put through the paired harness; that is the open question.
wherestill loses to a plain path-match baseline on most repositories when the query does not name a symbol.- Every language was validated by instruments, not by a support claim; the per-grammar table is in
docs/validation.md.
This build was developed under the working number 0.4.0. Internal research documents under .system/research/ keep that number; nothing in them was edited to match the release.
grain 0.1.0
First release. A repository-convention and architecture oracle for coding agents (Claude Code, Codex; Cursor and Copilot packaged, unverified): ask where before creating code, get check findings after an edit, placement advice before a file is written — every answer a percentage with a denominator and a path you can open, mined locally from syntax trees and full git history. No model calls, no network, no gate.
Built on a single principle: a claim exists iff stating it compresses the repository (two-part MDL); one loss constant (λ=8) decides when to speak; gitignore decides what is code; partitions are cut from the directory tree by compression — on express that cut rediscovers examples/ · lib/ · test/ unaided.
Evidence travels in the README: two independent truth audits (28/39 exact, 1 false class — fixed same-day), three A/B agent trials on a private post-cutoff repository (the third recording the first demonstrated effect of a grain note on an agent's diff), and performance numbers (queries 0.12 s warm; cold full-history build 18 s on a 1,100-file repo). 916 tests, CI on node 22/24.
🤖 Generated with Claude Code