Trail-Code is a context layer for coding agents — Claude Code, Cursor, Codex, Gemini, and others. The original project, trailhq/Trail-Code, has 10,487 stars and is written in TypeScript under the MIT license. What I want to point at here is a separate repository: a Chinese translation of that project's documentation, published at https://github.com/yangshun2005/Trail-Code-cn.
The translation is dated 2026-10-21. It is brand new — as of this writing it has no stars of its own. That matters for how you read this article: nothing below claims the Chinese version has traction. The numbers I quote are the original project's numbers, reproduced from the translated README, which itself states it aims to stay faithful to the source.
What the project actually does
The name changed. Trail-Code used to be called graft, and "graft" survives as the name of one of its two halves. The README frames the whole thing as two things that sit next to each other:
| Code map (formerly graft) | Learnings | |
|---|---|---|
| What it is | An index of every function and its callers, so the agent can see what a change might break | What you, your agent, and your team learned and decided |
| What it does for the agent | Takes it straight to the right file | Lets it continue from where you and your team stopped |
| Where it comes from | Your code, read locally | Your conversations, recorded as you work |
So one half is static analysis. The other half is a memory of decisions. Neither is novel in isolation — code graphs exist, and so do project memory files. The claim worth examining is that putting them in the same layer changes what the agent does.
The numbers in the README
These come from the original README, carried over into the translation unchanged.
Across 162 runs of the same agent on the same tasks:
| Cold agent | Agent with the graft map | |
|---|---|---|
| Tool calls, 162 runs | baseline | −46% |
| Uncached input tokens, 162 runs | baseline | −42% |
| Wall-clock time, 162 runs | baseline | −60% |
Cost dropped 32% with accuracy held flat. On PocketBase, across 15 real tasks, cost fell 21% and speed improved 14%.
On SWE-bench Verified — 50 real GitHub issues, graded by the maintainers' own tests — Claude Sonnet 5 with the graft map solved 33 of 50, versus 27 of 50 without it. That's 66% against 54%, with token usage down 23%.
I have not reproduced any of this. My sample is the README's, not mine. Treat the percentages as a vendor's measurements of its own tool, which is what they are.
Why a Chinese translation is worth a repository
The original README is long. It has a reference section for commands, a benchmark section, a section on migrating from graft, and a note on telemetry. For a developer whose English reading is slow but serviceable, that's an hour of careful reading before the first command runs. For one whose English is weaker, it's a wall.
The translation does two distinct things, and the repository is explicit about the split:
- The README body is a translation. The stated goal is fidelity to the original. Where the translation is wrong, the repo asks for an issue or a PR.
- A "中文快速上手" section at the top is supplementary. It is marked as not part of the original — an editorial addition aimed at getting a Chinese-speaking developer from zero to a running install without reading the whole document.
That second part is the more interesting one. It includes material the original README does not spell out, and it flags where the original is silent rather than inventing an answer.
What the quick-start adds
The install path is short:
npm install -g @trailhq/trail-code
trail init
The package name and the command name do not match. You install @trailhq/trail-code and you run trail. The package.json also keeps graft as a bin entry, and the README confirms the old graft commands still work. If you have muscle memory from the graft era, it isn't broken.
The quick-start then covers the things that actually stop an install:
-
Node.js 20 or above. The
enginesfield inpackage.jsonrequiresnode >= 20. Lower versions will not run. -
A working native toolchain. Installation compiles tree-sitter grammars from source via node-gyp. The Dockerfile comments mention nine tree-sitter grammars. You need Python and a C++ compiler available. The same Dockerfile notes that the slim base image (
node:22-bookworm-slim) lacks the toolchain and fails without it — which is a useful warning if you're building in a container. - Network. The quick-start points out that a global npm install pulls packages and compiles native dependencies, so users behind the GFW may need a mirror. That's an operational note, not a technical claim about the software.
-
Telemetry. The README badge says "anonymous, opt-out." Details live in
TELEMETRY.md. The translation does not expand on it.
The quick-start also names trail check, which flags changes that conflict with decisions the team has already recorded, and mentions trail grep, trail map, and trail viz as existing in the reference section. It explicitly declines to document them further, pointing back to the README body. That restraint is better than a half-invented command reference.
One gap the translation is honest about: the original does not describe how the hook that points your agent at the graft map is configured. trail init builds the map and sets up the hook, but the mechanism isn't spelled out in the source material. The translation says so instead of guessing.
The learnings half, in practice
The README's before/after table is the clearest description of what changes day to day:
- Without it, the agent greps and opens files one by one looking for the code it needs. With it, the right file and function arrive with the prompt.
- Without it, you re-explore code a teammate figured out last week. With it, you start from what they decided, what they ruled out, and what to watch for.
- Without it, you overturn a teammate's decision because you never knew it existed. With it,
trail checkflags the conflict before the PR and cites who decided what and why. - Without it, you find out at merge time that a teammate touched the same code. With it, you're told as soon as you edit code that an unmerged branch is also changing, and whether the two conflict.
- Without it, you re-explain the same context every session. With it,
trail initsurfaces things you've said repeatedly in past sessions. - Without it, you hand-maintain
CLAUDE.md. With it, learnings are saved from your conversations as readable files.
That last row is the one I'd check first. "Readable files" is a claim about format, and format determines whether the memory is auditable or a black box. The README says readable; it doesn't show a sample. If you're evaluating this for a team, look at what lands on disk before you trust the rest.
Who should read the Chinese version
If your English is fine, read the original. Translations drift, and the original is the source of truth for commands and numbers.
If your English is workable but slow, the Chinese version is a reasonable first pass. The quick-start gets you installed, and the translated body gives you the concepts in a language you read faster. Then go back to README_en.md — which the repo keeps alongside the translation — for anything you're about to depend on.
If you're on a team where some members read English comfortably and others don't, the split is useful. The people who can read the original can verify the translation. The people who can't get a path in that doesn't route through an hour of dictionary work.
Caveats
The benchmarks are the project's own. The SWE-bench numbers use Claude Sonnet 5 on 50 issues — a real subset, not the full set, and 50 issues is a small sample for a 6-point difference.
The translation is one day old and has no stars. It may contain errors; the repository invites issues and PRs for exactly that reason. The supplementary quick-start is editorial, not upstream, and should be read as one person's reading of the project rather than the project's own words.
And the hook configuration — the part that actually connects the map to your agent — is not documented in the source material I have. That's the piece I'd want to see before recommending this to a team that depends on it.
Repository: https://github.com/yangshun2005/Trail-Code-cn. Original: https://github.com/trailhq/Trail-Code.
Chinese documentation: https://github.com/yangshun2005/Trail-Code-cn
I'm an independent enterprise AI delivery consultant — private LLM deployment, RAG, agent workflows, AIOps. If your team is stuck somewhere in that stack, my inbox is open.
Top comments (0)