fix-stuck-session

fix-stuck-session is a skill for Claude Code, Codex 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 CodeCodex

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

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.

agentmods
npx agentmods add skills/msapps-mobile/claude-plugins/fix-stuck-session
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, Codex.

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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00137 $0.01590
Opus 5 $0.00068 $0.00795
Sonnet 5 $0.00027 $0.00318
Haiku 4.5 $0.00014 $0.00159

Measured 4d ago against content hash cd4951a4810c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 4d 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. 4d 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 (9 stars, last pushed 8d ago), licensed MIT. It adds 137 tokens to every session and 1,590 once invoked, about $0.0007 per session on Opus 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

Other skills, from other repositories

watch

File sentinel that monitors the working directory for changes and marker comments, then auto-triggers appropriate skills. Poll-based via git diff against the last scan commit. Writes intake items for batch processing and routes marker actions through /do. Use for automatic reactions to file changes; do NOT use for…

SethGammon/Citadel · 70 tokens

review

5-pass structured code review — correctness, security, performance, readability, consistency.

SethGammon/Citadel · 17 tokens

live-preview

Mid-build visual verification loop. Takes screenshots of components during construction, not just after. Catches visual regressions and invisible features before they compound. Requires Playwright or similar screenshot tool.

SethGammon/Citadel · 40 tokens

wiki

Markdown-first knowledge base where the LLM acts as librarian. Ingests raw sources, compiles and interlinks topic files, self-maintains an index. No vector DB or embeddings required -- uses LLM-native navigation over structured markdown up to 400K words.

SethGammon/Citadel · 56 tokens

consult-gov-grant

나에게 맞는 정부·공공기관 지원사업을 찾아주고, 심사 기준에 맞춘 사업계획서·신청서 초안을 만들어 드립니다(Word·한글·Excel 파일까지). 창업자·소상공인·중소기업·연구자·비영리단체·개인 누구나 쓸 수 있습니다. 다음과 같은 요청 시 사용하세요: "정부 지원사업 찾아줘" "우리 상황에 맞는 지원금 있어?" "사업계획서 초안 써줘" "지원서 작성 도와줘" "이 신청서 심사 기준으로 검토해줘" "마감 전에 뭐 준비해야 해?" "예비창업패키지 신청서 만들어줘" "지원금 어떻게 쓰는지 모르겠어" 지원사업 탐색·신청서 작성·서류 검토·일정 관리까지 도와주며, 마지막에…

modu-ai/moai-cowork · 283 tokens

data-realestate

국토교통부 실거래가 신고 데이터로 아파트·오피스텔·연립다세대·단독다가구·상업업무용 부동산의 매매·전월세 시세를 조회해 드립니다(별도 API 키 없이 바로 사용). 다음과 같은 요청 시 사용하세요: "잠실 리센츠 2024년 매매 실거래가 찾아줘" "강남구 아파트 실거래가 알려줘" "마포구 아파트 전세 실거래 보여줘" "성수동 오피스텔 월세 시세 조회해줘" "용산구 상업업무용 건물 거래내역 찾아줘" "전세 보증금 추이 알려줘" "이 단지 평형별 시세 비교해줘" 지역·단지·거래년월로 실거래를 조회해 중위값·최소·최대와 대표 거래를 요약하고, 입지 분석이나 투자 검토로…

modu-ai/moai-cowork · 230 tokens