drift
CLAUDE.md28 starsChanged 8 months agoApache-2.0View on GitHub
drift is a two-layer tool: a comparison engine and an interactive TUI. Pure-Go diffing logic. Compare(pathA, pathB, mode) returns a *Result with a tree of Nodes representing the comparison. Detail(result, node) produces the detailed diff for a single node. Supported modes: tree (directories/archives), binary (Mach-O), plist, text. Mode is auto-detected from inputs. Key files: - compare.go - entry point, mode detection, tree comparison - directory.go - directory walking and tree building - archive.go - archive extraction (zip, tar, tar.gz, tar.bz2)…
In this repositoryOne other file it gives its agents.
- driftSkill
The file
We split this CLAUDE.md into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 49
Use lipgloss for all styling - no raw ANSI
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
Build & Test
- Build:
go build -o drift ./cmd/drift - Test:
go test ./...orgo test ./compare -run TestName - Vet:
go vet ./...
Architecture
drift is a two-layer tool: a comparison engine and an interactive TUI.
Compare engine (compare/)
Pure-Go diffing logic. Compare(pathA, pathB, mode) returns a *Result with a tree of Nodes representing the comparison. Detail(result, node) produces the detailed diff for a single node.
Supported modes: tree (directories/archives), binary (Mach-O), plist, text. Mode is auto-detected from inputs.
Key files:
compare.go- entry point, mode detection, tree comparisondirectory.go- directory walking and tree buildingarchive.go- archive extraction (zip, tar, tar.gz, tar.bz2)binary.go- Mach-O analysis via nm/size/otoolplist.go- plist conversion via plutiltext.go- line-by-line unified difftypes.go-Result,Node,DetailResulttypeshash.go- content hashing for change detection
TUI (tui/)
Bubbletea-based interactive terminal UI. Three-tier component model:
- App (
app.go) - root model, layout, keyboard dispatch - Components (
tree.go,detail.go,search.go,overlay.go,alert.go) - stateful sub-models - Views (
view_*.go,summary.go,render.go) - pure render functions, no state
styles.go- all lipgloss styleshelp.go- keybinding definitionscomponents.go- detail content builder
Entry point
cmd/drift/main.go- CLI struct, kong parser,run()method
Code style
- Views are pure functions:
func renderX(width int, data T) string - Components own state and implement
Update/View - Use lipgloss for all styling - no raw ANSI
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

