stagnation-recovery

Diagnoses agent stagnation patterns and redirects security testing toward untried attack surfaces.

545|48|Updated Nov 10, 2025
One-click install
npx skills add https://github.com/yhy0/CHYing-agent --skill stagnation-recovery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: stagnation-recovery
Source: https://github.com/yhy0/CHYing-agent/tree/main/agent-work/.claude/skills/stagnation-recovery
Command: npx skills add https://github.com/yhy0/CHYing-agent --skill stagnation-recovery

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Autonomous security agents often get stuck retrying the same failing command with minor parameter tweaks, wasting tool calls without making progress. This Skill detects stagnation patterns and forces a structured diagnosis-and-recovery workflow so the agent changes direction instead of spinning in place.

Core Features & Use Cases

  • Stagnation Diagnosis: Classifies the stuck state into five modes (looping on one approach, environment constraints, insufficient reconnaissance, broken attack chains, or tool misuse) before taking action.
  • Attack Tree Redirection: Provides Web, privilege escalation, and cloud (Azure/AWS/GCP) attack trees so the agent picks a genuinely new direction rather than a parameter variation.
  • Script Substitution: Replaces error-prone curl commands and multi-step API flows with Python scripts to avoid shell escaping and state-passing failures.
  • Use Case: During an authorized penetration test or CTF, the agent receives repeated 403 errors on an OAuth endpoint; the Skill guides it to stop retrying, enumerate untried attack surfaces, and pivot from client_credentials to a device_code flow.

Quick Start

Ask the agent to apply the stagnation-recovery procedure after it has made no progress for ten or more tool calls on the current security task.

Frequently Asked Questions about stagnation-recovery

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

FAQPage Schema
How do I stop an AI agent from retrying the same failing command?

Classify the stuck state first: looping on one approach, environment constraints, missing information, broken attack chains, or tool misuse. Then force a direction change to an untried attack surface rather than another parameter variation, limiting each new direction to three attempts.

What should a penetration testing agent do when it makes no progress?

It should list all directions already tried, pick an untried branch from web, privilege escalation, or cloud attack trees, and define clear success criteria. Failed attempts must produce new information, otherwise the agent returns to diagnosis.

When should curl commands be replaced with Python scripts in security testing?

Replace curl when commands repeatedly fail due to quoting, encoding, or nested special characters, or when multi-step API flows need to pass tokens between requests. A Python requests script avoids shell escaping issues and keeps intermediate state in variables.

How do I handle permission denied errors during privilege escalation?

First verify whether the constraint is real by trying alternate users, paths, or substitute tools such as /dev/tcp instead of nmap. If it is a hard constraint, abandon that direction immediately and pivot to a different attack surface instead of retrying variants.

What are the limitations of loop-detection recovery for security agents?

Recovery depends on the agent honestly enumerating what it has already tried and reading full error messages. It cannot help when the underlying target is genuinely unexploitable, and it requires available tools like shell execution and web search to validate alternatives.