Settings

Theme

Show HN: A deterministic code-rewrite engine that learns from one example

2 points by heavymemory 6 days ago · 0 comments · 1 min read

Reader

I built a tool that learns structural code transformations from a single before/after example.

It isn’t a transformer or LLM — it doesn’t generate code. It extracts the structural pattern between two snippets and compiles a deterministic rewrite rule. Same input → same output, every time.

Examples: • console.log(x) → logger.info(x) generalises to console.log(anything) • require(“x”) → import x from “x” • ReactDOM.render → createRoot • custom project conventions

The rules apply across an entire codebase or through an MCP plugin inside Claude Code, Cursor, or plain CLI.

It runs entirely on CPU and learns rules in real time.

Tool: https://hyperrecode.com I’d really appreciate feedback on the approach, design, or failure cases.

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection