Index of every page on this site: llms.txt
All skills
david-crespo avatar

/shellout

@d229350
Run it yourself

How to delegate a self-contained task to a cheaper pseudo-subagent via `codex exec` (OpenAI models; default gpt-5.6-sol). Use ONLY when the user explicitly invokes /shellout or names codex as the runner — not for general subagent or delegation requests.

  • 1 file
  • 4.3 KB
  • Updated 2 weeks ago
  • GitHub
Use this Skill: https://skilld.dev/gh/david-crespo/dotfiles/shellout

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈66 tokens for metadata: the name and description. ≈1k when used: this file.

Description uses 3.3% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈264 characters, or 3.3%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

shellout: codex as a pseudo-subagent

This skill delegates self-contained tasks to a one-shot codex exec run: a full agent with file, search, and shell tools that runs in cwd, takes one prompt, and prints a final answer. It is the claude -p equivalent.

Invocation

codex exec -m <model> -s <sandbox> --color never "<task>"
  • Sandbox (-s) bounds what the run can do at the OS level (seatbelt on macOS):
    • read-only: read, search, run read-only commands. Use for analysis and review.
    • workspace-write: also edit files and run commands, writes confined to cwd. Use for implementation. The run does not prompt for approval.
    • danger-full-access: no sandbox. Avoid unless the task truly needs it.
  • Pass a complete, self-contained task. The run shares no context with this session: spell out files, goal, constraints, and what to return.
  • Add -C <dir> to run in another directory, --skip-git-repo-check outside a git repo, and --ephemeral to skip saving the session (not if you may want to resume or price it later). Redirect stdin from /dev/null so codex does not wait on it.
  • The user's codex hooks print hook: ... lines; ignore them. The final message is repeated at the end of stdout. For clean output use -o <file> (last message only) or --json (JSONL events).
  • Review the result like any subagent's work.

Multi-turn: follow up on the same thread

The run is one-shot, but the thread persists. Reuse it to give feedback, redirect, or ask codex to act on an analysis it just produced, without re-explaining the task. This is the SendMessage equivalent for codex.

To capture the thread id, run the first turn with --json and read it from the first event, which is {"type":"thread.started","thread_id":"..."}:

codex exec --json -m <model> -s <sandbox> -o "$TMPDIR/codex-last.md" "<task>" \
  > "$TMPDIR/codex-events.jsonl" </dev/null
head -1 "$TMPDIR/codex-events.jsonl" | jq -r .thread_id
cat "$TMPDIR/codex-last.md"

Then continue with:

codex exec resume <THREAD_ID> -m <model> -o "$TMPDIR/codex-last.md" "<follow-up>"

Always repeat -m on resume. The model is NOT inherited from the thread: without -m it falls back to the config default (gpt-6-astra), which is 50x luna's price. The sandbox is inherited and resume has no -s flag. codex exec resume --last picks the most recent thread in cwd when the id was not captured. codex exec fork <THREAD_ID> "<prompt>" branches a thread to try an alternative without disturbing the original.

Cost

Report the cost after each turn, or at least at the end of the session:

bun ~/repos/dotfiles/codex/cost.ts <THREAD_ID>
# Token cost ≈ $0.01 this turn · $0.31 session

This reads the thread's rollout under ~/.codex/sessions using the same pricing table as the user's codex Stop hook (which does not fire for codex exec). The turn.completed usage in the --json output is cumulative for the thread on resumed turns, so don't price it per turn by hand.

Nothing meaningful is lost by ending the process between turns: the history is replayed from disk, so the model sees the same prefix and server-side prompt caching still applies if the follow-up comes within the cache window.

Running from Claude Code

codex fails inside the Claude Code bash sandbox (it cannot start its app-server), so run it with the sandbox bypass. Prefer -s read-only when the task allows, since codex's own sandbox is then the only boundary.

Models

The user usually names the model when invoking the skill. Otherwise use gpt-5.6-sol. Prices per 1M tokens (in / out), as of 2026-09:

Model In Out Use for
gpt-5.6-sol $4.00 $20.00 default; ~40% of Fable's price, clearly strongest of the three
gpt-5.6-terra $2.00 $12.00 routine code tasks where sol's judgment isn't needed
gpt-5.6-luna $0.20 $1.20 bulk read-only exploration and summaries

gpt-6-astra ($10 / $50) is the top model and rarely worth it over running the task in this session.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at d229350. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 2 weeks ago

README badge

README badge for david-crespo/dotfiles/shellout