register-codex

A command that marks a project folder as trusted for the Codex command-line tool.

In plain words
What is it for?
Use it to trust the current project or a specified folder so Codex can work there.
Why use it?
It avoids repeating manual setup when you clone a project, reset Codex settings, or use a separate worktree. It can also safely repeat the setup without creating duplicate changes.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/simonrowland/goal-flight/register-codex
Clone the repo
git clone --depth 1 https://github.com/simonrowland/goal-flight
Per session 11 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 711 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00011 $0.00711
Opus 5 $0.00005 $0.00356
Sonnet 5 $0.00002 $0.00142
Haiku 4.5 $0.00001 $0.00071

Measured 2d ago against content hash 1ac74dfc64c9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

register-codex scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Register a project (or worktree path) as codex-trusted in `~/.codex/config.toml`.
commands/register-codex.md · 68 lines

How it starts

The opening of the file, as written. The whole thing — 68 lines — stays where its author put it; the contents beside it link to each section on GitHub.

register-codex []

Read:

  • protocols/tool-readiness.md

Register a project (or worktree path) as codex-trusted in ~/.codex/config.toml. This is the thin sub-command wrapper around scripts/install-codex-overrides.sh so the install can be re-run idempotently outside the init flow — e.g. after cloning the goal-flight skill onto a new machine, after a ~/.codex/ reset, or for a worktree spawned outside the usual <repo>/.claude/worktrees/ convention.

When to invoke

  • The user explicitly typed /goal-flight register-codex [<path>].
  • During commands/init.md step 1 environment validation, when scripts/ install-codex-overrides.sh --check reports MISSING and the user accepts the install prompt.
  • During commands/execute.md step 3a, if a parallel worktree is created OUTSIDE <repo-root>/ (uncommon — goal-flight's convention keeps them inside, which inherits trust by path prefix).

What the user provides

  • No args → register the current git toplevel (or pwd if not a git repo).
  • One arg <project-path> → register that absolute or relative path.

Steps

  1. Resolve the skill root from the loaded command/plugin path. Prefer the current goal-flight repo root; fall back to clone form only when that is the actual loaded path.

  2. Resolve the target path:

    • If user supplied an arg: cd "$ARG" && pwd (must exist).
    • Else: git rev-parse --show-toplevel 2>/dev/null || pwd.
  3. Run a dry-run first: bash <skill-root>/scripts/install-codex-overrides.sh --check <path>.

    • Exit 0 → already registered. Print "Already trusted: ." and stop.
    • Exit 1 → not registered. Continue.
    • Other → codex not installed; print "codex CLI not found; skipping." and stop.
  4. Surface the action and ask the user:

    "I'll register <path> as codex-trusted by appending a [projects."<path>"].trust_level = \"trusted\" block to ~/.codex/config.toml. This bypasses the MCP approval-gate stall on non-interactive codex exec dispatches in that project (and worktrees under it). Mirror to <path>/.codex/config.toml for self- documentation? (y/n — y by default)."

Read the full file on GitHub · 68 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 68 lines · 11 tokens per session scan B 1ac74dfc64c9

Subscribe to this mod's changes

register-codex is a command published in the GitHub repository simonrowland/goal-flight (20 stars, last pushed 4d ago), licensed MIT. It adds 11 tokens to every session and 711 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.