- Use bash workdir param so Codex wakes up in a 'little box' - Prevents reading unrelated files (like my soul.md lol) - Added rule: NEVER offer to build it yourself when user asks for Codex - gpt-5.2-codex requires medium reasoning effort
3.1 KiB
3.1 KiB
name, description, metadata
| name | description | metadata | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| coding-agent | Run Claude Code, Codex CLI, or OpenCode via tmux for resilient coding sessions. |
|
Coding Agent (tmux-first)
Use tmux for all coding-agent CLIs. Keep sessions resumable and logs visible.
Quick preflight
command -v claude codex opencode tmux
If none of claude, codex, opencode exist, stop and ask to install.
tmux baseline
# Create or attach
tmux new -A -s coding-agent
# Split panes
tmux split-window -h
tmux split-window -v
# Leave running, detach
tmux detach
Claude Code
Interactive (preferred in tmux):
claude— start sessionclaude -c— continue most recentclaude -r ""— pickerclaude -r <session_id>— resume specific
Codex CLI
⚠️ Model-specific settings required!
| Model | Config Needed |
|---|---|
gpt-4o |
Works with defaults |
gpt-5.2-codex |
Requires -c reasoning_effort="medium" (NOT low/high!) |
o3 |
❌ Not available with ChatGPT accounts |
One-shot with tmux (recommended):
# IMPORTANT: Use bash workdir param to start in the target folder!
# This way Codex "wakes up in a little box" - only sees relevant files
# Default model (gpt-4o)
bash workdir:~/project/folder command:"tmux new -d -s codex-task 'codex exec \"Your task\"'"
# gpt-5.2-codex (MUST use medium reasoning)
bash workdir:~/project/folder command:"tmux new -d -s codex-task 'codex exec --model gpt-5.2-codex -c reasoning_effort=\"medium\" \"Your task\"'"
# Full auto mode (sandboxed, auto-approve)
bash workdir:~/project/folder command:"tmux new -d -s codex-task 'codex exec --full-auto \"Your task\"'"
# Monitor progress
tmux capture-pane -t codex-task -p | tail -20
Interactive:
codex "Your prompt"codex resumecodex resume --lastcodex resume --session <id>
Apply changes:
codex apply
Useful flags:
-s workspace-write— Allow writing to workspace--full-auto— Sandboxed + auto-approve-C <dir>— Set working directory--skip-git-repo-check— Run outside git repos
OpenCode
One-shot:
opencode run "Write a Python function that ..."opencode run -m anthropic/claude-sonnet-4-5 "Complex task"opencode run -m openai/gpt-5.2 "Coding task"opencode run -m google/gemini-2.5-pro "Research task"
Interactive:
opencodeopencode -copencode -s <session-id>
Session management:
opencode session listopencode export [sessionID]opencode import <file>
Notes
- Always prefer tmux — keeps history, survives disconnects, allows monitoring
- For auth:
claude,codex login,opencode auth - Check tmux session:
tmux attach -t <session-name> - List sessions:
tmux list-sessions
⚠️ IMPORTANT: Respect Tool Choice!
If user asks for Codex/Claude Code/OpenCode → USE THAT TOOL!
- NEVER offer to "just build it yourself" instead
- NEVER kill a running session because it's "too slow"
- Let the tool complete its work — be patient!
- The user wants to test/use that specific tool for a reason