Skip to content
Back to skills

Codex

ASecurity

Run Codex CLI tasks or resume an existing Codex session when the user asks to use codex exec or codex resume. Preserve the requested scope, model preferences, and execution permissions.

  • 239 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 26, 2026
ai-agentsshellbashgit

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 1, 2026

npx -y skills add jdrhyne/agent-skills --skill codex --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codex?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Codex
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jdrhyne-codex/badge)](https://www.skillsdirectory.com/skills/jdrhyne-codex)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: codex
description: Run Codex CLI tasks or resume an existing Codex session when the user asks to use codex exec or codex resume. Preserve the requested scope, model preferences, and execution permissions.
---

# Codex CLI

## Choose the invocation

Use the installed CLI's help when its version or supported flags are unknown:

```bash
command -v codex
codex --version
codex exec --help
codex exec resume --help
```

Preserve the user's configured model and reasoning effort. Omit model and reasoning overrides unless the user explicitly selected them, including a still-applicable selection earlier in the task. Do not choose a replacement model, change configuration, or ask for a model interview merely to run the task.

Treat the task's write scope and its sandbox as separate from network access:

- For analysis or review, use `--sandbox read-only`.
- For authorized local edits, use `--sandbox workspace-write` in the named workspace.
- A network requirement does not justify `danger-full-access` or bypassing approvals. Use the available narrowly scoped network authorization or report the specific blocked operation.
- Use `--skip-git-repo-check` only when the intended working directory is outside a Git repository. It is not a default invocation flag.

Keep existing hooks, identity settings, approval policies, and other configured protections in place. Honor authorization already given; ask only when a necessary action is outside that authorization or a required choice is unresolved.

## Run a new task

Prefer a prompt file or stdin when the prompt contains multiline text or shell metacharacters. The examples below assume the prompt file already contains the exact intended task.

```bash
# Review or analysis; inherit configured model and reasoning.
codex exec --sandbox read-only - < /path/to/prompt.txt

# Authorized edits in a specific workspace.
codex exec -C /path/to/workspace --sandbox workspace-write - < /path/to/prompt.txt
```

When a model or reasoning effort was explicitly selected, add supported `--model <MODEL>` and `-c 'model_reasoning_effort="<EFFORT>"'` options for that invocation. Verify that the selected values are supported; report an unavailable selection instead of silently replacing it. Do not assume flags from older examples, such as `--full-auto`, exist in the active CLI.

State a proportional timeout and retry limit before a long run. Use the task runner's process/session handle to monitor the operation.

## Resume the intended session

Prefer the known session ID over an ambiguous most-recent session:

```bash
codex exec resume <SESSION_ID> - < /path/to/follow-up.txt
```

Use `--last` only when the user asked for the most recent session and the working-directory context identifies it. Check `codex exec resume --help` for the installed version's argument placement and supported options.

Preserve the intended session, workspace, permissions, and earlier explicit model/reasoning choices. Do not assume a resume automatically retains every setting: check the available session metadata or effective configuration and pass supported overrides only when needed to honor an explicit user selection. Do not substitute another session after a resume failure.

## Output and failures

Capture stdout, stderr, and exit status. Do not discard stderr by default: it may contain authentication, configuration, or partial-execution diagnostics. Summarize relevant diagnostics without exposing credentials or raw internal reasoning.

On failure, report the command, exit status, and relevant error. Diagnose the failure and retry only within the original scope and the stated bound. Missing credentials, an unavailable explicitly selected model, or a required unauthorized operation may need user input; an ordinary successful command does not require another permission or follow-up interview.

Command success is not proof that the requested change works. Inspect the resulting files or report and run the task's appropriate validation. Finish with the actual outcome, evidence, and remaining limitations. Mention a session ID for continuation when useful.

Files in this skill

  • README.md2.1 KB
  • SKILL.md5.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.