Control

Commands

Slash commands expose actions inside an agent application. Some control the session; others invoke reusable prompts or skills. Their names and behavior depend on the installed tool.

Session Controls

  • Codex offers /clear or /new to start a fresh conversation; Claude Code offers /clear. A reset clears context but does not undo file changes or external actions.
  • Both tools offer /compact to summarize context into a shorter record.
  • Codex offers /status to inspect context or session state; Claude Code offers /context or /status.
  • Claude Code offers /rewind to return to an earlier checkpoint; in Codex, use the conversation controls supported by the installed version.

Read the application's command menu before following an example. A conversation reset does not undo file changes or external actions. The Context Management lesson explains how to preserve useful work before changing the conversation.

Reusable Tasks

A repeated review can become a reusable instruction: read the requirement and inspect the diff, then run the relevant checks and report concrete discrepancies. Store that instruction with the project so you can review and version it.

Claude Code skills and Codex skills can package instructions and supporting resources. Invocation and file layout differ. A custom command from a course demonstration is not necessarily a built-in command in either product.

When A Prompt Becomes A Command

A one-off request with no repeatable shape works best as a plain prompt. A task you repeat with the same steps and different inputs belongs in a reusable command or skill. If that task also starts from an outside event, such as a new issue or a scheduled time, it belongs in a pipeline with a trigger.

Write the command once and reuse it. Only the variables change between runs, such as the issue number or the target branch. A review command for the pipeline editor, for example, takes the branch name and runs the same checks every time. Each improvement to the command carries into every later run.

Keep Commands Out Of The Way

Claude Code slash commands and skills differ in one useful way. A skill the model can invoke on its own places its description in the context of every session, and a large library of them fills the context before work begins. A skill can opt out of model invocation. It then runs only when a person types its slash command, and its description stays out of the context until then.

Review the installed commands and skills from time to time and remove the ones no one uses. A short list costs less context and leaves fewer near-duplicates for the model to confuse.

Commands As Pipeline Stages

A command also works with no person at the keyboard. Claude Code runs headless with claude -p and Codex runs headless with codex exec. Either can take a command as its prompt, so a scheduler or runner can start the command on a trigger and record its output.

Give each command one task. If a command needs subagents for separate jobs, split those jobs into separate stages with a gate between them. Each stage then starts with a clean context and produces a result the runner can check.

Keep Execution Explicit

A command called “review” does not prove that review occurred. Its output should name the revision and the checks. It should also name the findings and any unresolved limitations. Fixed procedures such as launching a known test command can live in scripts the skill uses.

September, 2026

Search the website