Week 2

Unfamiliar codebases

Not breaking things

Feature isolation and boundaries

Practice

Assignment

Back to Track

The single most common way an agent breaks an existing project: you ask for a feature, and it "helpfully" edits shared code — a utility, a config, a service other parts depend on. Your feature works; three other screens break. This page is about preventing exactly that.

Isolate the feature

Keep new code in its own files and modules. If your feature needs a helper, create it next to the feature — don't rewrite the shared one to fit your case. Spreading a feature across the whole project multiplies what can break and makes your diff hard to review.

Set boundaries in the prompt — explicitly

The agent doesn't know what's off-limits unless you say so. Make limits part of the task:

A good stop looks like this: the agent halts before writing any code, explains why the task can't be done cleanly within the boundary, and offers options — including, sometimes, a "technically-inside-the-folder" workaround that it flags as a bad idea. That last part matters: the boundary protects the architecture, not the folder. An agent (or a developer) that sneaks around the spirit of a rule while respecting its letter is doing more damage than one that asks.

Boundaries that repeat on every task belong in CLAUDE.md (Week 1) — that's exactly what its "Do not" section is for. In a shared repo, this protects the whole team, not just you.

Screenshot 2026-08-01 at 2.31.24 PM.png

Touching shared code = mandatory manual review

Sometimes the shared change is genuinely needed. Then the rule is: you review it yourself, line by line, deliberately. Not a skim — an actual read with the question "what else depends on this?" Ask the agent: "what other parts of the project use this function/config? list the call sites." Then check the key ones.

This is where "what worked yesterday broke today" almost always comes from — and where your review earns its keep.


The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

CC BY-NC-SA 4.0 Icons

Built with ❤️ by the HackYourFuture community · Thank you, contributors

Found a mistake or have a suggestion? Let us know in the feedback form.