Graft is an MIT-licensed CLI from Trail (the company formerly branding itself NanoNets, which renamed the product Trail-code in October 2026) that builds a repo’s context graph as a folder of linked markdown files plus a tree-sitter code graph, then wires itself into coding agents through skills, hooks, a six-tool MCP server, and a statusline so the map rides along in every session.
Graft collected 9,051 stars in twelve weeks on a story every agent user feels, yet every number behind that story, including the 54%-to-66% SWE-bench jump, is the vendor’s own until someone replicates it, and distribution clearly ran ahead of independent validation.
What it is #
The graph is plain files your agent already reads, and the intelligence in them is opt-in.
trail build (the graft command still works as an alias; the README now documents trail, checked 2026-11-24) parses 28 languages with tree-sitter (the count rose from 24 in November 2026 as Bash, GLSL, Julia, and PowerShell joined, after Gleam in October; OCaml and Zig parse symbols only, Vue, Svelte, and Astro components ride the TypeScript extractor, and the README’s overview bullet still says 24) into a per-symbol wiring graph, and an optional --deep pass (any LLM provider under your own key) writes graft/*.md concept nodes with plain-English summaries, crux code excerpts, and typed wikilinks like depends_on and produces.
The folder is a gitignored local cache like node_modules; what you commit is the wiring trail init drops into .claude/, AGENTS.md, and the MCP config, so teammates regenerate their own graphs.
Every query re-syncs the structural graph against the working tree first (about 50 ms on the README’s own 312-file repository, free, no model), so answers cover uncommitted edits; the CLI, MCP server, and Claude Code hooks add blast-radius warnings on every edit.
The old npm scope and the telemetry endpoint are still NanoNets-branded, the product site moved to trailhq.com/trail-code (graft.nanonets.ai redirects there), and the paid upsell is the hosted company brain, which the site now sells as Trail’s four plans without the Trail Brain name this note recorded earlier.
In October 2026 the product renamed to Trail-code: the repository moved from trailhq/Graft to trailhq/Trail-Code, npm gained @trailhq/trail-code (“Formerly graft”) beside the old @nanonets/graft, and the positioning widened from a context graph to a “self-learning context layer”, the code map plus Learnings, the decisions and lessons a team’s agents save and share with each other.
Status #
Young and very hot: created 2026-07-03, 10,084 stars by 2026-10-18, with 1,036 forks and 287 open issues and pull requests as of 2026-12-03, the repository renamed trailhq/Graft to trailhq/Trail-Code, the npm package @trailhq/trail-code at v0.30.5 (0.30.4 and 0.30.5, both published 2026-11-17 and merged to main with the 0.28.1 to 0.30.5 release on 2026-11-19: share-session no longer stops on one unusual session, deeply nested JSON scrubbed as text and unreadable sessions left out and named in the summary, and its preview now says what to type with folder numbers leaving folders out) beside the still-published @nanonets/graft, which stopped at 0.30.1 (published 2026-11-16) while the renamed package ran on through 0.30.2 to 0.30.5, so the README’s line that the old package runs the same code now lags four releases, and which drew 94,316 downloads in the trailing month (2026-11-02 to 2026-12-02, summed from the range endpoint with one zero day in the window, fetched 2026-12-03).
The 0.30.x train published over the 2026-11-16 share-session batch: share-session signs itself in with no flag, its sync hook survives a trail upgrade, its preview reads as four sections with one send question, and a shared session is re-sent only when it grew.
The 0.28.1-0.30.5 release merged to main on 2026-11-19, and main’s unreleased work above v0.30.5 is the 2026-11-18 batch (a share flow that asks once whether a reused learning helped, #727, and a fix so stopping the ask reads as feedback rather than a hook error, #845), followed by the 2026-11-19 overlap-warnings go-live batch (#738: hook-side edit-overlap checks counting only the lines an edit changed, with a new overlap-telemetry event in TELEMETRY.md and squash-merged branches caught through git log -S, per the batch’s own recorded learnings); the changelog items this note recorded as an Unreleased section on 2026-11-17, a --strict build that fails on structural-graph errors instead of printing a success banner, the --include-dir opt-in for named hidden directories (#221), and an Elixir fix resolving remote calls through alias in the generic tree-sitter tier (cross-file call-edge precision 0.38 to 0.93 and recall 0.41 to 0.64, measured against mix xref on a 219-file app), shipped in 0.30.0 (published 2026-11-16) and the changelog carries no Unreleased section (re-fetched 2026-11-24); main’s newest commit remains the 2026-11-19 batch, the repository’s 2026-12-03 pushed date reading as off-main activity, with no release since v0.30.5.
The previously recorded batches stand from the 2026-11-11 pass: the 2026-11-09 language batch (28 languages with Bash indexing, GLSL, Julia, and PowerShell listed, .svelte and .astro script-block indexing, TypeScript named-import call resolution, and its fix round), the 2026-11-07 batch (a Claude memory import in trail init, learning files written one per session or one per PR, the Windows blast radius, statusline wrapper chaining, and a graph-and-search correctness pass), and the 2026-11-06 share-session command.
The 0.25.0 release (2026-10-23) extended the Learnings loop: a repository’s skill now ships with its whole folder, a coding agent’s use of a repo skill is reported to the workspace, and learning sync takes down learnings deleted at HEAD and syncs each turn.
npm 0.26.0 (published 2026-10-26) released the 10-26 main work and more: the Claude Code workspace connector (trail mcp passing the workspace’s tools, skill prompts, and instructions through to Claude Code after pairing, with repo tools winning name clashes and the repo still working when Trail is unreachable), an always follow pin (trail note --always-follow), trail init --agents auto writing repo files for Claude Code, Cursor, Codex, and OpenCode with laptop settings only for the agents installed, first-setup reading of merged PR reviews so real learnings exist on day one, and the four learning kinds regrouped into three display units (learnings, always follow, skills), with the old /api/v1/mcp brain tools removed in the connector’s favor.
npm 0.27.0 and 0.28.0 (both published 2026-10-27) then moved the hosted side into the agent: Trail’s page copies a prompt with a one-time code and trail login --code signs the laptop in, one sign-in arms Claude Code, Codex, and Cursor in every project, teammates pulling .trail/workspace.json get a single sign-in offer, setup learns from past Claude Code sessions and merged PRs, learnings arrive just before an edit instead of after, a trail check warns before commit, push, or PR creation when a change runs against a learning (warn only, it can flag word matches that are not conflicts), and a laptop can hold several workspaces (trail workspace), with a fix so an npx sign-in leaves the agents with working tools.
The rename trail has grown another link: the repository’s canonical home is now trailhq/Trail-Code, with the old trailhq/Graft and NanoNets/Graft URLs redirecting, and the product page presents it as “Trail-code (previously graft)”. The community footprint is thin for the star count: a third-party Show HN drew 3 points and 2 comments, the creator’s own follow-up reached 39 points and 44 comments, and its most substantive comments were criticisms. In that thread the creator confirmed the README’s marketing register is model-written (“Opus 5 is very paranoid on giving proofs… so I let it keep this one line”), and the only cross-tool numbers anywhere (graft over Graphify, MRR 0.73 vs 0.38) are his own tests, not a published benchmark. No independent benchmark or third-party evaluation exists as of 2026-09-13.
Strengths #
- The delivery is the deepest in this category: per-agent instruction files for the eleven agent ids
trail initknows (plus Pi hook events, README checked 2026-11-24), six MCP tools, post-edit hooks with blast-radius warnings, a live statusline, and auto-resync, so the map actually gets used instead of ignored. - The structural layer is deterministic, key-free, and local, and the LLM layer is bring-your-own-provider, so the tool never sits between you and a model bill.
- Freshness is engineered rather than promised: a structural re-sync per query (about 50 ms on the README’s own repository, a stat against the last build’s fingerprint that rebuilds only what moved), content-hash caching, and a
trail_check_freshnessMCP tool reporting whether the local graph has drifted from the code. - The telemetry policy is unusually explicit: a published allowlist contract with bucketed values, opt-out via
DO_NOT_TRACK=1, and off by default in CI and source builds.
Cautions #
- Every performance number is self-run: the headline of 46 percent fewer tool calls and 60 percent less time, the 32 percent lower cost and 42 percent fewer uncached input tokens of the 162-run sweep, and the 54%-to-66% SWE-bench Verified result (official harness, but their run, their repos, not on the public leaderboard).
- The differentiating plain-English summaries are the part the creator calls experimental, writing on HN that they are “still testing whether the summaries are worth it at all”.
- The README’s prose is LLM-written and commenters flagged the “empty calorie language” before the creator confirmed its origin, which tells you how much of the polish to discount.
- The per-repository table covers only PocketBase (21 percent cheaper and 14 percent faster over 15 tasks), and its 2.6x-cheaper figure is that run’s single hardest question, so read the peak as a ceiling and the average as the expectation; the README’s up-to-4x-cheaper and 3x-faster headline, which this note quoted until 2026-11-24, is gone from the page (absent at its 2026-11-09 revision and today).
- The hosted upsell is aggressive (the paid plans sell rules, editors, and monthly agent reads, the hosted product and not this repo, and the “living skill file” pitch this note once quoted is gone from the site), 287 open issues and pull requests as of 2026-12-03 is a lot for a project under five months, and the rename trail (context-graph-engine to Graft, NanoNets to trailhq, Graft to Trail-Code) scatters canonical links.
Pricing #
Graft is free, MIT, no account; your only cost is the LLM usage the optional deep pass makes under your own key. The money is in the hosted company brain this note recorded as Trail Brain (the site no longer uses that name; its pricing page now titles the plans as pricing that grows with your Trail, tiers re-verified unchanged 2026-11-24): Free ($0, 100 rules, 1 editor, 10K agent reads/month), Small ($20k/year), Medium ($60k/year), and Large ($150k/year with in-VPC and HIPAA BAA), priced on rules, editors, and monthly agent reads, with SOC 2 Type II on every plan.
Price history #
| Date | Plan | Change | Source |
|---|---|---|---|
| 2026-09-18 | Trail Brain | Baseline: Graft free (MIT); Trail Brain Free $0 (100 rules), Small $20k/yr, Medium $60k/yr, Large $150k/yr with in-VPC and HIPAA BAA. |
Compared to #
- Graphify: both are local, file-based graph tools with no vectors, but Graphify’s graph is fully deterministic while graft’s differentiating summaries are LLM-written; Graphify for structure only, graft for a map written in English.
- Semble: Semble answers where-is-the-code with fused static embeddings and BM25; graft answers what-does-this-subsystem-do and who-depends-on-it with readable files and typed links.
- Augment Code: Augment’s real-time index is cloud-side and drives only its own harness; graft’s map is local files any agent that reads files can use, with correspondingly less enterprise polish.
Bottom line #
I would try graft on a repo big enough that my agent visibly wanders, keeping the free structural layer as the default and treating every headline number as a hypothesis my own workload has to replicate. I would not skip TELEMETRY.md for a compliance-sensitive team, and I would not buy Trail Brain on the strength of this repo, because the open-source map and the paid company brain are different bets.
Changes #
- 2026-09-12 - Created in the Context engines category during the three-entrant resolution run.
- 2026-09-16 - Refreshed the growth numbers (8,121 stars, 735 forks, 165 open issues as of re-verification); npm package, download window, and Trail Brain pricing unchanged.
- 2026-09-18 - Refreshed the growth numbers (8,458 stars, 766 forks, 169 open issues, 49,422 trailing-month npm downloads); package still v0.18.0 and Trail Brain pricing unchanged.
- 2026-09-20 - Added the Price history section tracking price changes in a table, per the new owner rule.
- 2026-09-20 - Recorded the repository’s canonical move to the trailhq GitHub org and repointed the raw README and TELEMETRY reference links, alongside the growth-number refresh (8,723 stars, 52,630 trailing-month npm downloads).
- 2026-09-22 - Recorded the npm package moving to v0.19.0 (published 2026-09-22) and refreshed the growth numbers (9,051 stars, 823 forks, 196 open issues, 56,074 trailing-month npm downloads); Trail Brain pricing unchanged.
- 2026-09-25 - Refreshed the growth numbers (9,172 stars, 835 forks, 206 open issues, pushed 2026-09-24); npm package v0.19.0, the trailing-month download figure, and Trail Brain pricing unchanged.
- 2026-09-26 - Recorded the npm package moving to v0.20.0 (published 2026-09-25) and refreshed the growth numbers (9,234 stars, 842 forks, 215 open issues, pushed 2026-09-26, 59,444 trailing-month npm downloads); Trail Brain pricing unchanged.
- 2026-09-27 - Refreshed the growth numbers (9,276 stars, 844 forks, 221 open issues, 66,248 trailing-month npm downloads); npm package v0.20.0 and Trail Brain pricing unchanged.
- 2026-09-29 - Refreshed the growth numbers (9,381 stars, 862 forks, 239 open issues, pushed 2026-09-29, 72,419 trailing-month npm downloads); npm package v0.20.0 and Trail Brain pricing unchanged.
- 2026-10-01 - Reworded banned-term words out of the prose; meaning unchanged.
- 2026-10-02 - Recorded the npm package moving to v0.21.1 (published 2026-09-29) and refreshed the growth numbers (9,483 stars, 871 forks, 199 open issues and pull requests, pushed 2026-10-01, 88,838 trailing-month npm downloads); Trail Brain pricing unchanged.
- 2026-10-07 - Added the trailhq/Graft star history chart to the Status section.
- 2026-10-16 - Recorded the second rename, product and repository (trailhq/Graft to trailhq/Trail-Code, npm @trailhq/trail-code “Formerly graft”, positioning widened to the self-learning context layer with team Learnings), refreshed the growth numbers (10,084 stars, 891 forks, 250 open issues and pull requests, pushed 2026-10-15, 114,056 trailing-month downloads on the old package), and re-verified Trail Brain pricing unchanged.
- 2026-10-22 - Recorded the language count rising to 24 with Gleam support, the renamed npm package moving to v0.23.1, and refreshed the growth numbers (939 forks, 247 open issues and pull requests, 98,766 trailing-month downloads on the old package); Trail Brain pricing re-verified unchanged.
- 2026-10-24 - Recorded the renamed npm package moving to v0.25.0 (2026-10-23: a repo’s skill shipping with its whole folder, skill runs reported to the workspace, learning-sync fixes for HEAD-deleted learnings and per-turn sync) and refreshed the growth numbers (955 forks, 244 open issues and pull requests, pushed 2026-10-23); Trail Brain pricing re-verified unchanged against the live pricing page.
- 2026-10-26 - Recorded main’s unreleased Claude Code workspace MCP connector (
trail mcppassing the workspace MCP server through to Claude Code) and the learnings/always-follow/skills display regrouping (2026-10-26). - 2026-10-27 - Recorded the renamed npm package moving to v0.26.0 (2026-10-26: the Claude Code workspace connector released,
trail init --agents auto, thealways followpin, first-setup PR-review reading, the learnings/always-follow/skills regrouping, and the old/api/v1/mcpbrain tools removed) and refreshed the growth numbers (959 forks, 251 open issues and pull requests, 84,196 trailing-month downloads on the old package summed from the range endpoint). - 2026-10-30 - Recorded the renamed npm package moving through v0.27.0 and v0.28.0 (both 2026-10-27: agent sign-in with a one-time code arming every agent on the laptop, teammate sign-in offers, learnings delivered before an edit, the pre-commit
trail checkwarning, multi-workspace laptops, and the npx sign-in fix) and refreshed the growth numbers (970 forks, 276 open issues and pull requests, pushed 2026-10-29, 87,324 trailing-month downloads on the old package summed 2026-09-30 to 2026-10-30); Trail Brain pricing re-verified unchanged. - 2026-11-01 - Recorded the npm packages moving to v0.28.1 (both
@trailhq/trail-codeand@nanonets/graft, 2026-10-30, a patch with no changelog section on main yet) and refreshed the growth numbers (975 forks, 277 open issues and pull requests, 79,490 trailing-month downloads on the old package summed 2026-10-02 to 2026-10-31); corrected the old package’s stale version note. - 2026-11-05 - Recorded main’s unreleased 2026-11-02 fixes (peak memory on big repos, a sync crash) and refreshed the growth numbers (984 forks, 288 open issues and pull requests, pushed 2026-11-05); npm unchanged at v0.28.1.
- 2026-11-07 - Recorded main’s unreleased 2026-11-06 share-session commit (#740, sends a person’s whole Claude setup) after the 2026-11-03 README badge repoint; npm unchanged at v0.28.1.
- 2026-11-08 - Recorded the renamed npm package moving to v0.29.0 (published 2026-11-06, no changelog section on main yet) and main’s unreleased 2026-11-07 batch (a Claude memory import in
trail init, learning files one per session or per PR, the Windows blast radius, statusline wrapper chaining, and a graph-and-search correctness pass) and refreshed the growth numbers (991 forks, 270 open issues and pull requests, 91,926 trailing-month downloads on the old package summed 2026-10-09 to 2026-11-08). - 2026-11-11 - Recorded main’s unreleased 2026-11-09 batch lifting the language count from 24 to 28 (Bash indexing with the bundled grammar, GLSL, Julia, and PowerShell listed in the README),
.svelte/.astroscript-block indexing, TypeScript named-import call resolution, the--include-dirdot-directory opt-in, and the fix round (locale-pinned numbers, gateway JSON recovery, the cross-drive--dirguard, PHP type usages, polyglot LSP enrichment, the telemetry recursive-flush fix); npm unchanged at v0.29.0, and the 2026-11-11 pushed signal resolved as off-main activity; refreshed the growth numbers (999 forks, 217 open issues and pull requests, 91,818 trailing-month downloads on the old package summed 2026-10-12 to 2026-11-11). - 2026-11-17 - Full rotation re-verification: every cited URL re-fetched and intact (the repository page, the README’s Trail-code banner and 28-language supported-languages list, the product site, the Trail-code page, TELEMETRY.md, the npm registry and trailing-month downloads, the changelog, both HN threads at 3 and 39 points, and the pricing page with Trail Brain tiers unchanged); recorded the renamed npm package moving to v0.30.3 (a four-version train published 2026-11-16 09:15 through 2026-11-17 05:35, no per-version changelog section on main) published over the 2026-11-16 share-session batch (sign-in with no flag, the sync hook surviving a trail upgrade, a four-section preview with one send question, re-sending only when the session grew), main’s unreleased 2026-11-17 commits (the save-a-learning prompt fixes and a prototype trail-init ending showing Trail on your own last task), and the changelog’s new Unreleased section (–strict structural-graph build failures, the –include-dir hidden-directory opt-in, and an Elixir alias call-resolution fix with call-edge precision 0.38 to 0.93 against mix xref on a 219-file app); refreshed the growth numbers (1,016 forks, 236 open issues and pull requests, 97,333 trailing-month downloads on the old package summed 2026-10-13 to 2026-11-12); Trail Brain pricing re-verified unchanged.
- 2026-11-19 - Recorded the renamed npm package moving to v0.30.5 (0.30.4: share-session surviving deeply nested sessions with unreadable ones left out and named; 0.30.5: the preview saying what to type with folder numbers leaving folders out) and main’s unreleased 2026-11-18 batch (the learning-helped question, the stop-ask feedback fix), with the 0.28.1-0.30.5 release merged to main 2026-11-19; forks and open issues and pull requests refreshed (1,023 and 240).
- 2026-11-20 - Recorded main’s unreleased 2026-11-19 overlap-warnings go-live batch (#738, edit-overlap checks with a new telemetry event, counting only the lines an edit changed and catching squash-merged branches through git log -S); npm unchanged at v0.30.5; open issues and pull requests refreshed to 241.
- 2026-11-24 - Full rotation re-verification: every cited URL re-fetched and intact (the repository page, the README, the product site now served at trailhq.com/trail-code with graft.nanonets.ai redirecting there, TELEMETRY.md, the npm registry and trailing-month downloads, the changelog, both HN threads at 3 and 39 points, and the pricing page with the four tiers unchanged); refreshed the forks and open issues (1,033 and 274) and the trailing-month downloads (102,319 summed 2026-10-24 to 2026-11-23); the 2026-11-23 pushed signal resolved as off-main activity with main newest-committed 2026-11-19 and no release since v0.30.5.
- 2026-11-24 - Corrected the note against the rewritten README and site: the command is
trailwithgraftkept as an alias; the query-time structural re-sync reads about 50 ms on the README’s own repository, not 3 ms;trail initknows eleven agent ids plus Pi hook events, not nine surfaces; the benchmark headline reads 46 percent fewer tool calls and 60 percent less time with 32 percent lower cost and a single 2.6x PocketBase question, the up-to-4x and 3x headline being gone from the README; the –strict build, –include-dir, and Elixir fixes shipped in 0.30.0 and the changelog carries no Unreleased section; 0.30.4 and 0.30.5 were both published 2026-11-17; the old @nanonets/graft package stopped at 0.30.1 while @trailhq/trail-code ran to 0.30.5; and the site no longer uses the Trail Brain name or the living-skill-file pitch; the open issues count the 2026-11-20 bullet recorded (241) now carries in Status. - 2026-12-03 - Full rotation re-verification: every cited URL re-fetched and intact (the repository page, the README at main’s 2026-11-19 head, the product site and its 60 percent, 32 percent, and 33-of-50 headline numbers, TELEMETRY.md, the changelog topping out at 0.30.5 with no Unreleased section, both HN threads at 3 and 39 points, the npm registry with the renamed package at 0.30.5 and the old one at 0.30.1, and the pricing page with the four tiers unchanged); the 2026-12-03 pushed signal resolved as off-main activity with main newest-committed 2026-11-19 and no release since v0.30.5; refreshed the forks and open issues and pull requests (1,036 and 287) and the trailing-month downloads (94,316 summed 2026-11-02 to 2026-12-02, one zero day).
See also #
- Context Engines Feature Matrix - the category comparison this note joins
- Context Management Patterns - the manual onboarding practice graft automates
- Speeding up LLM work on a single codebase - the corpus article whose core problem graft attacks
References #
https://github.com/trailhq/Trail-Code - canonical repository (trailhq/Graft and NanoNets/Graft redirect here), stats and activity as of 2026-12-03
https://raw.githubusercontent.com/trailhq/Trail-Code/main/README.md - architecture, benchmark tables, SWE-bench Verified numbers, delivery surfaces, and the rename banner (“Trail-code (previously graft)”); the benchmark tables now headline 46 percent fewer tool calls and 60 percent less time with 32 percent lower cost, the query refresh is timed at about 50 ms, and
trail initlists eleven agent ids (re-fetched 2026-11-24)https://graft.nanonets.ai - the former product site, now redirecting to trailhq.com/trail-code (redirect followed 2026-11-24)
https://trailhq.com/trail-code - the product page carrying the rename and the Learnings framing, with the headline numbers 60% less agent time per task, 32% lower token cost per task, and 33 of 50 bug fixes solved against 27 (re-fetched 2026-12-03)
https://raw.githubusercontent.com/trailhq/Trail-Code/main/TELEMETRY.md - the telemetry allowlist contract, with events still sent to events.nanonets.com and never from CI, re-fetched 2026-11-24 (the original NanoNets/context-graph-engine path still redirects)
https://registry.npmjs.org/@trailhq/trail-code/latest - the renamed package, v0.30.5, described as “Formerly graft” (re-fetched 2026-12-03)
https://registry.npmjs.org/@nanonets/graft - the old package, latest 0.30.1 published 2026-11-16 while the renamed package ran on to 0.30.5 (fetched 2026-12-03)
https://raw.githubusercontent.com/trailhq/Trail-Code/main/CHANGELOG.md - the 0.27.0 through 0.30.5 changelogs, with the –strict build, –include-dir, and Elixir alias fixes inside 0.30.0 and no Unreleased section (re-fetched 2026-11-24)
https://api.npmjs.org/downloads/range/2026-11-02:2026-12-02/@nanonets/graft - 94,316 downloads summed for 2026-11-02 to 2026-12-02 on the old package, one zero day in the window, fetched 2026-12-03
https://hn.algolia.com/api/v1/items/49197687 - the 3-point Show HN and the creator’s tree-sitter-only clarification, 2 comments (re-fetched 2026-11-24)
https://hn.algolia.com/api/v1/items/49299985 - the 39-point thread: staleness, README register critique, and the vendor-run Graphify comparison, 44 comments (re-fetched 2026-11-24)
https://trailhq.com/pricing - the hosted plans this note recorded as Trail Brain (re-fetched 2026-12-03, tiers unchanged from the 2026-09-18 baseline; the page no longer uses the Trail Brain name)
https://trailhq.com - the vendor and the hosted-brain upsell positioning (re-fetched 2026-11-24)