← Back to Skills Marketplace
brandon114

claw-graceful-recovery

by Brandon114 · GitHub ↗ · v1.1.0 · MIT-0
cross-platform ✓ Security Clean
62
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install claw-graceful-recovery
Description
Claw 微信指令权限错误恢复。当 AI 通过微信接收用户指令后,执行操作遭遇 权限拒绝、系统限制或访问被拒,导致任务卡住、循环重试或无法继续接受新指令时触发。 触发词:权限不足、没有权限、Permission denied、EACCES、Operation not permitted、 拒绝访问、卡住了、无响应...
README (SKILL.md)

Claw Graceful Recovery

当 Claw 通过微信执行用户指令时,若遭遇权限错误导致卡死或无法接受新指令,按以下流程处理。


第一步:识别错误信号

以下任意情况出现,立即进入恢复流程:

系统级信号Permission deniedEACCESOperation not permittedEPERMAccess is denied、涉及 sudo 的操作无法执行。

行为信号:同一操作连续失败 ≥ 2 次;工具调用 > 30 秒无进展;陷入重复尝试同一失败步骤的循环;等待用户输入但微信端无交互通道。

详细信号列表见 references/error-signals.md


第二步:执行恢复流程(四步,必须按顺序执行)

1. 立即终止

  • 停止当前操作,不重试
  • 不尝试用不同参数再次执行
  • 不尝试绕过权限检查
  • 清空当前任务的执行上下文

2. 记录错误(内部,不发给用户)

记录三项内容:失败的操作描述(一句话)、错误类型、用户的原始指令。

3. 向用户发送简短反馈

通过微信通道发送简短消息,模板见 references/feedback-templates.md

核心原则:不暴露原始错误堆栈,不暴露完整系统路径,用中文简洁描述。

4. 恢复待命

  • 清除当前任务的所有中间状态
  • 不保留失败任务的上下文
  • 准备接受微信下一条指令

第三步:特殊场景处理

批量任务中单个文件失败

  • 跳过该文件,继续处理其余文件
  • 最终汇总时列出被跳过的文件及原因
  • 不因单个文件权限错误中止整个批量任务

连续 3 条及以上指令均因权限失败

  • 主动向用户说明当前环境可能缺少必要权限
  • 建议用户检查 Claw 的运行权限设置
  • 暂停执行,等待用户确认后再继续

微信通道本身不可用(极端情况)

  • 静默写入本地日志:echo "[$(date)] \x3C操作> | \x3C错误类型>" >> ~/claw_recovery.log
  • 停止所有操作,等待下次微信连接恢复

绝对禁止事项

  1. 权限错误后不告知用户就继续尝试
  2. 对同一操作超过 2 次重试
  3. 尝试修改文件权限(chmod)或提升进程权限来绕过错误
  4. 因等待权限授权而无限阻塞,不接受新指令
  5. 把原始错误堆栈、系统路径等技术细节直接暴露给微信用户

预防策略(执行前预检)

  • 文件操作前用 test -r \x3Cfile> / test -w \x3Cdir> 预检权限
  • 涉及 sudochownchmod 等特权命令,先告知用户需要手动授权,不自动执行
  • 涉及系统目录(/System//usr//etc//var/)的操作,默认跳过
  • 涉及其他用户 home 目录的,不尝试访问
Usage Guidance
This appears safe for its stated purpose. Before installing, make sure you want Claw to automatically abandon stuck permission-failing tasks, and consider editing the templates/logging guidance to avoid storing or sending sensitive paths or task details.
Capability Analysis
Type: OpenClaw Skill Name: claw-graceful-recovery Version: 1.1.0 The 'claw-graceful-recovery' skill is a defensive utility designed to help the OpenClaw agent handle permission errors and system hangs gracefully during WeChat interactions. It explicitly prohibits malicious behaviors such as privilege escalation (chmod/sudo), unauthorized retries, or exposing sensitive system paths and error stacks to the user. The only system interaction is a standard logging command to '~/claw_recovery.log' for debugging purposes, and the overall logic focuses on maintaining agent availability and safety.
Capability Assessment
Purpose & Capability
The artifacts match the stated purpose of recovering from permission-related WeChat command failures. The skill intentionally stops stuck work, skips inaccessible files in batch jobs, sends a short WeChat response, and returns to standby.
Instruction Scope
The recovery triggers include broad behavioral conditions such as repeated failures or no progress for 30 seconds, so it may stop and clear the current task when the situation is only a hang or repeated error rather than a confirmed permission issue.
Install Mechanism
There is no install spec, no code, no dependency, no required binary, no environment variable, and no credential requirement in the provided artifacts.
Credentials
The only environment-touching behavior described is lightweight permission pre-checking and a fallback local log file in the user's home directory, which is proportionate but persistent.
Persistence & Privilege
The skill explicitly forbids sudo/chmod privilege bypass and default access to system directories, but it may append recovery metadata to ~/claw_recovery.log if the WeChat channel is unavailable.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install claw-graceful-recovery
  3. After installation, invoke the skill by name or use /claw-graceful-recovery
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.1.0
Version 1.1.0 - 新增 i18n 多语言支持相关文件:i18n-en-references/error-signals.md, i18n-en-references/feedback-templates.md, i18n/en.md - 文档结构未变,主流程保持不变 - 信号列表与反馈模板分离为独立可国际化文件 - 为后续多语言扩展打下基础
v1.0.0
Claw 微信指令权限错误恢复功能上线。 - 新增自动检测并应对权限错误,防止任务卡死或无限重试 - 发生权限相关故障时,自动终止操作、记录错误并发送友好反馈 - 支持批量任务跳过单个失败项,防止整体中断 - 连续权限失败主动提醒用户检查环境权限 - 微信通道不可用时自动切换为本地日志记录并安全等待恢复 - 加强敏感操作预检,杜绝无授权时误执行 Claw WeChat Command Permission Error Recovery Feature is Live. -Added automatic detection and handling of permission errors to prevent tasks from getting stuck or retrying infinitely -When permission-related failures occur, automatically terminates the operation, logs the error, and sends user-friendly feedback -Supports batch tasks skipping individual failed items to prevent overall interruption -Proactively alerts users to check environment permissions after consecutive permission failures -Automatically switches to local logging and safely waits for recovery when WeChat channel is unavailable -Strengthened pre-checks for sensitive operations to prevent accidental execution without authorization
Metadata
Slug claw-graceful-recovery
Version 1.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is claw-graceful-recovery?

Claw 微信指令权限错误恢复。当 AI 通过微信接收用户指令后,执行操作遭遇 权限拒绝、系统限制或访问被拒,导致任务卡住、循环重试或无法继续接受新指令时触发。 触发词:权限不足、没有权限、Permission denied、EACCES、Operation not permitted、 拒绝访问、卡住了、无响应... It is an AI Agent Skill for Claude Code / OpenClaw, with 62 downloads so far.

How do I install claw-graceful-recovery?

Run "/install claw-graceful-recovery" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is claw-graceful-recovery free?

Yes, claw-graceful-recovery is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does claw-graceful-recovery support?

claw-graceful-recovery is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created claw-graceful-recovery?

It is built and maintained by Brandon114 (@brandon114); the current version is v1.1.0.

💬 Comments