# Trail Code

> CLI that gives coding agents a repository map and the decisions already made

- Category: Agents & dev (`agents`)
- Tags: `open-source`, `free`, `mcp`, `cli`
- Official: https://github.com/trailhq/Trail-Code
- Wunderlust: https://wunderlust.xyz/r/trail-code
- Image: https://wunderlust.xyz/media/trail-code-poster.jpg
- Video preview: https://wunderlust.xyz/media/trail-code.webm
- Added: 2026-11-05

## What it is

Open source CLI (formerly called graft) that indexes the codebase and keeps learnings in markdown versioned alongside the code.

## What it’s for

To stop agents from re-exploring the code and repeating mistakes across sessions and teammates.

## Benefits

- Code map built with tree-sitter in 24 languages, local and with no API key
- Learnings in .trail/learnings, versioned with the code
- trail check compares the branch against the learnings before the PR; trail team shows overlap between branches
- MCP server exposes the map to other agents

## Caveats

- According to the project, it cuts cost by 32% and time by 60% across 162 runs; these are the maker's own numbers, not verified.
- Free CLI (MIT); a paid team workspace is announced as 'coming soon', with no price.
- Anonymous telemetry is on by default and can be disabled; requires Node.js 22.3 or higher.

## Similar on Wunderlust

- [REA](https://wunderlust.xyz/r/rea.md): A reverse-engineering MCP server and CLI for agents
- [Agent Beacon](https://wunderlust.xyz/r/agent-beacon.md): An open source memory layer that reuses session history across agents
- [Obsidian Local REST API](https://wunderlust.xyz/r/obsidian-local-rest-api.md): An Obsidian plugin that exposes the vault through a local API and MCP server
- [Playwright CLI](https://wunderlust.xyz/r/playwright-cli.md): Playwright's CLI, designed for agents to control the browser using few tokens
- [CLI-Anything](https://wunderlust.xyz/r/cli-anything.md): Generates CLIs so agents can operate software like GIMP, Blender and LibreOffice
- [OmniRoute](https://wunderlust.xyz/r/omniroute.md): An open source gateway that routes AI tools through an OpenAI-compatible endpoint
