A Quick Fix Is Different From the Correct Fix

October 18, 2026

We ran into an interesting issue recently at TracerLabs.

Our development servers were reloading far more than they should, especially when handing the environment over to an agent. Tests were also becoming increasingly flaky.

The first fix was pretty straightforward.

We configured Django's development server to ignore directories that didn't need to be watched:

python manage.py runserver_plus \
  --exclude-pattern '*/temp/*' \
  --exclude-pattern '*/media/*' \
  --exclude-pattern '*/.mypy_cache/*' \
  --exclude-pattern '*/.ruff_cache/*' \
  --exclude-pattern '*/.pytest_cache/*'

It worked.

Reloads went down, and things became much more usable.

But it also felt like we were treating the symptom rather than the problem.

So we looked at what Django was actually doing.

Django's StatReloader periodically checks the files it knows about for changes. The implementation is here.

That led us to our template configuration:

"TEMPLATES": [
    {
        # ...
        "DIRS": [
            BASE_DIR,
            os.path.join(BASE_DIR, "backend/templates"),
        ],
    },
]

BASE_DIR was the root of the repository.

We had effectively told Django that the entire project was a place to look for templates.

The fix was much simpler:

"DIRS": [
    os.path.join(BASE_DIR, "backend/templates"),
],

After that, we didn't need to keep adding exclusions for directories that happened to exist in the repository.

The interesting part was that the first solution wasn't wrong.

It solved the problem we had asked about: how do we reduce the number of reloads?

The second solution came from asking a slightly different question: why are we watching so many files in the first place?

AI was useful throughout this. It helped with a lot of the surrounding refactoring and got us to a working mitigation quickly.

That's probably a distinction worth keeping in mind as AI gets better at writing code.

A quick fix can be exactly what you need right now. Sometimes you need to reduce the impact first and investigate the underlying issue afterwards.

But a quick fix and the correct fix aren't necessarily the same thing.

The useful skill is knowing when to stop patching the symptom and ask why it's happening in the first place.