Codex CLI capability request: persistent governed repo mode for long-running local workflows

Resolved 💬 3 comments Opened Apr 17, 2026 by vaflya32407 Closed Jul 1, 2026

What variant of Codex are you using?

CLI

What feature would you like to see?

A first-class governed repository mode for Codex CLI, or an official hook/event surface that allows persistent repo-local governance
enforcement across the full interactive session.

This is a Codex CLI feature request for long-running governed local-repo workflows, not a general model-quality complaint.

In this repo, we already have:

  • session-start / session-stop lifecycle
  • persisted PRE/POA/SOP governance artifacts
  • MCP-first routing
  • preflight/compliance validation
  • repo-root launch wrapper
  • fail-closed startup hardening

That work improves startup anchoring, but Codex CLI still has no documented or official way to stay persistently bound to repo-local governance
across the full session.

What is needed:

  • persistent session anchoring to repo-local governance/state
  • official pre-prompt / pre-tool / pre-response / post-response hooks or equivalent events
  • repo-local compliance validation with retry/block behavior
  • fail-closed handling when required governance surfaces are missing, stale, or contradictory

Why this matters:

  • long sessions can drift from repo protocol
  • compression/recovery increases continuity loss
  • users have to repeatedly re-anchor the CLI manually
  • this causes token waste and more inference than protocol-grounded execution

Expected behavior:
After startup establishes repo governance state, Codex CLI should be able to remain anchored to that state unless it is explicitly refreshed,
changed, or invalidated.

Actual behavior:
Startup can be hardened locally with wrappers and readiness gates, but ongoing adherence still depends too much on repeated manual re-anchoring
because there is no first-class governed mode or documented persistent enforcement surface.

Additional information

Environment:

  • Codex CLI version: codex-cli 0.121.0
  • Auth mode: ChatGPT sign-in
  • OS / shell: Windows 11 / PowerShell

Concrete example:
After long multi-step sessions or after compression/recovery, the repo has to manually re-point Codex to active governance artifacts such as
config/active_session_governance.json; otherwise responses can drift toward generic synthesis instead of staying anchored to the active PRE/
POA/SOP session frame.

This repo already includes custom startup and governance hardening to reduce drift, but the missing capability is native persistent CLI
adherence, not better prompting.

I also prepared a short writeup with code snippets and can attach it if helpful.

Before submitting, do one quick search in that repo for:

  • governed mode
  • hooks
  • session persistence
  • CLI feature request

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗