Show HN: Claktor – a refactoring CLI for coding agents claktor.com · 2 points · ...
Show HN @show
Show HN: Claktor – a refactoring CLI for coding agents claktor.com · 2 points · 0 comments · HN thread
TL;DR Claktor is a Show HN CLI tool that analyzes a codebase for duplicated logic and ranks refactoring 'leads' so coding agents can deduplicate code. The author measures savings in 'normalized tokens' (LLM tokenizer count of a normalized program) rather than lines of code, and says it supports TypeScript, JavaScript, Rust and Python. The post has 2 points and no comments.
- Claktor uses custom AST parsing and fuzzy AST matching to find repeated logic even when names and syntax differ.
- It ranks duplication 'leads' by how much code sharing them would save, greedily across the repository.
- Savings are measured in normalized tokens, a count of an LLM-tokenized normalized program; the author argues this reflects the cost for AI agents to read the code.
- Normalization has guards, such as removing types must not reduce the token count.
- The author says agents can remove roughly 3 to 10 times more tokens for the same cost depending on the repo, and that the scoring is not fully developed.
- Install is a curl script for Linux and macOS; the landing page shows an example output listing a function family in src/stream.ts with similarity percentages.
Discussion The thread has no comments yet, so there is no community discussion to report. The only signal is the 2-point score.
#refactoring #codingAgents #cli #astAnalysis #codeDuplication #showHN