{"skill":{"slug":"codex-tmux","displayName":"Codex via tmux (WSL2 / Custom Proxy)","summary":"Launch long-running Codex (or Claude Code) coding tasks via tmux on WSL2/Linux, bypassing SIGTERM timeouts. Use this skill INSTEAD OF coding-agent whenever:...","description":"---\nname: codex-tmux\ndescription: >\n  Launch long-running Codex (or Claude Code) coding tasks via tmux on WSL2/Linux, bypassing SIGTERM timeouts.\n  Use this skill INSTEAD OF coding-agent whenever: (1) the task may take >60s, (2) you need full-auto Codex execution,\n  (3) you are on WSL2 with a custom OpenAI-compatible proxy (OPENAI_BASE_URL), (4) you want to monitor/steer a\n  background Codex session mid-run, (5) building or extending the MyClaw project, (6) any multi-file code generation\n  task. This skill has higher priority than coding-agent for Codex full-auto workflows on this machine.\n  Triggers: codex tmux, long task, full-auto, MyClaw, background codex, WSL2 coding agent.\n---\n\n# Codex via tmux (WSL2 / Custom Proxy)\n\nPreferred pattern for all Codex full-auto tasks on this machine. Avoids SIGTERM, supports mid-run steering.\n\n## Environment (this machine)\n\n```bash\nOPENAI_API_KEY=\"sk-5Ds6eFbTEE1zu5fQ14F4FfB5892b419dB1BfC7292147B9Ef\"\nOPENAI_BASE_URL=\"http://152.53.52.170:3003/v1\"\n```\n\nAlways pass both vars. Do NOT rely on shell inheritance — OpenClaw subprocesses don't source `.bashrc`.\n\n## Standard Launch Pattern\n\n```bash\nSESSION=\"codex-<feature>\"   # e.g. codex-auth, codex-tools\nWORKDIR=~/MyClaw            # or target repo\n\ntmux new-session -d -s \"$SESSION\" -c \"$WORKDIR\" \\\n  \"OPENAI_API_KEY='sk-5Ds6e...' OPENAI_BASE_URL='http://152.53.52.170:3003/v1' \\\n   codex --model gpt-5.3-codex --full-auto '$(cat /tmp/task.txt)'\"\n```\n\nWrite long prompts to `/tmp/task.txt` first, then reference via `$(cat /tmp/task.txt)`.\n\n## Monitoring\n\n```bash\n# Check if alive\ntmux has-session -t \"$SESSION\" 2>/dev/null && echo running || echo done\n\n# Tail output (last 50 lines)\ntmux capture-pane -t \"$SESSION\" -p | tail -50\n\n# Or via OpenClaw exec:\nexec(\"tmux capture-pane -t codex-auth -p | tail -30\")\n```\n\n## Mid-run Steering\n\n```bash\ntmux send-keys -t \"$SESSION\" \"停一下。先做 API 层，不要改 UI。\" Enter\ntmux send-keys -t \"$SESSION\" \"类型定义在 src/types.ts，用那个。\" Enter\n```\n\n## Task JSON Tracking\n\nWrite to `/tmp/codex-tasks.json` to track parallel jobs:\n\n```json\n{\n  \"id\": \"feat-tools\",\n  \"session\": \"codex-tools\",\n  \"model\": \"gpt-5.3-codex\",\n  \"desc\": \"实现工具系统 exec/read/write/web_fetch\",\n  \"repo\": \"MyClaw\",\n  \"startedAt\": 1772433000000,\n  \"status\": \"running\"\n}\n```\n\n## Completion Check\n\nPoll every 2–3 min via:\n```bash\ntmux has-session -t \"$SESSION\" 2>/dev/null || echo \"DONE\"\ngit -C \"$WORKDIR\" log --oneline -3\n```\n\nCodex \"完成\" = tmux session 自动退出 + git commit 存在。\n\n## Cleanup\n\n```bash\ntmux kill-session -t \"$SESSION\" 2>/dev/null\ngit worktree prune\n```\n\n## MyClaw-Specific Notes\n\n- Repo: `~/MyClaw`, GitHub: https://github.com/InuyashaYang/MyClaw\n- 模型首选 `gpt-5.3-codex`，轻量测试用 `gpt-4.1-mini`\n- 详细已知坑见 → `references/lessons.md`\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":206,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1772434628143,"updatedAt":1779219506427},"latestVersion":{"version":"1.0.0","createdAt":1772434628143,"changelog":"Initial release: tmux-based Codex orchestration, SIGTERM bypass, WSL2 custom proxy support, MyClaw project context","license":null},"metadata":null,"owner":{"handle":"inuyashayang","userId":"s170rd51z98h8bxejh6bwa3at18841ag","displayName":"jiao yang","image":"https://avatars.githubusercontent.com/u/179995636?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779972832753}}