stuck

A recovery procedure for an agent that keeps encountering the same error or repeating the same attempted fixes.

In plain words
What is it for?
Use it to capture the current project state, list attempted approaches, identify the type of loop, and decide on a different next step.
Why use it?
It makes the agent stop after repeated failures, record what happened, and expose the problem instead of retrying silently.

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/fo0/clawstash/stuck
Any agent
npx skills add fo0/clawstash --skill stuck
Clone the repo
git clone --depth 1 https://github.com/fo0/clawstash

Made for: Claude Code, Codex.

Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,192 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.00061 $0.01192
Opus 5 $0.00030 $0.00596
Sonnet 5 $0.00012 $0.00238
Haiku 4.5 $0.00006 $0.00119

Measured 2d ago against content hash a54f159f5c9b, 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.

.claude/skills/stuck/SKILL.md · 117 lines

How it starts

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

Stuck — Loop / Dead-End Recovery

When to Use

  • User says "stuck", "loop", "going in circles", "/stuck"
  • Agent self-detects a loop:
    • Same error after 2nd fix attempt -> log warning, third attempt MAY proceed if a different angle is being tried
    • Same error after 3rd attempt -> STOP, invoke this skill
    • Same file edited 5+ times in one session for the same defect
  • A test passes locally but fails in CI 2+ consecutive runs without a code change in between (likely flake — see CI-skill rules)

Workflow

1. Snapshot

Capture exact current state:

git status --porcelain
git diff --stat
git log --oneline -10

Plus:

  • Last error message verbatim (no paraphrasing)
  • Last 3 commands run and their exit codes
  • Files touched in this loop

2. Attempt Log

Build an explicit list of what's been tried this session:

Attempt 1: <approach> -> <result>
Attempt 2: <approach> -> <result>
Attempt 3: <approach> -> <result>

If you can't articulate the attempts as distinct approaches -> that itself is the diagnosis (you've been trying the same thing).

3. Diagnose Loop Type

Pattern Likely cause Action
Same fix re-applied because tests still fail Test is wrong, not the code Question the test
Lint passes locally, fails in CI Tooling-version drift Pin versions, check .tool-versions / lockfile
Import / module-not-found that "should work" Cache, build artifacts, stale lockfile Clean caches, re-install deps
Type error surviving every cast Wrong type model, not wrong cast Step back, redesign types
Test flake (passes/fails non-deterministically) Async race / shared state / clock dependency Treat as flake -> BACKLOG.md
Network / external-API error Unmocked external dep Apply autonomy + zero-cost rule -- mock
Build infra (timeout / OOM / runner) NOT a code defect Surface to CI skill, do not "fix" code

Read the full file on GitHub · 117 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 · 117 lines · 61 tokens per session scan A a54f159f5c9b

Subscribe to this mod's changes

stuck is a skill published in the GitHub repository fo0/clawstash (1 stars, last pushed 2d ago), licensed MIT. It adds 61 tokens to every session and 1,192 once invoked, about $0.0003 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

user-usecases

Database of real user use cases for APIbase platform. Contains detailed examples of how specific APIs are onboarded, wrapped, and served to AI agents. Use this skill when you need to reference real integration examples, explain the APIbase onboarding process, or design new API wrappers based on proven patterns.

whiteknightonhorse/APIbase · 63 tokens

business-model-validator

Use when a prospect, new customer, or existing operator wants to know whether Zooza fits their business, or which Zooza features map to how they operate. No Zooza account required — works as a pure knowledge interview.

zooza-dev/zooza-mcp-server · 49 tokens

spotify-mcp-doctor

Diagnose and repair NovaLux12/spotify-mcp-server failures — auth, permissions, devices, rate limits, OpenClaw wiring. Use when Spotify tool calls fail or setup stalls.

NovaLux12/spotify-mcp-server · 44 tokens

delegacion-local

Regla y catálogo para delegar pasos mecánicos (resumir, clasificar, extraer, boilerplate, mensaje de commit desde un diff, traducir texto o archivo, resumir salida de lint/tests/CI, explicar código, describir una imagen, verificar si el backend local está disponible) a modelos locales vía las tools local del MCP…

ZahiriNatZuke/local-delegate · 137 tokens

class-management

Use when the user wants to create a new class, group, or course in Zooza — e.g. "set up a Monday yoga class", "add a new group", "schedule a course". Guides through programme selection, venue, trainer, session pattern, and commits.

zooza-dev/zooza-mcp-server · 56 tokens

feedback-nudge

Use when the user wants to report a bug, request a feature, or send feedback to the Zooza engineering team. Also offer proactively after a successful commit operation (max once per week).

zooza-dev/zooza-mcp-server · 38 tokens