10. Safe Legacy Refactoring (How to Rewrite 50k Lines Without Breaking Prod)

10. Safe Legacy Refactoring (How to Rewrite 50k Lines Without Breaking Prod)

This is one of the most dangerous moves you can make as an engineer:

Letting AI rewrite your legacy system.

In this episode, we confront that risk head-on.

Because if you’ve ever tried something like
“Claude, clean up this code”
you already know what happens next…

You get beautifully structured, modern code—
that completely breaks your production environment.

So how do you actually do this safely?

We walk through a battle-tested framework used in real engineering environments.

And it starts with a surprising rule:

Do not refactor first.

Instead, you force Claude to write characterization tests—capturing exactly how your messy, fragile, legacy code behaves today. Before you change anything, you lock reality in place.

From there, we build strict guardrails:

  • Use hierarchical CLAUDE.md to constrain behavior and decisions
  • Force an incremental loop: small change → run tests → verify
  • Never allow uncontrolled, large-scale rewrites

This is how you turn AI from a reckless optimizer into a disciplined engineer.

But even then, you’re not done.

Because the most dangerous bugs are the ones that look correct.

We dive into how to review AI-generated Pull Requests like a professional:

  • Catch hallucinated APIs that don’t exist
  • Identify subtle logic breaks that pass tests
  • Spot real security risks like SQL injection vulnerabilities

This episode isn’t about using AI faster.

It’s about using AI without breaking everything you’ve built.

If you want the full system for working with AI in real-world codebases—from safe refactoring to scalable workflows—
it’s all laid out in the book:

👉 https://www.amazon.com/dp/B0GQVHJRGB

Because the future isn’t AI replacing engineers.
It’s engineers who know how to control AI.

Denne episoden er hentet fra en åpen RSS-feed og er ikke publisert av Podme. Den kan derfor inneholde annonser.

Episoder(35)

20. Teams, Sessions and Worktrees (Four Ways to Run AI Work in Parallel)

20. Teams, Sessions and Worktrees (Four Ways to Run AI Work in Parallel)

In Episode 20 of Beyond Prompting, author Sho Shimoda clarifies how to run multiple AI tasks concurrently without getting tangled in state or disk conflicts. While Chapter 19 focused on subagents, Cha...

16 Okt 35min

19. Preventing Context Pollution with Subagents (Delegating Heavy Lifting)

19. Preventing Context Pollution with Subagents (Delegating Heavy Lifting)

In Episode 19 of Beyond Prompting, author Sho Shimoda explores how to manage complex, search-heavy engineering tasks without cluttering your main conversation window using Subagents. When an agent rea...

14 Okt 52min

18. Packaging and Distributing Workflows (Plugins and Marketplaces)

18. Packaging and Distributing Workflows (Plugins and Marketplaces)

In Episode 18 of Beyond Prompting, author Sho Shimoda explores how to bundle your team's custom skills, commands, subagents, hooks, and MCP server configurations into a single, installable unit using ...

12 Okt 29min

17. Connecting Systems with MCP (The Stateless Wire Protocol)

17. Connecting Systems with MCP (The Stateless Wire Protocol)

In Episode 17 of Beyond Prompting, author Sho Shimoda breaks down the Model Context Protocol (MCP)—the open standard that connects Claude Code to external systems like ticket trackers, wikis, and data...

11 Okt 47min

16. Packaging Standard Operating Procedures (Agent Skills)

16. Packaging Standard Operating Procedures (Agent Skills)

In Episode 16 of Beyond Prompting, author Sho Shimoda breaks down how to turn your team's recurring instructions and workflows into executable Agent Skills. Rather than re-explaining multi-step proced...

9 Okt 50min

15. Prompt Caching and Durable State (The Economics of Context and Memory)

15. Prompt Caching and Durable State (The Economics of Context and Memory)

In Episode 15 of Beyond Prompting, author Sho Shimoda breaks down prompt caching—the single largest cost lever in the Claude Code ecosystem—and demonstrates how to manage long-term project memory. We ...

5 Okt 48min

14. Memory, Compaction and Checkpoints (Managing Context in Long Sessions)

14. Memory, Compaction and Checkpoints (Managing Context in Long Sessions)

In Episode 14 of Beyond Prompting, author Sho Shimoda breaks down how to manage context budgets and session state when conversations run long. We examine the three core mechanisms that control what Cl...

4 Okt 45min

13. Curing AI Amnesia (CLAUDE.md and Rules)

13. Curing AI Amnesia (CLAUDE.md and Rules)

In Episode 13 of Beyond Prompting, author Sho Shimoda breaks down how to configure persistent repository instructions using CLAUDE.md and rule files. Rather than treating CLAUDE.md as a generic style ...

30 Sep 46min

Populært innen Teknologi

energi-og-klima
teknisk-sett
lydartikler-fra-aftenposten
elektropodden
nasjonal-sikkerhetsmyndighet-nsm
tomprat-med-gunnar-tjomlid
rss-ai-forklart
rss-alt-som-gar-pa-strom
rss-kunstig-intelligens-med-elisabeth-maren-og-morten
shifter
smart-forklart
fornybaren
rss-alt-vi-kan
rss-bak-skyen
pedagogisk-intelligens
rss-romnasjonen
rss-teknologioptimistene-en-podkast-om-teknologi-og-mennesker
rss-heis
rss-larervarelset
rss-hvorfor-ble-det-sann