stuck-recovery

Detect repetitive failure loops in agent task execution via tool call monitoring.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/hiddink-ai/hiddink-harness --skill stuck-recovery-hiddink-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stuck-recovery
Source: https://github.com/hiddink-ai/hiddink-harness/tree/main/templates/skills/stuck-recovery
Command: npx skills add https://github.com/hiddink-ai/hiddink-harness --skill stuck-recovery-hiddink-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill identifies when an AI agent becomes trapped in repetitive failure loops, such as repeatedly editing the same file or failing the same tool call, preventing wasted tokens and stalled progress.

Core Features & Use Cases

  • Loop Detection: Monitors tool usage and file edits to identify patterns of repetitive failure.
  • Recovery Strategies: Provides actionable advice including context resets, model escalation, or human intervention requests.
  • Use Case: If an agent is stuck in a loop trying to fix a syntax error but failing repeatedly, this skill detects the pattern and suggests a fresh context reset to clear the agent's confusion.

Quick Start

Enable the stuck-recovery skill to monitor the current session for repetitive failure patterns and provide recovery advice.

Frequently Asked Questions about stuck-recovery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect repetitive failure loops in AI agent task execution?

You detect repetitive failure loops by monitoring tool calls and file modification patterns using sliding window pattern matching on process-scoped history. This identifies stuck states and triggers advisory outputs for recovery.

What recovery strategies are available when an AI agent gets stuck in a loop?

Recovery strategies for stuck AI agents include context resets to clear confusion, model escalation, or human intervention requests. These actionable advisories trigger automatically when repetitive failure patterns are detected in the orchestration layer.

How do I stop an AI agent from repeatedly editing the same file and failing?

To stop an AI agent from repeatedly failing on the same file edit, enable stuck state monitoring to detect the repetitive failure loop. The system then advises a fresh context reset to clear the agent's confusion and resume progress.

Does loop detection work within an existing agent orchestration layer?

Loop detection operates within the orchestration layer by monitoring process-scoped history. It leverages sliding window pattern matching to identify stuck states during active sessions and provide recovery advice without requiring external intervention.

What are the limitations of using sliding window pattern matching for error handling?

Sliding window pattern matching for error handling relies on process-scoped history, meaning it detects repetitive failures based on monitored tool calls and file modifications. It provides advisory outputs for recovery but does not autonomously execute the fixes.