flask-debug-cross-worktree-edit-stalelisted
Install: claude install-skill wan-huiyan/agent-traffic-control
# Flask debug edits cross-worktree stale
## Problem
You're running a Flask dev server (`python app.py` with `debug=True`,
or `flask run --debug`) from one git worktree. You're editing template
/ static / view files from a *sibling* worktree of the same repo,
because the branch you want to ship is checked out at the running
worktree and `git checkout <branch>` fails in your editing worktree.
You hit `curl http://127.0.0.1:PORT/the-page` after each edit, and the
response bytes don't change. You hypothesize Jinja bytecode cache,
Flask `@_ttl_cache`, browser caching, CDN, or stale `__pycache__`. You
try `touch app.py` to bust Flask's debug-reload, restart the process,
clear browser cache. Nothing fixes it.
**Root cause:** git worktrees have **independent working trees on
disk**. Each `git worktree` directory has its own copy of every tracked
file. Flask is reading from `<worktree-A>/templates/page.html`. Your
edits live in `<worktree-B>/templates/page.html`. They're physically
different files; the dev server has no way to see B's edits until A's
disk state changes.
## Trigger conditions (high-confidence diagnosis)
Fire this skill when ALL of these are true:
1. `git worktree list` shows ≥2 worktrees of the same repo.
2. A dev server is bound to a known port; `lsof -i :PORT` shows the
server process.
3. The server's CWD (`lsof -p <PID> | grep cwd`, or check the script
that launched it) is in worktree A.
4. Your editor is making changes in worktree B (different path, sa