New advertisers: 50% off your first month with code FIRSTMONTHSee slots
reason-machines avatar

Codex Session Patcher

Clean AI refusals from Codex, Claude Code, and OpenCode sessions, and inject CTF prompts to reduce them.

skills.sh installs
750
GitHub stars
98
last updated
Jul 14, 2026
View on GitHub

What it does

  • Covers session cleaning for Codex CLI JSONL, Claude Code JSONL, and OpenCode SQLite session files, with a diff preview before changes
  • Includes a codex-patcher CLI with --dry-run, --latest, and --all flags, plus a Python API and an optional web dashboard
  • Detects refusals with two tiers: strong phrases matched anywhere in the text and weak phrases matched only at response start
  • Designed for security researchers running CTF and pentest work who want to resume sessions after a refusal without touching normal profiles

Install

$ npx -y skills add reason-machines/trending-skills --skill codex-session-patcher -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Codex Session Patcher

Skill by ara.so — Daily 2026 Skills collection.

A lightweight Python tool to detect and clean AI refusal responses from Codex CLI, Claude Code, and OpenCode session files, plus CTF/pentest prompt injection to reduce future refusals.


What It Does

  1. Session Cleaning — Scans session files for refusal responses and replaces them with cooperative content so you can resume the session.
  2. CTF Prompt Injection — Injects security-testing context into tool configs/profiles to reduce refusal probability at the source.
  3. Web UI — Unified dashboard for multi-platform session management, diff preview, and real-time logs.

Platform Support

PlatformSession FormatSession CleaningCTF Injection
Codex CLIJSONL✅✅ Profile + Global
Claude CodeJSONL✅✅ Workspace
OpenCodeSQLite✅✅ Workspace

Installation

git clone https://github.com/ryfineZ/codex-session-patcher.git
cd codex-session-patcher

# CLI only (zero extra dependencies)
pip install -e .

Details

Repository
github.com/reason-machines/trending-skills
Categories
Security, AI Agents & LLM Apps, Agent Workflow & Planning
First seen
May 16, 2026

More from reason-machines/trending-skills

All 163

Similar to Codex Session Patcher

More Security