codex-cancel

A command for stopping a background Codex task that is still running. It can cancel a chosen job or, when there is only one obvious job, the latest active one.

In plain words
What is it for?
Use it when you need to stop a Codex job, abort a task, or cancel work identified by a job ID.
Why use it?
It removes the need to wait for an unwanted or stuck task to finish. It also helps avoid cancelling the wrong task when several jobs are active.

Skill for Claude CodeCodex

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 skills/leejuoh/claude-code-zero/codex-cancel
Any agent
npx skills add LeeJuOh/claude-code-zero --skill codex-cancel
Clone the repo
git clone --depth 1 https://github.com/LeeJuOh/claude-code-zero

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 474 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00043 $0.00474
Opus 5 $0.00022 $0.00237
Sonnet 5 $0.00009 $0.00095
Haiku 4.5 $0.00004 $0.00047

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

Security

Grade A, and why

codex-cancel scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/codex-advisor/skills/codex-cancel/SKILL.md · 38 lines

What it actually says

Codex Job Cancel

Pass-through wrapper around the Official Codex companion's cancel subcommand. Exists so users who disabled the Official plugin's slash commands can still cancel jobs via codex-advisor.

Phase 1: Confirm target (if ambiguous)

If the user did not provide a job-id, the companion cancels the most recent active job — which may not be what they intended. Use AskUserQuestion when:

  • Multiple active jobs exist (check via node "$CODEX_COMPANION" status first, optional).
  • The user's phrasing suggests a specific job ("cancel the rescue", "stop the research") but no ID.

Skip the prompt when the intent is obvious (single active job, or they pass an explicit ID).

Phase 2: Invoke companion cancel

set -o pipefail
CODEX_COMPANION=$("${CLAUDE_PLUGIN_ROOT}/scripts/resolve-companion.sh") \
  || { echo "Official Codex plugin not found — run /codex-setup" >&2; exit 1; }

node "$CODEX_COMPANION" cancel $ARGUMENTS

Relay the companion's output verbatim. It typically reports cancelled or no-op (not running).

Gotchas

  • Cancellation is not instant. The companion signals the Codex worker; in-flight tool calls may complete before the worker exits. Don't promise "stopped immediately".
  • Cancelling a rescue job does NOT revert the diff. If Codex already wrote files under --write, those changes stay on disk. Remind the user to git diff / git restore if needed.
  • No job-id == most recent active. Only one job at a time is the common case, so this usually does what the user wants — but with multiple active jobs it can surprise. When in doubt, run status first and cancel by explicit ID.
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 · 38 lines · 43 tokens per session scan A 083cd72940f8

Subscribe to this mod's changes

codex-cancel is a skill published in the GitHub repository LeeJuOh/claude-code-zero (51 stars, last pushed 2d ago), licensed MIT. It adds 43 tokens to every session and 474 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.