Automation & Agents
Your Fix Isn't Broken — Your Server Just Didn't Restart
You change the code, test the new feature, and nothing happens. Most people's first instinct is to doubt their own logic. But for any long-running service, saving a file doesn't make it reload — ask the running process what it actually knows before you doubt your code. It's usually an order of magnitude faster.
One Core Idea
For a long-running service, saving a file does not mean it’s live.
Any process you start once and that keeps running in the background (a dev API server, a background daemon, any long-lived process) does not automatically reload your edited source file — unless you’ve specifically enabled auto-reload (many frameworks offer this, but it’s usually off by default).
In other words: the code you just changed may not be running at all right now. It’s new on disk, but the process in memory is still running the old version.
This is completely different from a one-shot script that reads the latest file every time it runs. Only long-running services have this “saved ≠ live” trap.
How To Do It
Step 1 | Confirm what you’re editing is actually a long-running service
Ask yourself: is this a program that you (or some automation) start once and it keeps running in the background, and you interact with it over the network or some interface? If yes, keep reading. If it’s a one-shot script that re-reads the whole file every run, skip this — your bug is probably actually in the code.
Step 2 | Find a way to check the service’s current state
Different services have different ways to check. Pick whichever applies:
- If it’s an API service (FastAPI/Flask/Express etc.): hit its built-in API doc endpoint (many frameworks auto-generate one, like
/docsor/openapi.json) and check whether the routes/fields listed match what’s in your source. - If there’s no such endpoint: pick something you recently added or changed and call it directly with the simplest possible request, and check whether the response matches the logic in your source.
- If you have no idea how to do either: this is exactly what to ask an AI — see the prompt below.
Step 3 | Compare the result and diagnose
- If what the service returns doesn’t match your source (e.g. you added a feature but the service says “not found”) → the service hasn’t picked up the new code. Go straight to Step 4.
- If what the service returns matches your source but the behavior is still wrong → this time it’s a real logic bug; checking the code is the right move.
Step 4 | Restart the service, then verify again
Find the process for that long-running service, stop it, and start it again with your launch command. After restarting, repeat Step 2 to confirm it now matches your source.
Step 5 | Don’t just verify the one feature you changed — check what else the service touches
If this service handles several features, spend a minute testing the other related ones too — since it was running a stale version, anything else that changed during that window may also not have taken effect, not just the one thing you were testing.
Pitfalls You Will Hit
- Assuming “I just saved, so it should be live now”: saving and “the service has picked up the new code” are two different events, separated by a restart. Many frameworks have an auto-reload option for development — check if yours does and turn it on.
- Doubting the wrong thing and wasting time re-reading your code line by line: the instinct is “something’s broken, so I must have written it wrong,” but for long-running services the trap is usually not the logic — it’s whether that logic ever got executed at all. Always verify “did it run” before verifying “is it correct”; getting the order backwards wastes a lot of time.
- Fixing the one thing and missing that other features on the same service were also affected: a long-running service usually serves several features at once. If it’s been stale for a while, everything changed during that window may be stale too — not just what you were testing.
In one real case, a new feature kept failing every test. A single command confirmed within five minutes that the service had simply never restarted and was still running an earlier version — instead of chasing a rewrite of logic that was never broken. After restarting, every affected feature was verified with a real request, and all of them passed.
When You Get Stuck, Ask an AI
Paste this into Claude or ChatGPT, filling in your actual situation:
I'm developing a [your service type, e.g. a FastAPI backend / a Node.js server].
I just modified [what you changed, e.g. a function/route], but testing shows the
behavior doesn't match what I changed.
Please help me:
1. Determine whether this service is "long-running" (needs a manual restart to
pick up changes after saving)
2. If so, show me the simplest way (a command or endpoint) to check which
version of the code the running service currently has loaded
3. Walk me through safely restarting this service (I currently start it with
[how you launch it])
Explain in the simplest, most directly actionable steps — don't assume I already
know advanced usage of these tools.
If the command the AI suggests errors out, paste the full error message back verbatim and add “walk me through this step by step, I’m a beginner” — that usually keeps things moving.
One-Line Summary
When your code change doesn’t seem to take effect, don’t rush to doubt your own logic — spend a few seconds confirming whether the long-running service actually reloaded your new version. That one habit saves a lot of time you’d otherwise spend re-reading code that was never broken.
This is part of an ongoing series of field notes and AI tool tests. To get the full SOPs and future posts, subscribe to the newsletter.
Support this work:Support on Ko-fi