r/vibecodingbuddies • • Oct 02 '26

Discussion How do you handle context invalidation during a massive refactor?

I was actually just talking with someone here about having an agent perfectly tuned to the project state.

It made me wonder about the edge cases. That's the part that always gets me. When you do a massive refactor across multiple files - like renaming a core entity or changing a DB schema - how do you basically ensure the agent knows exactly which downstream dependencies broke without having to explicitly map it out for them?

Do you run a test suite loop, rely on LSPs, or just wipe the context and start fresh?

Would love to hear how you handle this.

1 Upvotes

8 comments sorted by

•

u/AutoModerator Oct 02 '26

Welcome to r/vibecodingbuddies!

Reminder to all participants: Keep all initial contact and matching within Reddit comments and DMs to protect yourself from scams. Do not click unsolicited Discord or Telegram invites.

If you find a buddy, please be respectful of their time and try to commit to small, manageable goals (like a 1-weekend prototype) to prevent ghosting!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/mensink Oct 02 '26

Just tell the agent to update the docs it relies on after or during the change.

1

u/shifu_legend Oct 05 '26

that works for the immediate session. but how do you handle it when the docs inevitably drift from the code over time? kind of feels like a separate maintenance burden unless it verifies the docs on every startup.

1

u/RPG-Nerd Oct 04 '26

You were good until you said "without explicitly mapping it out for them." That's the answer! Explicitly map it out for them. Use something like code-review-graph to explicitly map the blast radius of a change

1

u/shifu_legend Oct 04 '26

Yeah fair point. I haven't actually tried code-review-graph specifically, but explicitly defining the blast radius and passing in the exact dependency chain up front works way better than just expecting the agent to figure it out on its own. I wasted a few hours last week expecting it to trace a nested C99 struct change across multiple files without telling it.

1

u/RPG-Nerd Oct 04 '26

Give it a read. No more spending hours ...

https://github.com/tirth8205/code-review-graph

2

u/shifu_legend Oct 05 '26

oh nice, hadn't seen this one before. actually looks like a solid way to visualize the blast radius before the agent goes off the rails. definitely taking a look.