447f939a302bf600febf73d8bdc125d5ded691cenone
CLAUDE.mdTool: claude-code# zsh-clean-history
Smart zsh history cleaner. Removes typos, failed commands, and duplicates from
`~/.zsh_history` via similarity analysis. Rust binary + a zsh plugin wrapper.
## Architecture
Data flow: `zsh-clean-history.plugin.zsh` records exit codes → `clean.rs` orchestrates
a run → `history.rs`/`exits.rs` parse → `cleaner.rs` decides removals → `clean.rs`
writes atomically and logs via `log.rs`.
- **I/O edge** — `clean.rs` owns locking, backup, atomic write, exit-code compaction;
it is .claudeTool: claude-codeAGENTS.mdTool: agents-mdCLAUDE.md.github/copilot-instructions.mdTool: github-copilot# Code Review Instructions
## Project Context
**Stack:**
- Language: Rust (edition 2024, MSRV 1.85)
- Shell: zsh
- Build/Dev: mise, Cargo
- Testing: cargo test, proptest (property-based), criterion (benchmarks), assert_cmd (CLI integration)
- Linting: cargo clippy (`-D warnings`), cargo fmt
**Purpose:**
Smart zsh history cleanup plugin — removes typos and failed commands via similarity analysis
**Core Modules:**
- `src/similarity.rs`: Damerau-Levenshtein distance, BK-tree indexing, token normalizationnone