This project includes an MCP pair-programming server. When working on tasks, follow this collaborative workflow.
See Also:
- SETUP_GUIDE.md - Complete setup instructions
- WORKFLOW.md - Detailed collaboration patterns
- QUICK_REFERENCE.md - Command examples
- CONSTITUTION.md - Persistent team rules prepended to every spawn prompt
- TEAM_RULES.md - Shipping team-wide rules from a shared devtools repo
You are codex in the pair programming system.
Three agents collaborate in this system:
cursor— Cursor IDE agentclaude-code— Claude Code CLI agentcodex(you) — OpenAI Codex CLI agent
All agents share the same state via ~/.config/stringwork/state.sqlite.
Every spawn prompt may be prepended with a layered "constitution" — a
set of markdown files that capture team rules. The preamble in
claim_next and get_work_context lists which files were resolved for
your current task; treat them as authoritative and read them before
acting. See docs/CONSTITUTION.md for the file
format and docs/TEAM_RULES.md for how teams ship
shared rules.
-
Check session context first:
Use get_session_context for 'codex'This shows unread messages, tasks, presence status, and session notes.
-
Set your presence:
Use set_presence agent='codex' status='working' workspace='/path/to/project' -
Read any unread messages:
Use read_messages for 'codex' -
Check for assigned tasks:
Use list_tasks with assigned_to='codex'
Piggyback notifications: Every tool response automatically includes a banner if you have unread messages or pending tasks. This means you'll discover new messages on your next tool call without explicit polling.
Auto-respond: The server can automatically invoke you via codex exec resume --last when cursor or claude-code sends you a message. This preserves your conversation context across invocations. Configured in mcp/config.yaml under auto_respond.
-
Check for constraints:
Use get_work_context with task_id=XTasks may include constraints set by the driver (e.g. "read-only", scoped file lists). When present, you MUST obey them. Most tasks have no constraints.
-
Claim the task:
Use update_task with id=X, status='in_progress', updated_by='codex' -
Do the work using your native Codex tools (file read/write, search, git, commands).
-
Report findings to your pairs:
Use send_message from='codex' to='cursor' with your findings -
Mark task complete:
Use update_task with id=X, status='completed', updated_by='codex'
Send a message to your pairs:
Use send_message from='codex' to='cursor' content='Question or blocker description'
Use send_message from='codex' to='claude-code' content='Question or blocker description'
Use create_task with title='Task description' assigned_to='cursor' created_by='codex'
Use create_task with title='Task description' assigned_to='claude-code' created_by='codex'
When asked to review code, use your native /review capability for structured reviews.
-
Review against a base branch — diffs your work against its upstream and highlights risks before a PR:
/review # Then select "Review against a base branch" -
Review uncommitted changes — inspects staged, unstaged, and untracked files:
/review # Then select "Review uncommitted changes" -
Review a specific commit — reads the exact change set for a SHA:
/review # Then select "Review a commit" -
Custom review instructions — run a focused review with a specific prompt:
/review # Then select "Custom review instructions" # Example: "Focus on security issues and error handling"
When auto-spawned for a review task, use codex exec review to run a non-interactive code review:
codex exec review "Focus on security, error handling, and test coverage"After reviewing, always send findings via the MCP coordination tools:
Use send_message from='codex' to='cursor' content='
## Code Review Findings
### Critical Issues
1. ...
### Important
2. ...
### Suggestions
3. ...
'
Codex has built-in web search enabled by default. Use it when you need:
- Up-to-date API documentation
- Current best practices for a library or framework
- Information about error messages or known issues
Web search runs from a cached index by default. For live results, the server can launch Codex with --search or set web_search = "live" in config.
When your pairs share screenshots or design specs, you can process them:
codex -i screenshot.png "Implement this design"
codex --image mockup.png,spec.png "Build the UI from these specs"Your sessions are stored locally at ~/.codex/sessions/. The auto-respond system uses resume --last to maintain context across invocations, so you accumulate knowledge about:
- Prior tasks and decisions
- Code you've reviewed or written
- Project architecture understanding
- Conversation history with your pairs
To manually resume a specific session:
codex resume # picker of recent sessions
codex resume --last # most recent session
codex resume <SESSION_ID> # specific sessionServer-side session continuation: When you report your CLI session ID on your first heartbeat (session_id parameter), the Stringwork server stores it. If you get cancelled and respawned (e.g. due to being stuck), the server injects --session <your-session-id> into the spawn command so you automatically resume your previous conversation context.
get_session_context- Full session context (messages, tasks, presence, notes)set_presence- Update status and workspaceappend_session_note- Add shared note or decisionsend_message- Message your pairsread_messages- Read messagescreate_task- Create task (auto-notifies assignee; supports requires_review for quality gates)list_tasks- List tasks (shows dependency status, review gates, failure info)update_task- Update task (auto-notifies on completion; supports review_status for approval gates)replay_task- Reset failure tracking and re-queue a blocked/pending task (DLQ recovery)create_plan- Create shared planget_plan- View plan(s); omit ID to list allupdate_plan- Add or update plan itemshandoff- Hand off work with summary and next stepsclaim_next- Claim next task (dry_run to peek)report_progress- Report structured progress on a taskrequest_review- Request code review from pairlock_file- Lock, unlock, check, or list file locksregister_agent- Register a custom agentlist_agents- List all available agentsworker_status- (Driver) List workers with progress, process activity, SLA statusheartbeat- (Workers) Signal liveness with progress infocancel_agent- (Driver) Cancel a worker's tasks, send STOP signal, and kill its processget_work_context- Get task context (relevant files, background, constraints, shared notes)update_work_context- Add shared notes to a task's work context
Use your native Codex tools for files, search, git, web search, and commands.
When running interactively, control what Codex can do:
- Auto (default) — read, edit, and run commands within the workspace
- Read-only — browse files only, no changes without approval
- Full Access — full machine access including network (use sparingly)
When auto-spawned, --full-auto is used (workspace-write sandbox).
For hands-off collaboration:
- Call
claim_next agent='codex' dry_run=trueto see what to do - Call
claim_next agent='codex'to claim the task - Do the work
- Call
update_task id=X status='completed'orhandoffwhen done - Repeat!
npm install -g @openai/codex
# or
brew install --cask codexcodex mcp add stringwork -- /path/to/mcp-stringworkOr for HTTP transport (requires http_port: 8943 and daemon mode for a stable URL):
codex mcp add stringwork -- npx -y mcp-remote http://localhost:8943/mcpcodex mcp list
# Should show: stringwork- Always check
get_session_contextat the start of a session - Communicate findings via
send_message— your pairs can't see your work otherwise - Update task status so your pairs know what's in progress
- Use
/reviewfor structured code reviews — it's your strongest differentiator - Use web search when you need current information
- The collaboration state is stored globally at
~/.config/stringwork/state.sqlite(shared across all agents on this machine)
- Comprehensive guides: See docs/ directory
- Command examples: QUICK_REFERENCE.md
- Your pairs: Message cursor or claude-code with questions
- State file:
~/.config/stringwork/state.sqlite(global, shared across all agents)