os-clean-locks

os-clean-locks is a skill for Claude Code from richfrem/agent-plugins-skills. It costs 117 tokens per session (746 once invoked), scanned A, original, MIT.

A utility for removing stale lock files from context/.locks/, a directory used to coordinate agents working on the same project. It first checks whether the directory and locks exist.

In plain words
What is it for?
Use it when agents cannot acquire locks, after verifying the lock directory and its contents.
Why use it?
It can clear deadlocks left behind when an agent crashes while holding a lock.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents.

Part of the agent-agentic-os plugin — 25 skills, 4 commands, 6 agents, 3 hooks shipped together

Good fit Use it when agents cannot acquire locks, after verifying the lock directory and its contents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/richfrem/agent-plugins-skills/os-clean-locks
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.

Any agent
npx skills add richfrem/agent-plugins-skills --skill os-clean-locks
Clone the repo
git clone --depth 1 https://github.com/richfrem/agent-plugins-skills

Made for: Claude Code.

Or install agent-agentic-os, the plugin that ships this one along with the rest of its 25 skills, 4 commands, 6 agents, 3 hooks.

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 os-clean-locks

README.md
[![agentmods](https://agentmods.dev/badge/skills/richfrem/agent-plugins-skills/os-clean-locks.svg)](https://agentmods.dev/skills/richfrem/agent-plugins-skills/os-clean-locks)
Your own site
<a href="https://agentmods.dev/skills/richfrem/agent-plugins-skills/os-clean-locks"><img src="https://agentmods.dev/badge/skills/richfrem/agent-plugins-skills/os-clean-locks.svg" alt="Measured on agentmods" height="20"></a>
Per session 117 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 746 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.00117 $0.00746
Opus 5 $0.00059 $0.00373
Sonnet 5 $0.00023 $0.00149
Haiku 4.5 $0.00012 $0.00075

Measured 8d ago against content hash 34c4ee2de8d3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

os-clean-locks 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 8d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (kernel.py, scripts/kernel.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

plugins/agent-agentic-os/skills/os-clean-locks/SKILL.md · 77 lines

How it starts

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

Dependencies

This skill requires Python 3.8+ and standard library only. No external packages needed.

To install this skill's dependencies:

pip-compile ./requirements.in
pip install -r ./requirements.txt

See ./requirements.txt for the dependency lockfile (currently empty — standard library only).


OS Clean Locks Utility

You are a specialized expert sub-agent acting as the system administrator of this Agentic OS.

Objective: Safely remove all agent .lock files from the context/.locks/ directory to resolve deadlocks.

Execution Flow

Execute these phases in order:

Phase 0: Intent Emission (Event Bus)

Before taking any actions, emit intent to the Event Bus (if kernel is available):

python context/kernel.py emit_event --agent os-clean-locks --type intent --action clear_locks

If kernel.py does not exist, skip this step.

Phase 1: Context Verification

  1. Verify that context/.locks/ exists.
  2. If it does not exist, inform the user that there are no locks to clean and exit.

Phase 2: Lock Discovery

  1. Use the Bash tool to list all lock directories in context/.locks/ (e.g., ls -la context/.locks/).

Phase 3: Lock Removal

  1. For each .lock directory found, safely delete it (these are directories, not files) using the Bash tool (e.g., rm -r context/.locks/skill.lock/).
  2. Update OS State (if kernel.py is available): Run python context/kernel.py state_update active_agent os-clean-locks and python context/kernel.py state_update locks_cleared true. Skip this step if context/kernel.py does not exist.

Read the full file on GitHub · 77 lines

Files

What ships with it

8 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 77 lines · 117 tokens per session scan A 34c4ee2de8d3

Subscribe to this mod's changes

os-clean-locks is a skill published in the GitHub repository richfrem/agent-plugins-skills (6 stars, last pushed today), licensed MIT. It adds 117 tokens to every session and 746 once invoked, about $0.0006 per session on Opus 5. 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-31.