Releases: SuperMarioYL/excise
v0.4.0
v0.3.1
Changelog
Excise v0.3.0 — opt-in local-Ollama LLM rerank
[0.3.0] — 2026-05-23
Added
- Opt-in LLM rerank via local Ollama (
--llm). Layers a local model on
top of the v0.2 heuristic shortlist: heuristic stays the cheap pre-filter,
LLM only judges that shortlist and writes a one-line reason per turn. - New flags
--llm,--llm-model,--llm-hoston bothsuggestandpick. - New optional config file
excise.toml(./excise.toml→$XDG_CONFIG_HOME/excise/
→~/.config/excise/) with[llm]block:host,model,top_n,timeout_sec. internal/llm/package (tiny Ollama HTTP client + rerank logic + hard-coded
prompt template) andinternal/config/package (TOML loader with sane defaults).- New testdata
claude_session_llm_rerank.jsonl+ cmd-level tests for the
happy path, fallback path, and JSON-parse-failure path against a stubbed
Reranker. Live-Ollama integration test gated behindEXCISE_LIVE_OLLAMA=1.
Changed
suggestandpickroute the heuristic shortlist through the LLM reranker
when--llmis set. Exit codes unchanged: 0 on success (incl. graceful
fallback), 2 only on usage error.- TUI shows per-turn
LLMReasonnext to pre-marked turns when present.
Fixed
- Test helper
NewStubRerankerwas originally placed in_test.go(invisible
across packages); moved tointernal/llm/stub.goso cmd-level tests resolve. go.sumregenerated to match realBurntSushi/toml@v1.4.0checksum.
Trust contract (unchanged from v0.1/v0.2)
- No outbound network beyond the user-configured Ollama host.
- No autocut.
--llmonly changes ranking; user still confirms every excision. - No telemetry, no acceptance log, no cross-session learning.
Still out of scope
- Remote LLM API key backends (OpenAI / Anthropic / OpenRouter) — deferred to v0.4.
- Streaming LLM output / partial-rerank UI.
- LLM + autocut combination.
- User-editable prompt template.
Excise v0.2.0 — heuristic suggestions
v0.2.0 adds a pure-stdlib heuristic suggestion engine that pre-computes the top-K candidate turns to excise from a polluted session. Zero new dependencies, zero network, no LLM. Same single binary, same trust premise.
New: excise suggest
$ excise suggest ~/.claude/projects/.../session.jsonl
# role tokens heuristic preview
--- --------- ------ ---------------------------------------------- --------------------
17 assistant 2840 high_cost + user_correction_follows_up "Let me try refactoring …"
19 tool_use 420 tool_use_error + correction_follows Edit(path=foo, …) ERROR
32 assistant 3100 3rd file-edit on same file "Actually let me revert …"
33 assistant 1820 user_correction_follows_up "I'll switch to using …"
47 assistant 2200 long_drift_no_tool_calls "To summarize what we …"
5 candidates totalling ~10,380 tokens. Run `excise pick` to review interactively.
Output formats: table (default), --json for piping, --top=N for K, --min-score=X to filter.
Five heuristics (pure stdlib)
| Trigger | Rule |
|---|---|
high_token_cost |
turn ≥ 2000 estimated tokens |
repeated_file_edit |
same file path edited 3+ times in a 3-turn window |
user_correction_follows_up |
next user turn matches correction lexicon (no / wrong / actually / let me try / forget that / instead / 不对 / 重来 / 换个思路 / …) |
tool_use_error_then_correction |
tool_use returned error AND user replied with correction lexicon |
long_drift_no_tool_calls |
5+ consecutive assistant turns with no tool_use |
Bilingual correction lexicon (en + zh-CN) lives at internal/suggest/correction_lexicon.go.
TUI pre-marking
excise pick (default) now seeds the bubbletea picker with the top-K suggested turns highlighted. --no-suggest restores v0.1 behavior. Suggested turns render in a distinct color with a footer legend (◆ suggested — press space to uncheck).
What didn't change
- v0.1's session loading (Claude Code JSONL + Cursor SQLite), dependency-aware writer, snapshot+rollback — all untouched.
- Zero network. No LLM call of any kind (local Ollama / user API key — both deferred to v0.3 as opt-in plugins).
- No auto-cut. Scorer suggests; user confirms.
- No cross-session learning / acceptance log.
Tests
34 PASS / 0 FAIL across 5 packages (v0.1's 13 + 21 new for the suggest package). New test asserts the scorer's top-5 on testdata/claude_session_polluted.jsonl matches the planted failure indices.
Trust premise unchanged
Excise never talks to anything other than your local filesystem.
🤖 Auto-shipped from ai-radar pipeline scan-2026-05-18-1216 amendment v0.2.0.
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).