deploy-from-stale-worktree-silent-rollback

deploy-from-stale-worktree-silent-rollback is a skill for Claude Code from wan-huiyan/agent-traffic-control. It costs 405 tokens per session (5,588 once invoked), scanned A, original, MIT.

A deployment troubleshooting guide for services built from files in a local checkout, such as Cloud Run or Docker deployments.

In plain words
What is it for?
Use it to check the build directory, Git worktree, branch age, and deployed code when recent fixes are missing.
Why use it?
It helps find cases where deployment succeeds but uses an old worktree, causing already-fixed code to disappear from production.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions subagents; mentions Claude Code.

Part of the agent-traffic-control plugin — 107 skills shipped together

Good fit Use it to check the build directory, Git worktree, branch age, and deployed code when recent fixes are missing.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wan-huiyan/agent-traffic-control/deploy-from-stale-worktree-silent-rollback
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add wan-huiyan/agent-traffic-control --skill deploy-from-stale-worktree-silent-rollback
Clone the repo
git clone --depth 1 https://github.com/wan-huiyan/agent-traffic-control

Made for: Claude Code.

Or install agent-traffic-control, the plugin that ships this one along with the rest of its 107 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for deploy-from-stale-worktree-silent-rollback

README.md
[![agentmods](https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/deploy-from-stale-worktree-silent-rollback/github.svg)](https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/deploy-from-stale-worktree-silent-rollback)
Your own site
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/deploy-from-stale-worktree-silent-rollback"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/deploy-from-stale-worktree-silent-rollback/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for deploy-from-stale-worktree-silent-rollback

Your own site · 80×15
<a href="https://agentmods.dev/skills/wan-huiyan/agent-traffic-control/deploy-from-stale-worktree-silent-rollback"><img src="https://agentmods.dev/badge/skills/wan-huiyan/agent-traffic-control/deploy-from-stale-worktree-silent-rollback.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 405 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,588 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00405 $0.05588
Opus 5 $0.00202 $0.02794
Sonnet 5 $0.00081 $0.01118
Haiku 4.5 $0.00040 $0.00559

Measured 12d ago against content hash f987839313f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

deploy-from-stale-worktree-silent-rollback scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/agent-traffic-control/skills/deploy-from-stale-worktree-silent-rollback/SKILL.md · 460 lines

How it starts

The opening of the file, as written. The whole thing — 460 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Deploy from a stale worktree silently rolls back merged fixes

Problem

The user merged a PR (or many PRs), redeployed the serving service, and reports the fix isn't live — sometimes "a lot of fixes regressed". The deployed image is brand new (recent timestamp, latest revision) and the deploy succeeded green. The diff between code and what's deployed is not a baking issue, not a browser cache issue — the image itself contains old code.

This happens when the deploy script's build context is the local filesystem (gcloud builds submit ... "${LOCAL_DIR}", docker build <dir>, gcloud run deploy --source <dir>, kaniko --context dir://...) and the user runs it from a stale checkout. With many git worktrees, it is easy to be sitting in worktrees/foo/ 21 commits behind main and not notice — the deploy ships whatever is on disk.

Trigger conditions

All of these are typical:

  1. The repo has a deploy script that uses one of:
    • gcloud builds submit --tag=... "${SCRIPT_DIR}" (no commit SHA tag)
    • docker build -t ... <local-dir> then push
    • gcloud run deploy --source <local-dir>
  2. The user has multiple checkouts of the same repo (worktrees, sibling clones, IDE-managed copies). git worktree list shows ≥3 worktrees.
  3. The user reports a regression after a self-initiated deploy (serving.knative.dev/creator on the new revision is the user's email, not a CI service account).
  4. The "regressed" PRs were all merged BEFORE the deploy timestamp — they exist on origin/main but not necessarily in the local cwd.
  5. There is no commit SHA visible on the deployed image (only :latest or no tag at all). This is a strong tell that the build context was local FS, not a git ref.

Pre-deploy preflight (catch the trap BEFORE it fires)

Run this preflight from the deploy script's directory before you invoke the build. It costs ~1s and catches every variant of this trap without needing to inspect Cloud Build tarballs after the fact.

Read the full file on GitHub · 460 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 460 lines · 405 tokens per session scan A f987839313f9

Subscribe to this mod's changes

deploy-from-stale-worktree-silent-rollback is a skill published in the GitHub repository wan-huiyan/agent-traffic-control (3 stars, last pushed today), licensed MIT. It adds 405 tokens to every session and 5,588 once invoked, about $0.0020 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

deploy-mcp

Deploy the FutureSearch MCP server to staging or production on GKE. Use when the user wants to deploy, redeploy, roll back, scale replicas, or check deployment status. Triggers on deploy, redeploy, staging, production, rollout, scale, replicas.

futuresearch/futuresearch-python · 58 tokens

kubernetes-architect

Expert Kubernetes architect specializing in cloud-native infrastructure, advanced GitOps workflows (ArgoCD/Flux), and enterprise container orchestration.

ushibo/brigade · 31 tokens

cloudflare-cron-triggers

Cloudflare Cron Triggers for scheduled Workers execution. Use for periodic tasks, scheduled jobs, or encountering handler not found, invalid cron expression, timezone errors.

secondsky/claude-skills · 38 tokens

cloudflare-nextjs

Deploy Next.js to Cloudflare Workers via the OpenNext adapter (@opennextjs/cloudflare). Use for SSR/ISR/SSG/App or Pages Router, getCloudflareContext, bindings (D1/R2/KV/AI/Hyperdrive), caching tiers, skew protection, multi-worker, custom worker, env vars, or worker…

secondsky/claude-skills · 89 tokens

cloudflare-browser-rendering

Cloudflare Browser Rendering with Puppeteer/Playwright. Use for screenshots, PDFs, web scraping, or encountering rendering errors, timeout issues, memory exceeded.

secondsky/claude-skills · 37 tokens

cloudflare-queues

This skill should be used when the user asks to "set up Cloudflare Queues", "create a message queue", "implement queue consumer", "process background jobs", "configure queue retry logic", "publish messages to queue", "implement dead letter queue", or encountering "queue timeout", "message retry", "throughput…

secondsky/claude-skills · 78 tokens