Code prompts
Code prompt

Trace why code looks the way it does

The current code looks weird. Before "fixing" it, you want to know what it survived.

Works best in: Claude

Read the git history and blame for {{path}} and explain how this code got to where it is.

I want to know:
1. **Original shape** — what did the first version look like, and what problem was it solving
2. **Inflection points** — the 3–5 commits that changed the design meaningfully (not formatting passes)
3. **Constraints that left scars** — workarounds, hacks, or strange conditionals that exist because of a specific incident or external dependency
4. **What's load-bearing** — parts that look removable but have a comment, ticket, or commit message warning otherwise
5. **What's safe to refactor** — parts that have been stable for a long time and have good test coverage

Output as a short timeline + a "before you touch this" section. Don't include commits that only changed whitespace or imports.
·Open in·Share
code-archaeologyrefactoringgit

More code prompts

All code prompts

Go deeper