Workflow with CLI Agents
Cursor (the IDE) and terminal agents are not rivals. This site already documents Claude Code and Codex. This chapter is only about one workflow and one set of rules.
Pick the door, then the model
Recommendation: Cursor for the interactive edit loop; Claude Code / Codex for long autonomous terminal work. Do not let three windows edit the same files at once.
Three CLIs in one repo
Install (commands follow each course / official page):
Cursor CLI modes match the editor: Shift+Tab or /plan, /ask, --mode=plan. MCP reads the same mcp.json files.
Align rules (no three oral handbooks)
Keep shared invariants (test commands, package boundaries, “never commit .env”) in root AGENTS.md only. Cursor reads it; Claude Code / Codex also honor markdown instruction files.
Cursor also loads skills from .claude/skills/ and .codex/skills/ (and the home-directory twins), which helps a shared repo. Do not copy three drifting “always bun / always npm” notes—one source of truth, and the other files say “see root AGENTS.md.”
Leave Cursor-only behavior (alwaysApply, globbed UI rules) in .mdc. Hooks, permission prompts, and sandboxes belong in the Claude Code and Codex courses.
A recommended day
Morning — scope in Cursor
- Open the repo,
Ctrl+I, explain the module (Quick Start). - Large feature:
Shift+Tab, save the plan to the workspace. - Tiny local edits with Tab /
Ctrl+K.
Afternoon — hand the long job to a terminal
Give the CLI the mechanical, checkable slice of the plan. Commit or stash first so two agents do not collide:
Evening — review back in Cursor
git diff, then ask Agent to review—not to regenerate the feature:
Conflicts and locking
- Only one agent writes files at a time. The other stays on Ask / read-only review.
- Commit or branch before a long CLI job. Cursor checkpoints will not revert the other agent’s terminal edits.
- Do not run overlapping global MCP JSON in the IDE and CLI unless you understand precedence.
- Credentials stay in environment variables; never in rule files.
When Cursor alone is enough
- You are tuning CSS / components and need the browser tool plus instant diffs
- You are teaching: the sidepane is easier to narrate than a terminal log
- The repo has no
CLAUDE.md/ Codex setup and you do not want another stack today
Leave the IDE when the job needs 30+ minutes, fine-grained permission prompts, or CI—open Claude Code or Codex and follow their install chapters.