Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions COMPARISON.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# AI Codebase Context Tools Comparison
# AI Codebase Context Tools - Comparison

> How do you give AI agents codebase context? Here's every approach compared.
>
> Last updated: 2026-04-10 | [Submit corrections](https://github.com/glincker/stacklit/issues)

## The Problem

AI coding agents (Claude Code, Cursor, Copilot, Aider) need to understand your codebase before they can help. Without context, they waste thousands of tokens exploring reading files, grepping, globbing just to figure out your project structure.
AI coding agents (Claude Code, Cursor, Copilot, Aider) need to understand your codebase before they can help. Without context, they waste thousands of tokens exploring - reading files, grepping, globbing - just to figure out your project structure.

Different tools solve this differently. Some dump everything. Some build knowledge graphs. Some generate compressed maps. Here's how they compare.

Expand Down Expand Up @@ -34,7 +34,7 @@ Different tools solve this differently. Some dump everything. Some build knowled
Concatenate all source files into one big prompt. Simple, works everywhere, but:
- Burns 50k-500k tokens on medium repos
- Often exceeds context windows entirely
- No structural intelligence agent still has to parse everything
- No structural intelligence - agent still has to parse everything
- Repomix's `--compress` mode uses tree-sitter to reduce output, but remains per-file (no cross-file dependency analysis)

Best for: Small repos (<5k lines), one-shot conversations, pasting into ChatGPT.
Expand All @@ -46,15 +46,15 @@ Build a queryable graph of your codebase, served over MCP:
- Rich structural data (call graphs, blast radius, community detection)
- Requires running a server process
- Each query costs tokens (tool call overhead)
- No committable artifact the knowledge lives in the server
- No committable artifact - the knowledge lives in the server

Best for: Large codebases, long interactive sessions, teams with infra capacity.

### Structural Index (Stacklit)

Parses code with tree-sitter, builds a module-level dependency graph, outputs a compact navigation map:
- **~250 tokens** for the compact map (vs 50k-500k for dumpers)
- Static artifact commit `stacklit.json` to your repo
- Static artifact - commit `stacklit.json` to your repo
- Self-contained HTML visualization
- Auto-configures Claude Code, Cursor, Aider via `stacklit setup`
- Git hook keeps the index fresh
Expand Down Expand Up @@ -124,7 +124,7 @@ Repomix counts estimated from file sizes. Stacklit counts measured directly.
## Install

```bash
# npm (easiest downloads the right binary automatically)
# npm (easiest - downloads the right binary automatically)
npm i -g stacklit

# From source
Expand Down
19 changes: 3 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ modules:
<details>
<summary>Configure manually instead</summary>

**Claude Code** add to `CLAUDE.md`:
**Claude Code** - add to `CLAUDE.md`:
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two spaces before the dash separator ("Claude Code␠␠-") which reads like a formatting typo and is inconsistent with other separators in this README (many places use " -- "). Consider using a single-space separator and/or matching the existing " -- " style.

Copilot uses AI. Check for mistakes.

```
Read stacklit.json before exploring files. Use modules to locate code, hints for conventions.
```

**Claude Desktop / Cursor (MCP)** add to MCP config:
**Claude Desktop / Cursor (MCP)** - add to MCP config:

```json
{
Expand All @@ -172,7 +172,7 @@ Read stacklit.json before exploring files. Use modules to locate code, hints for

MCP server exposes 7 tools: `get_overview`, `get_module`, `find_module`, `list_modules`, `get_dependencies`, `get_hot_files`, `get_hints`.

**Any other agent** `stacklit.json` is a plain JSON file. Any tool that reads files can use it.
**Any other agent** - `stacklit.json` is a plain JSON file. Any tool that reads files can use it.

</details>

Expand Down Expand Up @@ -292,19 +292,6 @@ html = "stacklit.html"

[Full comparison with 7 tools →](https://github.com/glincker/stacklit/discussions/13)

## Compared to alternatives

| | Stacklit | Repomix | Aider repo-map | Codebase Memory MCP |
|---|---|---|---|---|
| Output | ~4k token index | 500k+ token dump | Ephemeral text | SQLite DB |
| Committed to repo | Yes | Too large | No | No |
| Dependency graph | Yes | No | Yes | Yes |
| Visual output | HTML (4 views) | No | No | No |
| MCP server | Yes (7 tools) | No | No | Yes |
| Monorepo aware | Yes | No | No | No |
| Languages | 11 (tree-sitter) | N/A | Many | 66 |
| Runtime needed | No | No | Yes (Python) | Yes (C server) |

## Monorepo support

Auto-detects: pnpm, npm, yarn workspaces, Go workspaces, Turborepo, Nx, Lerna, Cargo workspaces, and convention directories (`apps/`, `packages/`, `services/`).
Expand Down
Loading