Skip to content

Loongphy/codext

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6,617 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codext

An opinionated Codex CLI. This is strictly a personal hobby project, forked from openai/codex.

Preview

Quick Start

Choose one of these two ways:

  • Install from npm:
npm i -g @loongphy/codext
  • Build from source:
cd codex-rs
cargo run --bin codex

Features

Full change log: see CHANGED.md.


TUI: Status Header

The TUI header provides a compact overview of the active session:

  • Context: Displays the active model, effort level, and current working directory (cwd).
  • Git Status: Background-polled summary of the repository state for the session cwd.
  • Rate Limits: ChatGPT usage-limit snapshots that refresh while the UI is idle.

Status Header Preview

Copy to Clipboard

  • Ctrl+Shift+C: Copies the current draft to the system clipboard.
  • Ctrl+C: Retains existing behavior; remains backward-compatible with legacy logic when the draft is empty.

Prompt Queue on usage limit

Prompt Queue

This feature helps manage follow-up messages when quota or rate limits are reached:

  • Paused and Waiting: Queued messages wait instead of being sent into more failed turns.
  • Append While Limited: Even while autosend is paused, you can still press Tab to add messages to the queue.
  • Resume on Availability: Once a later rate-limit snapshot shows quota is available again, Codext sends the first queued message.

Account Switching

Account Changed

Codex now reloads authentication after external auth.json writes settle, so account changes can be picked up without restarting at safe boundaries.

  • TUI: Watches auth.json for changes via filesystem notifications, with trailing debounce so reloads happen after writes settle. Auth is deferred until any active task completes; transient read errors do not clear cached auth.
  • App-server: Reloads auth before thread/start, thread/resume, and turn/start when no turn is running, so the new account is picked up at the next safe request boundary.

This enables auth refresh for TUI and Codex App flows when external tools update auth.json.

It also supports Codex App account switching via codex-auth#103.

Automatic Resumption

After a turn stops on UsageLimitExceeded, the TUI can park a recovery prompt and dispatch it after a later auth.json reload changes account identity.

You can configure this behavior using [tui].usage_limit_resume_prompt:

  • Custom Prompt: Define a specific string to be sent as the "resumption turn." This prompt will be used to signal the model to continue where it left off.

  • Disable: Set to "" (empty string) to disable this automatic recovery behavior entirely.

  • Default: If left unset, the system uses the following built-in prompt:

    Please continue from where the conversation left off after the usage limit reset or account switch.
    

    Example:

    [tui]
    usage_limit_resume_prompt = ""

AGENTS.md auto reload

AGENTS.md and project-doc instructions are refreshed on each new user turn, and Codex shows an explicit warning when a refresh is applied.

Project Goals

We will never merge code from the upstream repo; instead, we re-implement our changes on top of the latest upstream code.

Iteration flow (aligned with .agents/skills/codex-upstream-reapply):

flowchart TD
      A[Fetch upstream tags] --> B[Choose latest stable rust tag]
      B --> C[Create fresh branch from tag]
      C --> D[Generate old-branch reference bundle]
      D --> E[Read intent docs and old changes<br/>CHANGED.md / README.md / AGENTS.md<br/>bundle diff / changed-files / commits]
      E --> F[Re-implement required changes on fresh branch]
      F --> G[Build: cargo build -p codex-cli]
      G --> H[Review final diff against tag]
      H --> I[Push finished branch]
Loading

Skills

When syncing to the latest upstream codex version, use .agents/skills/codex-upstream-reapply to re-implement our custom requirements on top of the newest code, avoiding merge conflicts from the old branch history.

Example:

$codex-upstream-reapply old_branch feat/rust-v0.130.0, new origin tag: rust-v0.131.0

Credits

Status bar design reference: https://linux.do/t/topic/1481797

About

An opinionated Codex CLI with better DX

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Contributors

Languages

  • Rust 96.1%
  • Python 2.9%
  • TypeScript 0.3%
  • Shell 0.2%
  • Starlark 0.2%
  • PowerShell 0.1%
  • Other 0.2%