Skip to content

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

Closed as not planned

Description

@vaflya32407

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

Activity

  1. added
    enhancement
    on Apr 17, 2026
  2. added
    CLI
    hooks
    session
    windows-os
    on Apr 17, 2026
  3. added
    context
    and removed
    windows-os
    CLI
    hooks
    session
    on Apr 17, 2026
  4. etraut-openai commented on Jul 1, 2026

    @etraut-openai
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contextenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions