Skip to content

Excise v0.2.0 — heuristic suggestions

Choose a tag to compare

@SuperMarioYL SuperMarioYL released this 18 May 07:35
· 5 commits to main since this release

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.