MIT · single Go binary · local-first

Sift the repo.
Keep the signal.

sift walks a project directory, ranks files by git relevance, and renders one LLM-ready context document. Token budgeting, secret redaction, and signature-only compression are built in.

Single Go binary, no account or server round-trip. Also on Homebrew, Scoop, and as prebuilt binaries. Source on GitHub.

Noise stays gray and drops out. Everything else gets ranked, then rendered full or as signatures until the budget runs out.

Context curation is the bottleneck

Three ways teams feed code to models today, and why each breaks down.

Raw concatenation doesn't rank. Piping every file into a prompt ships vendored code, lockfiles, build output, and secrets, unranked and over budget.

A cloud service sees your code. Hosted context tools charge per seat and upload your repository. sift is a local MIT-licensed binary. Nothing leaves your machine.

Hand-picking doesn't scale. Choosing files by hand stops working past a dozen. Git-relevance ranking re-curates on every run, for free.

One document, ranked and trimmed to fit

Two ideas do the heavy lifting. Four more handle the details.

Git-relevance ranking.

Modified files first, then recent diffs, then recent commits, weighted with churn and import fan-in, so the files you actually touched lead the document.

Signature compression.

--mode signatures keeps declarations and doc comments via tree-sitter and drops function bodies. The full structure at a fraction of the tokens.

Token budgets.

Set --budget and sift keeps the highest-priority files inside your model's context window.

Secret redaction.

AWS, GitHub, Slack, Google, and Stripe keys are redacted before anything renders. On by default.

Interactive picker.

A dual-pane TUI with per-file FULL/SIGS/SKIP modes, smart-select, and task prompts.

Incremental deltas.

sift delta renders only what changed since your last dump, as full files or a raw patch.

TRY IT

Drag the budget. Watch the document reshape.

An illustrative simulation of how sift fills a token budget by rank.

used: 0 tok
RankFileModeTokens
01internal/api/handler.go
02internal/api/router.go
03cmd/api/main.go
04internal/api/middleware.go
05internal/store/postgres.go
06README.md
07internal/store/query.go
08internal/legacy/parser.go
09go.mod
10internal/config/load.go

Illustrative. Real token counts depend on your files and model.

Same file. A fraction of the tokens.

// Rank orders files by git relevance, highest first.
func Rank(files []File, opts Options) []File {
	scores := make(map[string]float64, len(files))
	for _, f := range files {
		scores[f.Path] = score(f, opts)
	}
	sort.SliceStable(files, func(i, j int) bool {
		return scores[files[i].Path] > scores[files[j].Path]
	})
	return files
}

11 lines

Eight ways to generate the document

Run sift --help or sift <command> --help for the full flag list.

CommandWhat it does
siftLaunch the interactive picker
sift dump [path]Render every eligible file in the tree
sift pick [path]Select files interactively, then render
sift select [path]Auto-select the most useful files and render them
sift diff [ref]Render only files changed relative to a git ref
sift delta [path]Render only changes since the last recorded dump
sift watch [path]Re-render the document whenever files change
sift serveLocal, password-locked web UI (alternative to the terminal picker)

A picker built for the keyboard

Mark files FULL, SIGS, or SKIP and watch the token total move.

sift pick · ~/code/apibudget 60k · 41,820 tokExplorer9 files in scope▾ cmd/✓main.goFULL1,800▾ internal/▾ api/▸✓handler.goFULL4,200✓router.goFULL2,100◐middleware.goSIGS520▾ store/◐postgres.goSIGS900✗legacy/parser.goSKIP0✓README.mdFULL2,600✓go.modFULL400Preview: internal/api/handler.goGo · FULL · 4,200 tokens · full source view1234567891011121314package api // Handler dispatches incoming context pack requests.type Handler struct { store *store.Postgres budget int} // ServeHTTP renders the ranked document within token limit.func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { doc := sift.RankAndPack(r.Context(), h.budget) json.NewEncoder(w).Encode(doc)}func Route(mux *http.ServeMux) { /* ... */ }41,820 tokens · Style: markdown70%Space Select · / Filter · s Smart · Enter Render · ? Help

Illustrative layout.

Built for agents too

sift ships an MCP server so coding agents can request exactly the context they need, over stdio.

pack_context

Pack ranked, budgeted context for a path.

pack_diff

Pack only files changed relative to a git ref.

list_tree

List the project tree the agent can choose from.

MCP server docs →

Install in one line

macOS and Linux:

curl -fsSL https://bethropolis.github.io/sift/install.sh | sh

Homebrew, Scoop, go install, and building from source are on the install page.