Skip to main content
skill CX Codex

Claude Code-session-patcher — Claude Code skill: clean refusals

Finds AI refusals in Claude CLI, Claude and OpenCode session files and replaces them so you can resume the conversation.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add reason-machines/trending-skills --skill codex-session-patcher -a claude-code
Open on GitHub

What codex-session-patcher does

The skill scans session files for refusal phrases and swaps them for a cooperative reply, after which the session can be resumed as usual. Formats differ: Claude CLI and Claude store JSONL, OpenCode uses SQLite.

Under the hood there is a Python library with a parser, a refusal detector and a patcher, plus the codex-patcher CLI and a web dashboard with diff preview and live logs. Run --dry-run first to see exactly what would change before anything is written. LLM rewriting is optional and needs a key for an Anthropic-compatible API, set through an environment variable rather than pasted into the config.

A second feature injects CTF context into tool profiles and workspaces to lower the chance of a refusal in the first place. For Claude CLI the profile activates only on an explicit codex -p ctf launch and leaves normal sessions alone. OpenCode has no profile mechanism, so you have to start it from the generated workspace. Editing session files rewrites your conversation history, so on a real project preview the diff before applying it.

What it helps with

  • clear a refusal from a session file and keep working
  • preview the diff before touching any file
  • rewrite a refusal with an LLM instead of a canned reply
  • add your own phrases to refusal detection
  • manage sessions from three tools in one dashboard

Example prompts for the agent

  • clean the latest Claude session and show me the diff
  • find refusals in my Claude session and replace them
  • install the CTF profile for Claude

How to install codex-session-patcher

1Skills CLI (Vercel)

npx skills add reason-machines/trending-skills --skill codex-session-patcher -a claude-code

2Manually: put the files in place

~/.claude/skills/codex-session-patcher/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/codex-session-patcher/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about codex-session-patcher

How do I install Claude-session-patcher in Claude?

Run npx skills add reason-machines/trending-skills --skill codex-session-patcher -a claude-code. The skill lands at ~/.claude/skills/codex-session-patcher/SKILL.md.

What does Claude-session-patcher do?

It detects refusal responses in Claude CLI, Claude and OpenCode session files and replaces them so the session can be resumed. It can also inject CTF context into tool configs.

Do I need an API key?

Only if you turn on LLM rewriting. The key for an Anthropic-compatible API goes into an environment variable such as OPENAI_API_KEY.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set42

web-access-claude-skill Lets the agent pick between search, page fetch and driving your real Chrome. Useful when a site sits behind a login or renders on JS. CX Codex +1 965installs agent-flow-visualization Installs the Agent Flow VS Code extension, which draws Claude agent orchestration as a live node graph: tool calls, branches, subagents, timings. CX Codex +1 887installs caveman-token-optimizer A skill that makes AI agents answer in caveman-speak, dropping pleasantries and filler. It cuts roughly 65% of output tokens while code and technical terms stay exact. CX Codex +1 842installs pump-analyzer-solana A static front end for watching Pump.fun token launches on Solana: a WebSocket feed, price and volume charts, and alerts on your own criteria. CX Codex +1 837installs wildworld-dataset A skill for the WildWorld dataset: 108M+ frames from an ARPG, 450+ actions, per-frame annotations. Useful when preparing data for world modeling. CX Codex +1 782installs kordoc-korean-document-parser This skill turns Korean HWP 5.x, HWPX and PDF files into Markdown and structured blocks. Useful when you need text, tables or form fields out of a document. CX Codex +1 774installs see-through-anime-layer-decomposition Splits a single anime illustration into semantic layers and exports a layered PSD with depth maps for 2.5D animation. CX Codex +1 759installs open-multi-agent-orchestration A skill that teaches your agent to build AI agent teams on the open-multi-agent TypeScript framework: roles, models, task dependencies. CX Codex +1 710installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor