Coding agent workflows

A Practical Codex CLI Workflow for Mac Developers

A useful Codex CLI workflow produces a change you can explain and verify. The terminal conversation is only one part of that process: repository state, permissions, acceptance criteria, test evidence, and review all need to agree. This guide proposes a repeatable loop for Mac developers, from opening the right checkout to returning to an interrupted session. The worked example is illustrative; adapt its paths and validation commands to your repository.

AI-assisted technical guide with linked primary sources. Examples are illustrative unless stated otherwise. How these guides are made.

Start with an identifiable checkout and a known baseline

Install the CLI using the method listed in the official Codex CLI documentation, then launch codex from your project directory. Sign-in choices depend on the available authentication setup. Record the installed version when sharing a reproducible workflow, since command behavior and configuration can change.

codex --version
git status --short
git branch --show-current
codex

Before delegating, inspect existing edits and decide who owns them. An agent cannot reliably distinguish your unfinished experiment from the change it should complete unless you supply that context. For unrelated parallel tasks, use separate checkouts or Git worktrees. A separate branch in a shared directory does not prevent two running sessions from editing the same working files.

Run the narrow existing check that matters to the task before asking for a fix. If it already fails, capture the failure. Otherwise a later failing test can be misattributed to the agent, and a passing test may conceal that the original problem was never reproduced.

Put stable project rules in AGENTS.md

Codex reads AGENTS.md guidance as it starts work. The official discovery guide explains global guidance, project guidance, overrides, and limits. Keep the file focused on facts a new contributor needs: where the code lives, which commands validate a change, and which constraints must survive a refactor.

For a small service, a useful instruction might say: “Routes live in src/routes; database migrations require a compatibility note; run the route test suite for request behavior changes.” That gives Codex a route to evidence. “Always write excellent code” supplies no decision rule.

Keep temporary task details in the task message. Otherwise yesterday’s exception can become tomorrow’s repository policy. When instructions change during a long-running session, explicitly tell the session what changed; restart when you need to verify startup discovery. Do not assume an instruction file is a security boundary: permissions enforce access, while project guidance describes expected behavior.

Give Codex a bounded task with observable success

Consider an endpoint that accepts an empty display name and creates an unusable profile. “Fix validation” leaves open whether to trim whitespace, change the database, rewrite every form, or alter the API response format. A tighter brief makes those decisions reviewable before implementation.

Task: reject blank display names in POST /profiles.
First inspect the current route and validation tests.
Preserve the existing error response shape.
Treat empty and whitespace-only names as invalid.
Keep valid names and other profile fields unchanged.
Add focused regression coverage for those inputs.
Run the relevant existing test command.
Report changed files, test results, and remaining uncertainty.
Do not deploy or change the database schema.

This is a proposed task contract, not a guarantee of model behavior. The important detail is that each acceptance condition corresponds to something you can inspect: an input, a response, a test, or a constrained diff. If discovering the code reveals that whitespace normalization belongs in a shared library, ask for the impact before expanding scope. A short clarification there can prevent a broad cleanup disguised as a bug fix.

Set permissions before implementation begins

Use /permissions to inspect or choose the active access boundary. The official approvals and security documentation distinguishes sandbox enforcement from approval behavior. Workspace editing, access outside the workspace, and command networking are separate concerns; managed settings can constrain what is available.

For the profile example, begin with the access needed to inspect files and run local checks. If a dependency download requires networking, evaluate that request in context. A request to access production credentials is a different operation and is unnecessary for an ordinary validation fix with local fixtures.

Read the actual command and target when approving an escalation. Ask what will change and how the result will be checked. Repeated permission prompts may indicate a missing development dependency or a poorly scoped workflow. They are not a reason to grant unrestricted access to make the prompts disappear. Conversely, needless manual approval for every harmless local read can consume attention that should go to consequential actions.

Require evidence tied to the requested behavior

During implementation, watch for a mismatch between activity and progress. Many edited files do not demonstrate a correct fix. A credible result should show where validation occurs, why the selected layer is appropriate, which cases changed, and which checks ran. OpenAI’s best-practices guide recommends clear verification expectations and review as part of the development loop.

For the example, inspect the empty-string and whitespace cases alongside a valid-name case. A regression test that merely duplicates the new helper’s implementation can pass while the actual route still bypasses it. Prefer evidence through the externally relevant behavior when practical.

Keep three outcomes distinct: a check passed, a check failed, or a check could not run. If the environment lacks a database, “tests unavailable” is useful information; relabeling that as success is not. When a fix follows a failed check, rerun the affected check against the final files rather than relying on earlier output.

Resume the intended session, then reconcile its state

The developer command reference documents codex resume for selecting a saved conversation and codex resume --last for the latest session in the current working directory. The --all option broadens selection beyond that directory. Prefer choosing deliberately when several tasks have similar names.

git status --short
git branch --show-current
codex resume
# Use only when the latest session here is the intended task:
codex resume --last

A resumed conversation does not prove that files, dependencies, or branches still match its earlier assumptions. Tell Codex what changed while it was away: another branch landed, you edited the validator, or a test was corrected. Ask it to recheck the diff and the next acceptance condition before continuing.

For work likely to span days, keep a short checkpoint: task goal, branch, completed behavior, exact checks and outcomes, unresolved questions, and next action. This artifact helps recovery even when conversational context is incomplete. Avoid copying secrets or entire logs into it.

Review a defined diff before accepting the change

Inside the CLI, /review opens review presets. According to the official code-review guide, the dedicated review reports prioritized findings without modifying the working tree. Choose whether you want uncommitted changes, a commit, or a comparison against a base branch.

Review scope matters. Uncommitted work can include edits from you or another tool; a base-branch review can include more than the current task. Confirm the file set first. For the validation example, focus on response compatibility, whether every request path uses the validation, and whether a valid name still reaches storage.

Treat findings as leads to verify, not automatic verdicts. Check each trigger against the code and requirements. Also examine omissions: no warning does not establish security or correctness. After applying a review fix, rerun the relevant checks and inspect the final diff yourself before deciding what to commit.

Keep the attention loop manageable on Mac

When one session implements validation and another investigates a separate issue, the bottleneck may become knowing which one needs your decision. Purrvio provides a local visibility layer for supported coding sessions, with Claude Code and Codex receiving the richest session support. It reads local session records and processes without requiring agent hooks.

Use that visibility to return to the right task, then inspect the actual request and evidence in the terminal. Purrvio supports session navigation in Ghostty and Terminal.app; direct replies require Ghostty and Automation permission. It does not replace Codex permissions, run your orchestration policy, or verify tests.

The free Purrvio Mac preview supports macOS 13 or later on Apple silicon and Intel. It is locally signed and not Apple-notarized, so read its first-launch notes before installation.

Use a small checklist for every task

  • Identify the repository, branch, existing edits, and intended session.
  • Reproduce the problem or record the current verification baseline.
  • Supply stable project guidance and a bounded task with acceptance criteria.
  • Inspect permissions before allowing commands with broader effects.
  • Require behavioral evidence and truthful check outcomes.
  • Reconcile files and assumptions whenever resuming work.
  • Review the defined final diff, then make the human acceptance decision.

Keep the loop proportional to risk. A small text correction does not need a service-level test campaign. A change to authentication or persisted data deserves stronger validation and explicit recovery planning. The workflow is successful when the evidence matches the change’s consequences.

Frequently asked questions

How do I continue an earlier Codex CLI task?

Run codex resume to select a saved session. codex resume --last resumes the latest session scoped to the current working directory. Check the branch and working files first, and describe intervening changes before continuing.

Does a successful Codex review mean the change is ready to ship?

A review is one source of evidence. Verify its findings, inspect the final diff, run checks appropriate to the behavior, and follow your normal acceptance and release process. A review with no findings is not a correctness guarantee.

Does Purrvio control Codex permissions?

No. Purrvio helps you see supported local sessions and return to the right terminal. Codex and your environment enforce their own permissions; you still evaluate approvals and verify results.

Sources and further reading

Primary references checked for this guide on 10 November 2026. Documentation can change; confirm version-specific behavior before using commands in a production workflow.

  1. OpenAI: Codex CLI

    Verified the local repository workflow, installation entry point, startup, and supported terminal capabilities.

  2. OpenAI: Custom instructions with AGENTS.md

    Verified instruction discovery, global and project guidance, overrides, startup behavior, and bounded instruction size.

  3. OpenAI: Agent approvals and security

    Verified the distinction between approval policy and sandbox enforcement and the permissions command.

  4. OpenAI: Best practices

    Verified the emphasis on project context, defined completion, verification, Git checkpoints, and review.

  5. OpenAI: Developer commands

    Verified codex resume, --last current-directory scoping, --all broader selection, and saved working-directory behavior.

  6. OpenAI: Code review

    Verified CLI /review presets, review scopes, prioritized findings, and review without working-tree edits.

Download Purrvio.

Free Mac preview. No account or API keys.

This locally signed preview isn’t Apple-notarized. macOS may block the first launch.

Download free preview ↗

3.2 MB ZIP · Apple silicon and Intel · macOS 13.0+

Read installation steps

One email before you go.

I’ll send a short setup note and reply if you hit a snag. No spam, unsubscribe anytime.