fix-stuck-session

fix-stuck-session is a skill for Claude Code from MSApps-Mobile/claude-plugins. It costs 137 tokens per session (1,590 once invoked), scanned C, original, MIT.

A repair guide for a Claude Cowork session that cannot load because an earlier process or saved session record still claims it is running. Cowork is Claude’s workspace for carrying out computer tasks.

In plain words
What is it for?
Use it to find affected sessions and, after your confirmation, archive sessions, stop leftover processes, or clear related cached state.
Why use it?
It helps resolve errors such as “process already running,” stuck sessions, failed resumes, and connection interruptions caused by leftover session state.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cowork-session-fixer plugin — 1 skill shipped together

Good fit Use it to find affected sessions and, after your confirmation, archive sessions, stop leftover processes, or clear related cached state.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/msapps-mobile/claude-plugins/fix-stuck-session
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 MSApps-Mobile/claude-plugins --skill fix-stuck-session
Clone the repo
git clone --depth 1 https://github.com/MSApps-Mobile/claude-plugins

Made for: Claude Code.

Or install cowork-session-fixer, the plugin that ships this one along with the rest of its 1 skill.

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 fix-stuck-session

README.md
[![agentmods](https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/fix-stuck-session/github.svg)](https://agentmods.dev/skills/msapps-mobile/claude-plugins/fix-stuck-session)
Your own site
<a href="https://agentmods.dev/skills/msapps-mobile/claude-plugins/fix-stuck-session"><img src="https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/fix-stuck-session/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 fix-stuck-session

Your own site · 80×15
<a href="https://agentmods.dev/skills/msapps-mobile/claude-plugins/fix-stuck-session"><img src="https://agentmods.dev/badge/skills/msapps-mobile/claude-plugins/fix-stuck-session.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 137 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,590 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00137 $0.01590
Opus 5.5 $0.00055 $0.00636
Sonnet 5.5 $0.00027 $0.00318
Haiku 4.5 $0.00014 $0.00159

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

Security

Grade C, and why

fix-stuck-session scanned grade C with 1 finding 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 3mo 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

**macOS:** `rm -rf ~/Library/Application\ Support/Claude/cowork/`
plugins/cowork-session-fixer/skills/fix-stuck-session/SKILL.md · 169 lines

How it starts

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

Fix Stuck Cowork Session

Resolve the common "RPC error: process with name already running" bug that blocks Cowork sessions. Uses a tiered approach — trying the most elegant fix first, then escalating only if needed.

SOSA Supervised Gate

CRITICAL: Before ANY fix action (archiving, killing processes, clearing cache), present findings to the user and ask for explicit confirmation. Example:

| Session Name | Title | Status | Error | Proposed Action |
|-------------|-------|--------|-------|-----------------|
| busy-wizardly-mccarthy | WhatsApp reminder | idle | RPC error: already running | Archive |

"I found [N] stuck session(s). Should I proceed with the fix?"

Do NOT proceed without explicit user confirmation. This applies to ALL tiers below.

Understanding the Problem

Two root causes produce this error:

  1. Orphaned State File — The session JSON at ~/Library/Application Support/Claude/ local-agent-mode-sessions/<org-id>/<user-id>/local_<uuid>.json retains isArchived: false and holds a vmProcessName, blocking new sessions.
  2. Orphaned Process — A previous session crashed but its process entry was never cleaned up.

Both manifest as the same blocking error that prevents follow-up messages or session resumption.

Diagnostic & Fix Procedure

Work through these tiers in order. Stop as soon as the issue is resolved.

Tier 1: Identify the Stuck Session

Parse the error message to extract the session name and process ID if present.

Use mcp__session_info__list_sessions to cross-reference which sessions are idle but holding a process name. Report findings to the user in a table (see Supervised Gate above).

Tier 2: Archive Session State File (Fastest Fix)

macOS — Find and archive the stuck session JSON:

mdfind -onlyin ~/Library/Application\ Support/Claude "RPC error"

Then set isArchived: true:

python3 -c "
import json
path = '<session-file-path>'
with open(path) as f:
    data = json.load(f)
data['isArchived'] = True
with open(path, 'w') as f:
    json.dump(data, f, indent=2)
print('Archived: ' + data.get('processName', 'unknown'))
"

Read the full file on GitHub · 169 lines

Files

What ships with it

1 file 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. 3mo ago First seen · 169 lines · 137 tokens per session scan C cd4951a4810c

Subscribe to this mod's changes

fix-stuck-session is a skill published in the GitHub repository MSApps-Mobile/claude-plugins (14 stars, last pushed yesterday), licensed MIT. It adds 137 tokens to every session and 1,590 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

fix-stuck-session compared with skills from other repositories

fix-stuck-session next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
fix-stuck-sessionMSApps-Mobile/claude-pluginsSkill14yesterdayMITC137Claude Code
postmortemSethGammon/CitadelSkill9435d agoMITA58Claude Code
systematic-debuggingSethGammon/CitadelSkill9435d agoMITA45Claude Code
ai-diagnosticmodu-ai/moai-coworkSkill3201mo agoApache-2.0A151Claude Code
azure-mcp-observabilityWYRE-AI/msp-claude-pluginsSkill57todayApache-2.0A66Claude Code
diagnose-skill-runrunxhq/runxSkill1062d agoApache-2.0A35Claude Code, Codex
postmortem-draftrunxhq/runxSkill1062d agoApache-2.0A32Claude Code, Codex