os-clean-locks

Remove stale agent lock directories under context/.locks/ using Python 3.8+.

5|3|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/richfrem/agent-plugins-skills --skill os-clean-locks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: os-clean-locks
Source: https://github.com/richfrem/agent-plugins-skills/tree/main/plugins/agent-agentic-os/skills/os-clean-locks
Command: npx skills add https://github.com/richfrem/agent-plugins-skills --skill os-clean-locks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Safely removes all agent lock files from the context/.locks/ directory to resolve deadlocks caused by crashed agents leaving stale locks behind. Verifies lock existence, discovers and removes stale lock directories, updates OS state via kernel.py, and emits event bus notifications. Requires Python 3.8+ and standard library only.

Core Features & Use Cases

  • Detects stale locks and reports their locations.
  • Removes lock directories safely without affecting non-lock files.
  • Updates kernel state and emits events to notify downstream components.

Quick Start

Invoke the os-clean-locks action to scan context/.locks for stale locks and remove them, preparing the system for normal operation.

Frequently Asked Questions about os-clean-locks

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

FAQPage Schema
How do I clear stale agent locks causing deadlocks in my system?

You can clear stale agent locks by removing agent `.lock` directories under `context/.locks/`. This Skill scans the directory, safely removes stale lock files left by crashed agents, and updates the OS kernel state to restore normal agent flow.

Why does a crashed agent leave persistent locks behind?

Crashed agents leave persistent locks because they terminate unexpectedly without releasing their `.lock` directories. These stale locks remain under `context/.locks/`, blocking other processes and causing system deadlocks that require explicit cleanup to resolve.

Do I need Python to remove lock directories from the context filesystem?

Yes, you need Python 3.8+ to remove lock directories from the context filesystem. The Skill uses Python and the Bash tool for filesystem operations to safely discover and delete `.lock` directories while updating the kernel state.

What is the best way to reset agent locks after a system failure?

The best way to reset agent locks after a system failure is to scan `context/.locks/` and remove all stale `.lock` directories. This process updates the OS state via kernel.py and emits event bus notifications to restore normal agent operations.

Does clearing lock files affect other non-lock files in the context directory?

No, clearing lock files does not affect non-lock files in the context directory. The Skill safely targets and removes only the agent `.lock` directories under `context/.locks/`, ensuring non-lock files remain completely unaffected.