stuck

A recovery guide for coding agents that repeat errors, undo the same changes, or stop making progress.

In plain words
What is it for?
It helps recover from repeated errors, failed code changes, and overly complicated fixes.
Why use it?
It prevents an agent from trying the same failed approach indefinitely by telling it when to diagnose, simplify, backtrack, or ask for help.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/5uck1ess/devkit/stuck
Any agent
npx skills add 5uck1ess/devkit --skill stuck
Clone the repo
git clone --depth 1 https://github.com/5uck1ess/devkit

Made for: Claude Code, Codex.

Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 503 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00026 $0.00503
Opus 5 $0.00013 $0.00251
Sonnet 5 $0.00005 $0.00101
Haiku 4.5 $0.00003 $0.00050

Measured 2d ago against content hash 6c802f340085, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

stuck 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 2d 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.

skills/stuck/SKILL.md · 64 lines

How it starts

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

Stuck Detection & Recovery

Symptoms

You are stuck if any of these are true:

  • Same error message appeared 2+ times in a row
  • You reverted the same change twice
  • The metric hasn't improved in 3+ iterations
  • You're making changes that don't address the actual error
  • You're adding complexity to work around a problem instead of fixing it

Recovery Protocol

0. Check the Scratchpad

Read .devkit/scratchpads/current.md first. It records what was already tried and why it failed. If the scratchpad shows 3+ failed iterations, skip straight to Step 5: Escalate — the pattern of failures is the diagnosis.

1. Stop and Diagnose

Don't retry the same approach. Read the error carefully:

  • What is the actual error message?
  • What file and line does it point to?
  • Is this the same error as last iteration, or a new one?

2. Backtrack

If the last 2+ attempts failed:

  • Revert to the last known-good state: git checkout -- .
  • Re-read the original goal and the current state of the code
  • The problem may be upstream of where you're looking

3. Simplify

Reduce scope:

  • Fix one thing at a time, not three
  • Remove the last thing you added and see if the base case works
  • Use the simplest possible implementation, even if inelegant

4. Change Strategy

If the same approach failed twice:

  • Try a fundamentally different approach, not a variation
  • Read the docs or source of the library/API you're calling
  • Check if the function signature or types changed

5. Escalate

If you've tried 3+ different approaches:

  • Report what you've tried and what failed
  • Show the exact error
  • Ask the user for guidance — they may know something you don't

Anti-Patterns

  • Retry loop — Running the same command hoping for a different result
  • Shotgun debugging — Changing multiple things at once without understanding why
  • Complexity spiral — Adding workarounds on top of workarounds
  • Ignoring the error — Suppressing or catching exceptions instead of fixing the cause

Read the full file on GitHub · 64 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. 2d ago First seen · 64 lines · 26 tokens per session scan A 6c802f340085

Subscribe to this mod's changes

stuck is a skill published in the GitHub repository 5uck1ess/devkit (5 stars, last pushed 13d ago), licensed MIT. It adds 26 tokens to every session and 503 once invoked, about $0.0001 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