Refactoring Prompt for Post-LLM Coding Tasks
lucasmeijer · x · 2026-07-12
The author shares a prompt they append directly after every LLM coding task: asking the model to review all its changes, simplify the code as much as possible, remove dead code, reuse shareable logic, and clean up leftovers from previous attempts. They admit this might not be optimal, but it works "much better than doing nothing"; replies add that this is done within the **same context window**.
Related event: Developers Share Post-Generation Refactoring Prompt for LLM Coding(2 posts)→
More from coding & agent
- Autoresearch proposes packaging ML runs as studies with questions, analysis, and code diffs — morgymcg · 2026-07-21
- The author says Codex reached 20x and is now debugging spec decoding on a hybrid parallel setup — TheZachMueller · 2026-07-21
- Axcess adds an MCP connector for WCAG accessibility checks that scanners miss — modelcontextprotocol · 2026-07-21
- X post asks whether Cursor Composer, built on Kimi models, would also be banned — max_paperclips · 2026-07-21
- A developer’s Codex usage is draining pooled enterprise credits at a small company — Distinct_Relation_62 · 2026-07-21
- Qwen Code ships cua-driver-rs 0.7.3 with relative coordinates and MCP filtering — github-actions[bot] · 2026-07-21