Excise v0.1.0 — surgical context editing
First runnable release of Excise — a per-turn surgical editor for coding-agent session context.
The problem
Anthropic's own docs admit it: "If you've corrected Claude more than twice on the same issue in one session, the context is cluttered with failed approaches." Claude Code / Codex / Cursor give you /clear (nuke everything) and /compact (summarize everything) — but nothing in between. When a 4-hour session goes off the rails on a bad approach, your only escape is start over.
Excise gives you the scalpel that was missing.
What it does
excise list <session>— show every turn in a Claude Code or Cursor session with role + token estimate + content preview.excise pick— interactive bubbletea TUI; mark turns for removal with vim keys, hit enter to commit.excise cut 5-7,9— non-interactive surgical removal by turn range.excise rollback— every edit auto-snapshots before/after; restore in one command. Snapshots prune after 30 days.
Dependency-aware: when you excise an assistant turn that issued tool_use, Excise also removes the matching tool_result so the next turn doesn't reference a phantom call. Two invariants checked on every write: closure (no orphans) and round-trip (replaying the edited session produces the same sha as the writer output).
Supported sessions
- Claude Code (m1) —
~/.claude/projects/<encoded-cwd>/<uuid>.jsonl. Schema verified against a real session on the maintainer's machine; tests use fixtures matching the actual shape. - Cursor (m2) —
~/Library/Application Support/Cursor/User/globalStorage/state.vscdb(cursorDiskKVtable,bubbleId:<composer>:<bubble>keys). Read-only against Cursor's live db; emits a side-car.excised.jsonlso an open Cursor session is never corrupted. - Rollback (m3) — snapshots at
~/.excise/snapshots/<session-id>/<iso>.jsonl.gz.
Stack
- Go 1.24, single binary, zero network.
- bubbletea + lipgloss TUI; cobra CLI; pure stdlib for jsonl;
sqlite3CLI for Cursor (no CGO).
Tests
14 PASS / 0 FAIL across 3 packages. Covers: dependency closure invariant, orphaned-result warning, round-trip after excise, snapshot+rollback, TUI state machine + token math, Cursor auto-detect, Claude loader against the real-machine sample.
What's next
v0.2 will tighten the Cursor write path (currently emits side-car JSONL; goal is in-place vscdb update behind a --unsafe-inplace flag). Codex / Aider support is explicitly out of scope until v0.1 ships traction signal — Excise stays focused.
🤖 Auto-shipped from ai-radar pipeline scan-2026-05-18-1216 (winner: need_t3c7gg07, surgical context editing).