Quickstart
Install
Pick one:
npx stacklit init # no install, downloads the binary on first use
npm install -g stacklit # global install
go install github.com/glincker/stacklit/cmd/stacklit@latest # from source, needs Go
Or download a binary for macOS, Linux or Windows (amd64 and arm64) from Releases.
Check the install:
stacklit --version
First run
cd your-project
stacklit init
Typical output:
[stacklit] found 342 files
[stacklit] parsed 342 files (0 errors)
[stacklit] done in 89ms -- wrote stacklit.json, DEPENDENCIES.md, stacklit.html
Opening visual map...
(File counts and timing vary. Go repos index in milliseconds; Python and TypeScript repos can take seconds, see bench/RESULTS.md.)
Commit the portable outputs. stacklit.html is gitignored and regenerates with stacklit view.
git add stacklit.json DEPENDENCIES.md
git commit -m "add stacklit codebase index"
Then tell your tools about it, either automatically with stacklit setup or by hand:
Claude Code, add to CLAUDE.md:
Read stacklit.json before exploring files. Use modules to locate code, hints for conventions.
Cursor and other MCP clients, add to the MCP config:
{
"mcpServers": {
"stacklit": { "command": "stacklit", "args": ["serve"] }
}
}
Copilot, add to .github/copilot-instructions.md:
Read stacklit.json first to understand codebase structure before exploring files.
Any other agent: stacklit.json is plain JSON. Point the agent at it.
What you get
| Index | stacklit.json, a Mermaid diagram (DEPENDENCIES.md by default, set with output.mermaid) and an interactive stacklit.html map |
| Languages | 48 languages and formats indexed; symbol graph for 20 (list) |
| Queries | query, explain, impact, path, hubs, slice, each with a hard --budget |
| MCP | stacklit serve: 15 tools, or --profile minimal for 4 (about 230 tokens of schema) |
| Hooks | git post-commit refresh; optional Claude Code hook that points a grepped identifier to its definition |
| CI | export (graphml, cypher, dot, mermaid and more), check architecture rules, status freshness, merge-graphs, a GitHub Action |
| Deterministic | same repo, same bytes. A committed index only changes when the code does |
| Privacy | no telemetry, no upload. The map loads language logos from thesvg.org unless STACKLIT_MAP_ICONS=off (details) |
Generated from docs/USAGE.md in the repository, the single source of truth.