Open-sourced self-healing skill for AI agents detects and fixes failures automatically

The self-healing skill is an open-source tool that enables AI agents to automatically detect, diagnose, and fix their own failures. It was developed after a real incident where a cron job broke at 1:24 AM due to a Python script failing to find a template file after macOS cleaned the /tmp directory.
How it works
The agent (named Psy, running on Opus) in the source example detected the failure, traced the root cause, moved the file to a permanent location, updated the code to use relative paths, committed the fix, and rebuilt the failed page. This entire process happened automatically while the developer was asleep, with everything fixed by 9 AM.
Key features
- Failure scanner that checks cron jobs, sub-agents, and deploy logs
- Known-fixes database that learns from every fix so the same error gets resolved instantly next time
- Five-step process: detect → diagnose → fix root cause (not just retry) → verify → log what was learned
Implementation details
The skill works as an OpenClaw skill or standalone tool. It's MIT licensed and available on GitHub at github.com/psyduckler/self-healing-agents. The developer created it as a reusable pattern rather than something baked into a HEARTFEAT.md file.
This type of tool is useful for developers running AI agents in production environments where automated failure recovery can prevent downtime and reduce manual intervention. The approach focuses on fixing root causes rather than simply retrying failed operations.
📖 Read the full source: r/openclaw
👀 See Also

NaNMesh MCP checks GitHub issues before Claude recommends libraries
NaNMesh MCP is an open-source Model Context Protocol server that crawls GitHub Issues, Stack Overflow, and Reddit for known bugs in development tools. When Claude recommends a library, it can check for real problems before integration.

Codesight CLI reduces AI coding agent token usage by scanning codebases
Codesight is a zero-dependency CLI tool that scans TypeScript, Python, and Go projects to generate compact context files, reducing Claude Code exploration tokens by 12.3× on average according to benchmarks from real production codebases.

Mymir: An Open-Source Project Graph for Coding Agents via MCP
Mymir gives agents a graph-based project map with dependencies, decisions, acceptance criteria, and previous execution notes, delivered via MCP to avoid re-explaining state across sessions.

Open-Source Claude Code Plugins for Agentic Commerce Protocols
OrcaQubits has released eight open-source Claude Code plugins that implement agentic commerce protocols including UCP, ACP, AP2, and A2A, with MIT licensing and support for platforms like Magento 2, BigCommerce, and WooCommerce.