Skip to content
Skill

Flask debug cross worktree edit stale

Diagnoses why a local dev server serves stale files when edits sit in another git worktree

Flask debug cross worktree edit stale is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
5
Last commit
License
MIT
Listing updated

Similar skills

About Flask debug cross worktree edit stale

This skill helps an agent work out why a Flask or similar local dev server keeps returning old page content after edits were made in a sibling git worktree of the same repository. Each worktree has its own files on disk, so the running server reads a different copy than the one being edited. The skill gives a quick check: compare a recent edit marker in both worktree paths with diff, then confirm which directory the server process runs from using lsof.

It then lays out three remedies in order of safety: fast-forward merging the edit branch into the running worktree's branch, moving the dev server to the worktree being edited, or copying a single file as a one-off probe. It also includes a curl-based verification step and a table that separates this cause from TTL caches, bytecode caching and browser caching.

The workflow expects a macOS or Linux shell with git, lsof and curl available, and a running local server. The examples are written for Flask but the approach is described as applying to other file-watching dev servers.

When your agent uses it

Diagnose "I edited the template / view / CSS but Flask debug-mode keeps serving the old version" when running a local dev server (Flask, Django runserver, Rails server, etc.) from one git worktree while editing files in a sibling worktree of the same repo. Use when: (1) you have multiple `git worktree` checkouts of the same repo (typical with `.claude/worktrees/<feature>` directories), (2) a dev server is running in worktree A serving its working tree, (3) you're making edits in worktree B because branch X is checked out at A and you can't `git checkout X` in B too, (4) `curl http://127.0.0.1:PORT/page` returns byte-identical responses despite your edits, (5) you're tempted to blame Jinja bytecode cache, Flask `@_ttl_cache`, or browser caching. Root cause is filesystem-level: each git worktree has its own independent working tree on disk; Flask is reading worktree A's files, not worktree B's. Cache-busting tricks (`touch app.py`, browser hard refresh, restart Flask) won't help. Sister skill to `flask-debug-tt

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 1 file (9 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the agent-traffic-control plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add wan-huiyan/agent-traffic-control
/plugin install agent-traffic-control@wan-huiyan-agent-traffic-control

Or copy only this skill to ~/.claude/skills/flask-debug-cross-worktree-edit-stale:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/flask-debug-cross-worktree-edit-stale &&
cp -R "$tmp/plugins/agent-traffic-control/skills/flask-debug-cross-worktree-edit-stale" ~/.claude/skills/flask-debug-cross-worktree-edit-stale &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/flask-debug-cross-worktree-edit-stale inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/flask-debug-cross-worktree-edit-stale to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/flask-debug-cross-worktree-edit-stale &&
cp -R "$tmp/plugins/agent-traffic-control/skills/flask-debug-cross-worktree-edit-stale" ~/.agents/skills/flask-debug-cross-worktree-edit-stale &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/flask-debug-cross-worktree-edit-stale inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/flask-debug-cross-worktree-edit-stale to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/flask-debug-cross-worktree-edit-stale &&
cp -R "$tmp/plugins/agent-traffic-control/skills/flask-debug-cross-worktree-edit-stale" ~/.cursor/skills/flask-debug-cross-worktree-edit-stale &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/flask-debug-cross-worktree-edit-stale inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/wan-huiyan/agent-traffic-control.git --path plugins/agent-traffic-control/skills/flask-debug-cross-worktree-edit-stale

Or copy the folder to ~/.gemini/skills/flask-debug-cross-worktree-edit-stale yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/flask-debug-cross-worktree-edit-stale:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/flask-debug-cross-worktree-edit-stale &&
cp -R "$tmp/plugins/agent-traffic-control/skills/flask-debug-cross-worktree-edit-stale" ~/.copilot/skills/flask-debug-cross-worktree-edit-stale &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/flask-debug-cross-worktree-edit-stale inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control.git

Then copy agent-traffic-control/plugins/agent-traffic-control/skills/flask-debug-cross-worktree-edit-stale into your agent's skills folder as flask-debug-cross-worktree-edit-stale. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Cross-worktree mismatch check
Compares a marker string in the running worktree and the editing worktree to confirm the files actually differ.
Server working directory check
Uses lsof to verify which worktree the dev server process is reading from.
Fast-forward merge fix
Commits edits in the editing worktree and merges them into the running branch with --ff-only.
Relocate the dev server
Restarts the server from the worktree where edits are being made.
Verification with curl
Checks that the served page now contains the expected edit marker.
Symptom to cause table
Separates this worktree problem from TTL cache, bytecode cache and browser cache issues.

Good for

  • Why does my Flask page still show old content after I edited the template in another worktree?
  • Merge my committed edits into the branch the dev server is running from
  • Check whether the dev server is reading files from a different git worktree
  • Restart the local dev server from my editing worktree instead
  • Confirm my CSS change appears on the running localhost page

Flask debug cross worktree edit stale FAQ

When should Flask debug cross worktree edit stale trigger?

When multiple git worktrees of the same repo exist, a dev server runs from one of them, edits are made in another, and curl returns identical responses despite saved changes.

Does Flask debug cross worktree edit stale only work with Flask?

The skill uses Flask as its example but states that Django runserver, Rails server and similar file-watching servers share the same cause and fixes.

Which operating systems are covered?

It covers macOS and Linux. Windows worktree subtleties such as line-ending translation and junction points are not covered.

Does the skill change any files by itself?

The skill describes git commands and a file copy for the user or agent to run; the fixes involve committing, merging or restarting the server.

How do I install Flask debug cross worktree edit stale in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/flask-debug-cross-worktree-edit-stale to use it in all your projects, or to .claude/skills/flask-debug-cross-worktree-edit-stale in one project. Or install the agent-traffic-control plugin, which includes it: /plugin marketplace add wan-huiyan/agent-traffic-control, then /plugin install agent-traffic-control@wan-huiyan-agent-traffic-control.

Does Flask debug cross worktree edit stale run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Flask debug cross worktree edit stale?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Flask debug cross worktree edit stale?

The closest alternatives to Flask debug cross worktree edit stale are Git worktree, Deploy from stale worktree silent rollback, Harness read write base repo path in worktree stale tree, Cross worktree spec handoff via checkout paths and Injected claude md is the worktrees copy not mains.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from wan-huiyan/agent-traffic-control