self-healing

self-healing is a command for Claude Code from ruvnet/RuView. It costs 0 tokens per session (555 once invoked), scanned A, original, MIT.

An error-recovery workflow that detects failed commands, syntax errors, missing software packages, and failed tests, then attempts to diagnose and fix them. A software package is a reusable piece of code that a project depends on.

In plain words
What is it for?
Use it to install missing dependencies, investigate syntax errors, debug failing tests, apply confirmed fixes, and run the affected command or tests again.
Why use it?
It reduces interruptions when a command or test fails by starting recovery steps and retrying the work. It can also save error patterns for use in later recoveries.

Command for Claude Code

Written for Claude Code: PostToolUse hook event.

Good fit Use it to install missing dependencies, investigate syntax errors, debug failing tests, apply confirmed fixes, and run the affected command or tests again.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/ruvnet/ruview/self-healing
About the project

RuView is a WiFi sensing platform that uses disturbances in radio signals, captured by low-cost ESP32 sensors, to detect presence, movement, breathing, and heart rate without cameras or wearables. It is intended for spatial monitoring and smart-home integrations. The catalogue add-ons support workflows for operating and integrating RuView.

ruvnet/RuView · 98,818 stars · on GitHub · cognitum.one

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.

Clone the repo
git clone --depth 1 https://github.com/ruvnet/RuView

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for self-healing

README.md
[![agentmods](https://agentmods.dev/badge/commands/ruvnet/ruview/self-healing/github.svg)](https://agentmods.dev/commands/ruvnet/ruview/self-healing)
Your own site
<a href="https://agentmods.dev/commands/ruvnet/ruview/self-healing"><img src="https://agentmods.dev/badge/commands/ruvnet/ruview/self-healing/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for self-healing

Your own site · 80×15
<a href="https://agentmods.dev/commands/ruvnet/ruview/self-healing"><img src="https://agentmods.dev/badge/commands/ruvnet/ruview/self-healing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 555 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00555
Opus 5.5 $0.00000 $0.00222
Sonnet 5.5 $0.00000 $0.00111
Haiku 4.5 $0.00000 $0.00056

Measured 1mo ago against content hash 2371e11f0a45, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

self-healing 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 1mo 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.

Origin

Copies of this mod

8 near-identical copies found in the catalogue:

.claude/commands/automation/self-healing.md · 106 lines

How it starts

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

Self-Healing Workflows

Purpose

Automatically detect and recover from errors without interrupting your flow.

Self-Healing Features

1. Error Detection

Monitors for:

  • Failed commands
  • Syntax errors
  • Missing dependencies
  • Broken tests

2. Automatic Recovery

Missing Dependencies:

Error: Cannot find module 'express'
→ Automatically runs: npm install express
→ Retries original command

Syntax Errors:

Error: Unexpected token
→ Analyzes error location
→ Suggests fix through analyzer agent
→ Applies fix with confirmation

Test Failures:

Test failed: "user authentication"
→ Spawns debugger agent
→ Analyzes failure cause
→ Implements fix
→ Re-runs tests

3. Learning from Failures

Each recovery improves future prevention:

  • Patterns saved to knowledge base
  • Similar errors prevented proactively
  • Recovery strategies optimized

Pattern Storage:

// Store error patterns
mcp__claude-flow__memory_usage({
  "action": "store",
  "key": "error-pattern-" + Date.now(),
  "value": JSON.stringify(errorData),
  "namespace": "error-patterns",
  "ttl": 2592000 // 30 days
})

// Analyze patterns
mcp__claude-flow__neural_patterns({
  "action": "analyze",
  "operation": "error-recovery",
  "outcome": "success"
})

Self-Healing Integration

MCP Tool Coordination

// Initialize self-healing swarm
mcp__claude-flow__swarm_init({
  "topology": "star",
  "maxAgents": 4,
  "strategy": "adaptive"
})

// Spawn recovery agents
mcp__claude-flow__agent_spawn({
  "type": "monitor",
  "name": "Error Monitor",
  "capabilities": ["error-detection", "recovery"]
})

// Orchestrate recovery
mcp__claude-flow__task_orchestrate({
  "task": "recover from error",
  "strategy": "sequential",
  "priority": "critical"
})

Fallback Hook Configuration

{
  "PostToolUse": [{
    "matcher": "^Bash$",
    "command": "npx claude-flow hook post-bash --exit-code '${tool.result.exitCode}' --auto-recover"
  }]
}

Read the full file on GitHub · 106 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. 1mo ago First seen · 106 lines · 0 tokens per session scan A 2371e11f0a45

Subscribe to this mod's changes

self-healing is a command published in the GitHub repository ruvnet/RuView (98,818 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 555 tokens. 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-30.