grain — mine an architecture graph out of a repository that has none, from its own code and history.
npx claudepluginhub krzysztofdudek/grainMine an architecture graph out of a repository that has none: grain propose reads the code and the full git history and writes node types, nodes, relations, cycles and the rules the repository's own code can prove, each one carrying the evidence that produced it and the count of places that already break it, as a tree Yggdrasil loads and accepts with one command. The agent-facing questions it has always answered still work from the same model: where <intent> (where such things live, what is expected there, exemplars to copy), what <term>, how <query>, check <file> (how a change sits against the local norm), review, completeness, status/report/rules, export, decide steer|boundary|waive — plus hooks that speak unbidden and an MCP server exposing every command as a tool to any MCP client. Statistical answers mined from syntax trees and git history; no model calls, no network, never blocks.
7-day visitors to each marketplace page

The conventions nobody wrote down.
Grain reads your repository's code and its full git history, and tells you and your agent what the code already keeps, with a count behind every claim.
Your agent writes code that looks right and still does not match how this repository does things: the file lands one directory away from its siblings, the import style is off by a hair. Nobody wrote that rule down, so nobody can hand it to the agent.
In Claude Code:
/plugin marketplace add krzysztofdudek/Grain
/plugin install grain@grain-marketplace
Then restart the session. Requires Node.js 22 or newer and git. The plugin carries the parser and every grammar inside it, and downloads nothing at runtime.
| Piece | Where it lands | What it does | When it acts |
|---|---|---|---|
The Grain plugin: a skill, the /grain:* slash commands and the grain MCP server | your Claude Code plugins | Teaches the agent when to ask, and answers where, how, what, check, review, propose and the rest, as commands and as MCP tools. | When the agent or you ask. |
| Session-start hook | the plugin | Prints what Grain answers here, the state of the index and the architecture's shape. | At the start of every session. |
| Hook on your prompt | the plugin | Names past commits that did similar work, only when the match is strong. | When you type a prompt (Claude Code only). |
| Hooks before Write, Edit and MultiEdit | the plugin | Before a new file exists, says where files with that name pattern live; before an edit, names files that usually change with it. | Before those tools run. |
Hook before git commit | the plugin | Reviews the staged change the way grain review does. | Before a commit the agent runs. |
| Hooks after Edit, Write, MultiEdit and Read | the plugin | Names deviations on the lines just touched; after a Read, says when the file read is one not to copy. Silent when there is nothing to say. | After those tools run. |
.grain/cache/ | repository, ignored by git | The index, built from the full history. | Built by the first query; when HEAD moves, a hook starts one grain refresh in the background. |
.grain/.gitignore | repository, meant to be committed | Ignores only cache/. | Created by the first query. |
.grain/decisions.jsonl | repository, committed | Your recorded decisions (grain decide). | Only when you record one. |
.yggdrasil-proposal/ | repository | A proposed architecture graph for Yggdrasil. | Only when you run grain propose. |
.yggdrasil/ graph (a proposal is accepted only by yg adopt), your build, the network. It never blocks a tool call, a commit or a build.GitHub Copilot CLI:
copilot plugin marketplace add krzysztofdudek/Grain
copilot plugin install grain@grain-marketplace
Cursor:
git clone https://github.com/krzysztofdudek/Grain.git
ln -s "$(pwd)/Grain" ~/.cursor/plugins/local/grain
Then Developer: Reload Window.
Cursor and Copilot CLI get only the session-start hook, so the per-edit notes do not appear there (docs/reference.md).
A terminal, from any repository:
node /path/to/Grain/plugins/grain/bin/grain.mjs report
Matt Pocock's skills for real engineering, as an installable Claude Code plugin.
Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations
No description available.