When your AI coding partner refuses to play along
This tool scrubs refusal responses from AI coding sessions so security researchers can resume interrupted CTF or pentest workflows without starting from scratch.

What it does
It scans session files from Codex CLI, Claude Code, and OpenCode for refusal responses, then swaps in cooperative text so interrupted conversations can resume. You can fall back to a safe default or call an external LLM to generate context-aware rewrites that match the conversation flow. It also supports preemptive prompt injection via platform-specific configs or isolated workspaces to reduce refusal rates before they happen.
The interesting bit
Instead of just editing the latest rejection, it batch-cleans entire histories and strips encrypted reasoning blocks, effectively letting you rewrite the past so the AI never knew it objected. The operation is wrapped in a Vue-based Web UI with side-by-side diffs, automatic backups, and one-click restore.
Key highlights
- Supports Codex CLI, Claude Code, and OpenCode, handling both JSONL and SQLite session formats.
- Detects refusals with a two-tier strategy: strong phrase full matching plus weak keyword prefix matching.
- Offers profile-based and global prompt injection for Codex, plus dedicated CTF workspaces for Claude Code and OpenCode.
- Web UI provides session filtering, diff previews, real-time WebSocket logs, and bilingual interface support.
- Automatically backs up sessions before any modification and supports restoring arbitrary historical versions.
Verdict
Worth a look for CTF players and pentesters who keep hitting AI refusal walls; everyone else can safely ignore it.
Frequently asked
- What is ryfineZ/codex-session-patcher?
- This tool scrubs refusal responses from AI coding sessions so security researchers can resume interrupted CTF or pentest workflows without starting from scratch.
- Is codex-session-patcher open source?
- Yes — ryfineZ/codex-session-patcher is an open-source project tracked on heatdrop.
- What language is codex-session-patcher written in?
- ryfineZ/codex-session-patcher is primarily written in Python.
- How popular is codex-session-patcher?
- ryfineZ/codex-session-patcher has 2.2k stars on GitHub and is currently holding steady.
- Where can I find codex-session-patcher?
- ryfineZ/codex-session-patcher is on GitHub at https://github.com/ryfineZ/codex-session-patcher.