Codex CLI capability request: persistent governed repo mode for long-running local workflows
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
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Hey @vaflya32407, the surface you're describing — persistent governed repo mode plus pre-tool hooks plus retry/block gates plus fail-closed when governance is stale — matches a problem we've been shipping against as an independent project: external governance for long Codex CLI sessions.
The pain you flagged (drift across compression/recovery, re-anchoring cost) is the same bottleneck teams running 5+ parallel Codex agents hit. The shape you're asking for is largely buildable on the existing CLI hook surface, plus an external attestation that survives session compression — every wrapped session emits a signed, replayable bundle pointing to the deliberation that approved it.
Not affiliated with the Codex team and not pitching as a substitute for an official roadmap answer. If a prior-art implementation of the governed-repo shape is useful to your thread, see delimit.ai — happy to share specific hook samples or the attestation schema if that helps your case here.
This feature request hasn't received enough upvotes, so it is being closed automatically. If you still feel this feature is needed, please open a new feature request with an updated title and description.