cc-use You are the outer supervisor. Use this skill's helper as an implementation detail to start and supervise an inner CC session in tmux. Here, CC means a coding command-line agent. Depending on the host and local configuration, that can mean Claude Code, Codex CLI, or another compatible coding CLI. When To Use This Skill Use cc-use for long-term tasks where the outer session should keep the global state clean and deliberate while an inner interactive session handles focused execution. The point is not just parallelism; it is supervision. The outer session keeps the plan, product intent, r…

s/\\x1b\\\\[[0-?]*[ -\\\\/]*[@-~]//g; s/[[:space:]]+$//'\n}\n\ntmux_has_session() {\n tmux has-session -t \"$1\" >/dev/null 2>&1\n}\n\ntmux_capture() {\n tmux capture-pane -t \"$1\" -p 2>/dev/null | normalize_screen\n}\n\ntmux_capture_scrollback() {\n local session=\"$1\"\n local start=\"$2\"\n local end=\"$3\"\n tmux capture-pane -t \"$session\" -p -S \"$start\" -E \"$end\" 2>/dev/null | normalize_screen\n}\n\ntmux_send_text() {\n local session=\"$1\"\n local text=\"$2\"\n local tmp\n local buffer\n tmp=\"$(mktemp)\"\n buffer=\"cc-use-send-$\"\n printf '%s' \"$text\" > \"$tmp\"\n tmux send-keys -t \"$session\" C-u\n tmux load-buffer -b \"$buffer\" \"$tmp\"\n tmux paste-buffer -d -b \"$buffer\" -t \"$session\"\n rm -f \"$tmp\"\n sleep 0.5\n tmux send-keys -t \"$session\" Enter\n sleep 0.7\n tmux send-keys -t \"$session\" C-m\n sleep 0.7\n tmux send-keys -t \"$session\" Enter\n}\n\nbuild_inner_task_prompt() {\n printf '%s' \"$1\"\n}\n\nbuild_codex_command() {\n local profile=\"$1\"\n local sandbox=\"$2\"\n local approval=\"$3\"\n printf '%q --no-alt-screen --ask-for-approval %q --sandbox %q' \"codex\" \"$approval\" \"$sandbox\"\n if [ -n \"$profile\" ]; then\n printf ' --profile %q' \"$profile\"\n fi\n}\n\nresolve_codex_binary() {\n local codex_path\n local prefix\n local package_root\n local native\n codex_path=\"$(command -v codex 2>/dev/null || true)\"\n [ -n \"$codex_path\" ] || die \"codex command not found\"\n\n # npm global layout: \u003cprefix>/bin/codex -> \u003cprefix>/lib/node_modules/@openai/codex/bin/codex.js\n prefix=\"$(cd \"$(dirname \"$codex_path\")/..\" && pwd)\"\n package_root=\"$prefix/lib/node_modules/@openai/codex\"\n if [ -d \"$package_root\" ]; then\n native=\"$(find \"$package_root\" -path '*/vendor/*/codex/codex' -type f -perm -111 2>/dev/null | head -1)\"\n if [ -n \"$native\" ]; then\n printf '%s' \"$native\"\n return\n fi\n fi\n\n printf '%s' \"$codex_path\"\n}\n\nresolve_claude_binary() {\n local claude_path\n claude_path=\"$(command -v claude 2>/dev/null || true)\"\n [ -n \"$claude_path\" ] || die \"claude command not found\"\n printf '%s' \"$claude_path\"\n}\n\nbuild_agent_command() {\n local agent=\"$1\"\n local profile=\"$2\"\n local sandbox=\"$3\"\n local approval=\"$4\"\n validate_agent \"$agent\"\n case \"$agent\" in\n codex)\n build_codex_command \"$profile\" \"$sandbox\" \"$approval\"\n ;;\n claude)\n [ -z \"$profile\" ] || die \"--profile is only supported for codex\"\n printf '%q --dangerously-skip-permissions' \"claude\"\n ;;\n esac\n}\n\nlaunch_agent_session() {\n local session=\"$1\"\n local project=\"$2\"\n local command=\"$3\"\n\n tmux new-session -d -s \"$session\" -c \"$project\"\n tmux set-option -t \"$session\" history-limit 50000 >/dev/null 2>&1 || true\n\n # Start the agent from the pane's interactive shell so user shell startup files\n # can populate PATH, provider keys, and other local environment settings.\n sleep 1\n tmux send-keys -t \"$session\" \"$command\" Enter\n}\n\nbuild_agent_exec_command() {\n local agent=\"$1\"\n local profile=\"$2\"\n local sandbox=\"$3\"\n local approval=\"$4\"\n local project=\"$5\"\n local search=\"$6\"\n validate_agent \"$agent\"\n case \"$agent\" in\n codex)\n printf '%q' \"$(resolve_codex_binary)\"\n if [ -n \"$profile\" ]; then\n printf ' --profile %q' \"$profile\"\n fi\n printf ' --ask-for-approval %q --sandbox %q' \"$approval\" \"$sandbox\"\n if [ \"$search\" = \"true\" ]; then\n printf ' --search'\n fi\n printf ' exec --skip-git-repo-check --cd %q' \"$project\"\n ;;\n claude)\n [ -z \"$profile\" ] || die \"--profile is only supported for codex\"\n printf '%q -p' \"$(resolve_claude_binary)\"\n ;;\n esac\n}\n\nwrite_watch_state() {\n local project_dir=\"$1\"\n local session=\"$2\"\n local digest=\"$3\"\n local silence_started=\"$4\"\n local next_check=\"$5\"\n local observations=\"$6\"\n local last_observation_json=\"${7:-null}\"\n local state\n state=\"$(watch_dir \"$project_dir\" \"$session\")\"\n mkdir -p \"$state\"\n cat > \"$state/watch.env\" \u003c\u003cEOF\nlast_digest=$(printf '%q' \"$digest\")\nsilence_started_at=$silence_started\nnext_check_at=$next_check\nobservation_count=$observations\nEOF\n cat > \"$state/watch.json\" \u003c\u003cEOF\n{\n \"last_digest\": \"$(printf '%s' \"$digest\" | json_escape)\",\n \"next_check_at\": $next_check,\n \"observation_count\": $observations,\n \"session\": \"$(printf '%s' \"$session\" | json_escape)\",\n \"silence_started_at\": $silence_started,\n \"last_observation\": $last_observation_json\n}\nEOF\n}\n\nload_watch_state() {\n local project_dir=\"$1\"\n local session=\"$2\"\n local env_file\n env_file=\"$(watch_dir \"$project_dir\" \"$session\")/watch.env\"\n if [ -f \"$env_file\" ]; then\n # shellcheck disable=SC1090\n source \"$env_file\"\n else\n last_digest=\"\"\n silence_started_at=0\n next_check_at=0\n observation_count=0\n fi\n}\n\ndecision_for_stable_screen() {\n decision_action=\"inspect\"\n decision_next=0\n decision_confidence=\"1.0\"\n decision_reason=\"The screen is stable; inspect screen_path semantically before deciding whether to wait, steer, or verify.\"\n}\n\nwatch_once() {\n local project_dir=\"$1\"\n local session=\"$2\"\n local initial_quiet=\"$3\"\n local poll_interval=\"$4\"\n local max_observations=\"$5\"\n local state\n local screens\n local history\n local curr\n local digest\n local now\n local sleep_for\n local observation_json\n state=\"$(watch_dir \"$project_dir\" \"$session\")\"\n screens=\"$state/screens\"\n history=\"$state/watch.observations.jsonl\"\n mkdir -p \"$state\" \"$screens\"\n\n load_watch_state \"$project_dir\" \"$session\"\n\n while :; do\n now=\"$(now_epoch)\"\n curr=\"$(mktemp)\"\n if ! tmux_capture \"$session\" > \"$curr\"; then\n observation_json=\"{\\\"event\\\":\\\"session_unavailable\\\",\\\"session\\\":\\\"$(printf '%s' \"$session\" | json_escape)\\\",\\\"observed_at\\\":$now}\"\n printf '%s\\n' \"$observation_json\"\n printf '%s\\n' \"$observation_json\" >> \"$history\"\n rm -f \"$curr\"\n return 0\n fi\n digest=\"$(hash_text \u003c \"$curr\")\"\n\n if [ \"$digest\" != \"${last_digest:-}\" ]; then\n silence_started_at=\"$now\"\n next_check_at=$((now + initial_quiet))\n write_watch_state \"$project_dir\" \"$session\" \"$digest\" \"$silence_started_at\" \"$next_check_at\" \"${observation_count:-0}\" \"null\"\n last_digest=\"$digest\"\n rm -f \"$curr\"\n sleep \"$poll_interval\"\n continue\n fi\n\n if [ \"${next_check_at:-0}\" -le 0 ]; then\n next_check_at=$((now + initial_quiet))\n write_watch_state \"$project_dir\" \"$session\" \"$digest\" \"${silence_started_at:-$now}\" \"$next_check_at\" \"${observation_count:-0}\" \"null\"\n fi\n\n if [ \"$now\" -ge \"$next_check_at\" ]; then\n local silence\n local screen_path\n silence=$((now - silence_started_at))\n observation_count=$((observation_count + 1))\n screen_path=\"$screens/$(safe_name \"$session\")-$(printf '%04d' \"$observation_count\").txt\"\n cp \"$curr\" \"$screen_path\"\n decision_for_stable_screen\n observation_json=\"{\\\"event\\\":\\\"observation\\\",\\\"session\\\":\\\"$(printf '%s' \"$session\" | json_escape)\\\",\\\"observed_at\\\":$now,\\\"silence_seconds\\\":$silence,\\\"screen_digest\\\":\\\"$digest\\\",\\\"screen_path\\\":\\\"$(printf '%s' \"$screen_path\" | json_escape)\\\",\\\"decision\\\":{\\\"action\\\":\\\"$decision_action\\\",\\\"next_check_after_seconds\\\":$decision_next,\\\"reason\\\":\\\"$(printf '%s' \"$decision_reason\" | json_escape)\\\",\\\"confidence\\\":$decision_confidence}}\"\n next_check_at=$((now + decision_next))\n write_watch_state \"$project_dir\" \"$session\" \"$digest\" \"$silence_started_at\" \"$next_check_at\" \"$observation_count\" \"$observation_json\"\n printf '%s\\n' \"$observation_json\"\n printf '%s\\n' \"$observation_json\" >> \"$history\"\n rm -f \"$curr\"\n [ \"$max_observations\" -le 0 ] || [ \"$observation_count\" -ge \"$max_observations\" ] && return 0\n else\n rm -f \"$curr\"\n fi\n\n now=\"$(now_epoch)\"\n sleep_for=\"$poll_interval\"\n if [ \"$next_check_at\" -gt \"$now\" ] && [ $((next_check_at - now)) -lt \"$sleep_for\" ]; then\n sleep_for=$((next_check_at - now))\n [ \"$sleep_for\" -le 0 ] && sleep_for=1\n fi\n sleep \"$sleep_for\"\n done\n}\n\ncmd_delegate() {\n local task=\"$1\"; shift\n local project=\".\"\n local session=\"\"\n local agent=\"codex\"\n local profile=\"\"\n local sandbox=\"workspace-write\"\n local approval=\"never\"\n local replace=false\n local initial_quiet=30\n local poll_interval=2\n local max_observations=1\n while [ \"$#\" -gt 0 ]; do\n case \"$1\" in\n --project) project=\"$2\"; shift 2 ;;\n --agent) agent=\"$2\"; shift 2 ;;\n --session) session=\"$2\"; shift 2 ;;\n --profile) profile=\"$2\"; shift 2 ;;\n --sandbox) sandbox=\"$2\"; shift 2 ;;\n --approval) approval=\"$2\"; shift 2 ;;\n --replace) replace=true; shift ;;\n --initial-quiet-seconds) initial_quiet=\"$2\"; shift 2 ;;\n --poll-interval) poll_interval=\"$2\"; shift 2 ;;\n --max-observations) max_observations=\"$2\"; shift 2 ;;\n *) die \"unknown delegate option: $1\" ;;\n esac\n done\n project=\"$(project_abs \"$project\")\"\n validate_agent \"$agent\"\n [ -n \"$session\" ] || session=\"$(session_name_for_project \"$project\" \"$agent\")\"\n\n if $replace && tmux_has_session \"$session\"; then\n tmux kill-session -t \"$session\" >/dev/null 2>&1 || true\n fi\n\n if ! tmux_has_session \"$session\"; then\n local command\n command=\"$(build_agent_command \"$agent\" \"$profile\" \"$sandbox\" \"$approval\")\"\n launch_agent_session \"$session\" \"$project\" \"$command\"\n echo \"launched $session: $command\"\n sleep 5\n tmux send-keys -t \"$session\" Enter\n sleep 1\n fi\n\n tmux_send_text \"$session\" \"$(build_inner_task_prompt \"$task\")\"\n watch_once \"$project\" \"$session\" \"$initial_quiet\" \"$poll_interval\" \"$max_observations\"\n}\n\ncmd_monitor() {\n local project=\".\"\n local agent=\"codex\"\n local session=\"\"\n local initial_quiet=30\n local poll_interval=2\n local max_observations=1\n while [ \"$#\" -gt 0 ]; do\n case \"$1\" in\n --project) project=\"$2\"; shift 2 ;;\n --agent) agent=\"$2\"; shift 2 ;;\n --session) session=\"$2\"; shift 2 ;;\n --initial-quiet-seconds) initial_quiet=\"$2\"; shift 2 ;;\n --poll-interval) poll_interval=\"$2\"; shift 2 ;;\n --max-observations) max_observations=\"$2\"; shift 2 ;;\n *) die \"unknown monitor option: $1\" ;;\n esac\n done\n project=\"$(project_abs \"$project\")\"\n validate_agent \"$agent\"\n [ -n \"$session\" ] || session=\"$(session_name_for_project \"$project\" \"$agent\")\"\n watch_once \"$project\" \"$session\" \"$initial_quiet\" \"$poll_interval\" \"$max_observations\"\n}\n\ncmd_scrollback() {\n local project=\".\"\n local agent=\"codex\"\n local session=\"\"\n local lines=2000\n local start=\"\"\n local end=\"-\"\n while [ \"$#\" -gt 0 ]; do\n case \"$1\" in\n --project) project=\"$2\"; shift 2 ;;\n --agent) agent=\"$2\"; shift 2 ;;\n --session) session=\"$2\"; shift 2 ;;\n --lines) lines=\"$2\"; shift 2 ;;\n --start) start=\"$2\"; shift 2 ;;\n --end) end=\"$2\"; shift 2 ;;\n *) die \"unknown scrollback option: $1\" ;;\n esac\n done\n case \"$lines\" in\n ''|*[!0-9]*) die \"--lines must be a positive integer\" ;;\n esac\n [ \"$lines\" -gt 0 ] || die \"--lines must be a positive integer\"\n if [ -z \"$start\" ]; then\n start=\"-$lines\"\n fi\n validate_line_spec \"$start\" \"--start\"\n validate_line_spec \"$end\" \"--end\"\n project=\"$(project_abs \"$project\")\"\n validate_agent \"$agent\"\n [ -n \"$session\" ] || session=\"$(session_name_for_project \"$project\" \"$agent\")\"\n tmux_capture_scrollback \"$session\" \"$start\" \"$end\"\n}\n\ncmd_project_status() {\n local project=\".\"\n local agent=\"codex\"\n local session=\"\"\n local as_json=false\n while [ \"$#\" -gt 0 ]; do\n case \"$1\" in\n --project) project=\"$2\"; shift 2 ;;\n --agent) agent=\"$2\"; shift 2 ;;\n --session) session=\"$2\"; shift 2 ;;\n --json) as_json=true; shift ;;\n *) die \"unknown project-status option: $1\" ;;\n esac\n done\n project=\"$(project_abs \"$project\")\"\n validate_agent \"$agent\"\n [ -n \"$session\" ] || session=\"$(session_name_for_project \"$project\" \"$agent\")\"\n load_watch_state \"$project\" \"$session\"\n local now silence remaining available\n now=\"$(now_epoch)\"\n if [ \"${silence_started_at:-0}\" -le 0 ]; then\n silence=0\n else\n silence=$((now - silence_started_at))\n fi\n remaining=$((next_check_at - now))\n [ \"$remaining\" -lt 0 ] && remaining=0\n if tmux_has_session \"$session\"; then available=true; else available=false; fi\n if $as_json; then\n cat \u003c\u003cEOF\n{\"config\":{\"project_dir\":\"$(printf '%s' \"$project\" | json_escape)\",\"session\":\"$(printf '%s' \"$session\" | json_escape)\",\"agent\":\"$(printf '%s' \"$agent\" | json_escape)\",\"session_available\":$available},\"watch\":{\"observation_count\":${observation_count:-0},\"silence_seconds\":$silence,\"seconds_until_next_check\":$remaining}}\nEOF\n else\n echo \"project: $project\"\n echo \"session: $session\"\n echo \"agent: $agent\"\n echo \"session_available: $available\"\n echo \"observations: ${observation_count:-0}\"\n echo \"silence_seconds: $silence\"\n echo \"seconds_until_next_check: $remaining\"\n fi\n}\n\nschedule_root() {\n printf '%s/.cc-use' \"$HOME\"\n}\n\nschedule_db() {\n printf '%s/schedules.json' \"$(schedule_root)\"\n}\n\nschedule_log_dir() {\n printf '%s/logs' \"$(schedule_root)\"\n}\n\nsource_user_shell_profile() {\n local env_file\n local rc\n local old_umask\n old_umask=\"$(umask)\"\n umask 077\n env_file=\"$(mktemp)\"\n umask \"$old_umask\"\n chmod 600 \"$env_file\" 2>/dev/null || true\n for rc in \"$HOME/.zshrc\" \"$HOME/.bashrc\" \"$HOME/.profile\"; do\n if [ -f \"$rc\" ]; then\n grep -E '^[[:space:]]*export[[:space:]]+[A-Za-z_][A-Za-z0-9_]*=' \"$rc\" >> \"$env_file\" 2>/dev/null || true\n fi\n done\n if [ -s \"$env_file\" ]; then\n set -a\n # shellcheck disable=SC1090\n source \"$env_file\" >/dev/null 2>&1 || true\n set +a\n fi\n rm -f \"$env_file\"\n}\n\nschedule_init() {\n mkdir -p \"$(schedule_log_dir)\"\n if [ ! -f \"$(schedule_db)\" ]; then\n printf '{\"schedules\":[]}\\n' > \"$(schedule_db)\"\n chmod 600 \"$(schedule_db)\" 2>/dev/null || true\n fi\n}\n\nschedule_id() {\n local prefix=\"$1\"\n if command -v openssl >/dev/null 2>&1; then\n printf '%s-%s' \"$prefix\" \"$(printf '%s-%s' \"$prefix\" \"$(now_epoch)-$\" | openssl dgst -sha256 -r | awk '{print substr($1,1,8)}')\"\n else\n printf '%s-%s' \"$prefix\" \"$(printf '%s-%s' \"$prefix\" \"$(now_epoch)-$\" | cksum | awk '{print $1}')\"\n fi\n}\n\nschedule_get() {\n local id=\"$1\"\n jq -e --arg id \"$id\" '.schedules[] | select(.id == $id)' \"$(schedule_db)\" 2>/dev/null\n}\n\nschedule_platform() {\n case \"$(uname -s)\" in\n Darwin) printf 'macos' ;;\n Linux) printf 'linux' ;;\n *) printf 'unsupported' ;;\n esac\n}\n\nscript_path() {\n local dir\n dir=\"$(cd \"$(dirname \"${BASH_SOURCE[0]}\")\" && pwd)\"\n printf '%s/%s' \"$dir\" \"$(basename \"${BASH_SOURCE[0]}\")\"\n}\n\nlaunchd_plist_path() {\n local id=\"$1\"\n printf '%s/Library/LaunchAgents/com.cc-use.%s.plist' \"$HOME\" \"$id\"\n}\n\nlaunchd_write_interval() {\n local id=\"$1\"\n local interval_seconds=\"$2\"\n local log_file=\"$3\"\n local plist\n local script\n plist=\"$(launchd_plist_path \"$id\")\"\n script=\"$(script_path)\"\n mkdir -p \"$HOME/Library/LaunchAgents\"\n cat > \"$plist\" \u003c\u003cPLIST\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003c!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n\u003cplist version=\"1.0\">\n\u003cdict>\n \u003ckey>Label\u003c/key>\n \u003cstring>com.cc-use.${id}\u003c/string>\n \u003ckey>ProgramArguments\u003c/key>\n \u003carray>\n \u003cstring>/bin/bash\u003c/string>\n \u003cstring>${script}\u003c/string>\n \u003cstring>schedule-run\u003c/string>\n \u003cstring>${id}\u003c/string>\n \u003c/array>\n \u003ckey>StartInterval\u003c/key>\n \u003cinteger>${interval_seconds}\u003c/integer>\n \u003ckey>StandardOutPath\u003c/key>\n \u003cstring>${log_file}\u003c/string>\n \u003ckey>StandardErrorPath\u003c/key>\n \u003cstring>${log_file}\u003c/string>\n \u003ckey>RunAtLoad\u003c/key>\n \u003cfalse/>\n\u003c/dict>\n\u003c/plist>\nPLIST\n launchctl unload \"$plist\" >/dev/null 2>&1 || true\n launchctl load \"$plist\" >/dev/null 2>&1 || true\n}\n\ncron_field_to_plist_keys() {\n local minute=\"$1\"\n local hour=\"$2\"\n local day=\"$3\"\n local month=\"$4\"\n local weekday=\"$5\"\n [ \"$minute\" != \"*\" ] && printf ' \u003ckey>Minute\u003c/key>\u003cinteger>%s\u003c/integer>\\n' \"$minute\"\n [ \"$hour\" != \"*\" ] && printf ' \u003ckey>Hour\u003c/key>\u003cinteger>%s\u003c/integer>\\n' \"$hour\"\n [ \"$day\" != \"*\" ] && printf ' \u003ckey>Day\u003c/key>\u003cinteger>%s\u003c/integer>\\n' \"$day\"\n [ \"$month\" != \"*\" ] && printf ' \u003ckey>Month\u003c/key>\u003cinteger>%s\u003c/integer>\\n' \"$month\"\n [ \"$weekday\" != \"*\" ] && printf ' \u003ckey>Weekday\u003c/key>\u003cinteger>%s\u003c/integer>\\n' \"$weekday\"\n return 0\n}\n\nlaunchd_write_calendar() {\n local id=\"$1\"\n local cron_expr=\"$2\"\n local log_file=\"$3\"\n local plist\n local script\n local minute hour day month weekday\n plist=\"$(launchd_plist_path \"$id\")\"\n script=\"$(script_path)\"\n read -r minute hour day month weekday \u003c\u003cEOF\n$cron_expr\nEOF\n [ -n \"${weekday:-}\" ] || die \"cron expression must have 5 fields\"\n mkdir -p \"$HOME/Library/LaunchAgents\"\n {\n cat \u003c\u003cPLIST\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003c!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n\u003cplist version=\"1.0\">\n\u003cdict>\n \u003ckey>Label\u003c/key>\n \u003cstring>com.cc-use.${id}\u003c/string>\n \u003ckey>ProgramArguments\u003c/key>\n \u003carray>\n \u003cstring>/bin/bash\u003c/string>\n \u003cstring>${script}\u003c/string>\n \u003cstring>schedule-run\u003c/string>\n \u003cstring>${id}\u003c/string>\n \u003c/array>\n \u003ckey>StartCalendarInterval\u003c/key>\n \u003cdict>\nPLIST\n cron_field_to_plist_keys \"$minute\" \"$hour\" \"$day\" \"$month\" \"$weekday\"\n cat \u003c\u003cPLIST\n \u003c/dict>\n \u003ckey>StandardOutPath\u003c/key>\n \u003cstring>${log_file}\u003c/string>\n \u003ckey>StandardErrorPath\u003c/key>\n \u003cstring>${log_file}\u003c/string>\n\u003c/dict>\n\u003c/plist>\nPLIST\n } > \"$plist\"\n launchctl unload \"$plist\" >/dev/null 2>&1 || true\n launchctl load \"$plist\" >/dev/null 2>&1 || true\n}\n\ncrontab_add() {\n local id=\"$1\"\n local cron_expr=\"$2\"\n local marker=\"#cc-use:${id}\"\n local script\n script=\"$(script_path)\"\n (crontab -l 2>/dev/null | grep -v \"$marker\" || true; printf '%s /bin/bash %q schedule-run %q %s\\n' \"$cron_expr\" \"$script\" \"$id\" \"$marker\") | crontab -\n}\n\nschedule_register() {\n local id=\"$1\"\n local type=\"$2\"\n local cron_expr=\"$3\"\n local interval_minutes=\"$4\"\n local log_file=\"$5\"\n case \"$(schedule_platform)\" in\n macos)\n if [ \"$type\" = \"heartbeat\" ]; then\n launchd_write_interval \"$id\" \"$((interval_minutes * 60))\" \"$log_file\"\n else\n launchd_write_calendar \"$id\" \"$cron_expr\" \"$log_file\"\n fi\n ;;\n linux)\n if [ \"$type\" = \"heartbeat\" ]; then\n crontab_add \"$id\" \"*/${interval_minutes} * * * *\"\n else\n crontab_add \"$id\" \"$cron_expr\"\n fi\n ;;\n *) echo \"cc-use: unsupported platform; schedule saved but not registered\" >&2 ;;\n esac\n}\n\nschedule_unregister() {\n local id=\"$1\"\n local marker=\"#cc-use:${id}\"\n local plist\n plist=\"$(launchd_plist_path \"$id\")\"\n if [ -f \"$plist\" ]; then\n launchctl unload \"$plist\" >/dev/null 2>&1 || true\n rm -f \"$plist\"\n fi\n if command -v crontab >/dev/null 2>&1; then\n crontab -l 2>/dev/null | grep -v \"$marker\" | crontab - 2>/dev/null || true\n fi\n}\n\nheartbeat_state_file() {\n local project=\"$1\"\n printf '%s/.cc-use/heartbeat-state.json' \"$project\"\n}\n\nheartbeat_state_init() {\n local file=\"$1\"\n mkdir -p \"$(dirname \"$file\")\"\n if [ ! -f \"$file\" ]; then\n cat > \"$file\" \u003c\u003c'JSON'\n{\n \"last_run\": null,\n \"last_result\": null,\n \"consecutive_ok\": 0,\n \"consecutive_errors\": 0,\n \"last_alert\": null,\n \"last_alert_time\": null,\n \"history\": []\n}\nJSON\n fi\n}\n\nheartbeat_state_update() {\n local file=\"$1\"\n local result=\"$2\"\n local duration=\"$3\"\n local summary=\"${4:-}\"\n local now\n local tmp\n now=\"$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")\"\n tmp=\"$(mktemp)\"\n jq --arg now \"$now\" --arg result \"$result\" --arg summary \"$summary\" --argjson duration \"$duration\" '\n .last_run = $now |\n .last_result = $result |\n if $result == \"ok\" then\n .consecutive_ok += 1 | .consecutive_errors = 0\n elif $result == \"alert\" then\n .consecutive_ok = 0 | .consecutive_errors = 0 | .last_alert = $summary | .last_alert_time = $now\n elif $result == \"error\" then\n .consecutive_ok = 0 | .consecutive_errors += 1\n else . end |\n .history = ([{time: $now, result: $result, duration_sec: $duration, summary: $summary}] + .history | .[0:20])\n ' \"$file\" > \"$tmp\" && mv \"$tmp\" \"$file\"\n}\n\nnotify_send() {\n local title=\"$1\"\n local body=\"$2\"\n local config\n local notifier\n local webhook\n config=\"$(schedule_root)/config.json\"\n [ -f \"$config\" ] || return 0\n notifier=\"$(jq -r '.default_notifier // empty' \"$config\" 2>/dev/null)\"\n [ -n \"$notifier\" ] || return 0\n webhook=\"$(jq -r --arg name \"$notifier\" '.notifiers[]? | select(.name == $name) | .webhook_url // empty' \"$config\" 2>/dev/null)\"\n [ -n \"$webhook\" ] || return 0\n curl -s -X POST \"$webhook\" -H \"Content-Type: application/json\" -d \"$(jq -n --arg text \"[$title] $body\" '{msg_type:\"text\",content:{text:$text}}')\" >/dev/null 2>&1 || true\n}\n\nlog_rotate() {\n local file=\"$1\"\n [ -f \"$file\" ] || return 0\n [ \"$(wc -c \u003c \"$file\" | tr -d ' ')\" -le 1048576 ] && return 0\n [ -f \"${file}.2\" ] && rm -f \"${file}.3\"\n [ -f \"${file}.1\" ] && mv \"${file}.1\" \"${file}.2\"\n mv \"$file\" \"${file}.1\"\n}\n\ncmd_schedule_add() {\n local type=\"${1:-}\"\n [ -n \"$type\" ] || die \"schedule-add requires heartbeat or cron\"\n shift\n case \"$type\" in\n heartbeat) cmd_schedule_add_heartbeat \"$@\" ;;\n cron) cmd_schedule_add_cron \"$@\" ;;\n *) die \"unsupported schedule type: $type\" ;;\n esac\n}\n\ncmd_schedule_add_heartbeat() {\n local name=\"${1:-}\"\n [ -n \"$name\" ] || die \"schedule-add heartbeat requires NAME\"\n shift\n local project=\".\"\n local interval=60\n local agent=\"auto\"\n local profile=\"\"\n local session=\"\"\n local sandbox=\"danger-full-access\"\n local approval=\"never\"\n while [ \"$#\" -gt 0 ]; do\n case \"$1\" in\n --project) project=\"$2\"; shift 2 ;;\n --interval-minutes) interval=\"$2\"; shift 2 ;;\n --agent) agent=\"$2\"; shift 2 ;;\n --profile) profile=\"$2\"; shift 2 ;;\n --session) session=\"$2\"; shift 2 ;;\n --sandbox) sandbox=\"$2\"; shift 2 ;;\n --approval) approval=\"$2\"; shift 2 ;;\n *) die \"unknown schedule-add heartbeat option: $1\" ;;\n esac\n done\n project=\"$(project_abs \"$project\")\"\n agent=\"$(resolve_agent \"$agent\")\"\n validate_agent \"$agent\"\n [ -n \"$session\" ] || session=\"$(session_name_for_project \"$project\")\"\n case \"$interval\" in ''|*[!0-9]*) die \"--interval-minutes must be a positive integer\" ;; esac\n [ \"$interval\" -gt 0 ] || die \"--interval-minutes must be a positive integer\"\n schedule_init\n local id heartbeat_file log_file now tmp\n id=\"$(schedule_id hb)\"\n heartbeat_file=\"$(cc_dir \"$project\")/heartbeat.md\"\n log_file=\"$(schedule_log_dir)/heartbeat-${id}.log\"\n now=\"$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")\"\n mkdir -p \"$(cc_dir \"$project\")\"\n if [ ! -f \"$heartbeat_file\" ]; then\n cat > \"$heartbeat_file\" \u003c\u003c'MD'\n# Heartbeat Checklist\n\nCheck the items below. If nothing needs attention, respond with exactly:\n\nHEARTBEAT_OK\n\nOtherwise, describe what needs attention.\nMD\n fi\n heartbeat_state_init \"$(heartbeat_state_file \"$project\")\"\n tmp=\"$(mktemp)\"\n jq --arg id \"$id\" --arg type \"heartbeat\" --arg name \"$name\" --arg project \"$project\" \\\n --arg agent \"$agent\" --arg profile \"$profile\" --arg session \"$session\" --arg heartbeat_file \"$heartbeat_file\" \\\n --arg sandbox \"$sandbox\" --arg approval \"$approval\" --arg now \"$now\" --arg env_path \"$PATH\" \\\n --arg platform_id \"com.cc-use.${id}\" --argjson interval \"$interval\" \\\n '.schedules += [{id:$id,type:$type,name:$name,project_dir:$project,agent:$agent,profile:$profile,session_name:$session,heartbeat_file:$heartbeat_file,interval_minutes:$interval,sandbox:$sandbox,approval:$approval,enabled:true,notify:true,auto_restart:true,created_at:$now,platform_id:$platform_id,env_path:$env_path}]' \\\n \"$(schedule_db)\" > \"$tmp\" && mv \"$tmp\" \"$(schedule_db)\"\n schedule_register \"$id\" \"heartbeat\" \"\" \"$interval\" \"$log_file\"\n echo \"added heartbeat schedule: $name ($id)\"\n}\n\ncmd_schedule_add_cron() {\n local name=\"${1:-}\"\n [ -n \"$name\" ] || die \"schedule-add cron requires NAME\"\n shift\n local project=\".\"\n local cron_expr=\"\"\n local prompt=\"\"\n local agent=\"auto\"\n local profile=\"\"\n local sandbox=\"danger-full-access\"\n local approval=\"never\"\n local search=false\n while [ \"$#\" -gt 0 ]; do\n case \"$1\" in\n --project) project=\"$2\"; shift 2 ;;\n --cron-expr) cron_expr=\"$2\"; shift 2 ;;\n --prompt) prompt=\"$2\"; shift 2 ;;\n --agent) agent=\"$2\"; shift 2 ;;\n --profile) profile=\"$2\"; shift 2 ;;\n --sandbox) sandbox=\"$2\"; shift 2 ;;\n --approval) approval=\"$2\"; shift 2 ;;\n --search) search=true; shift ;;\n *) die \"unknown schedule-add cron option: $1\" ;;\n esac\n done\n [ -n \"$cron_expr\" ] || die \"--cron-expr is required\"\n [ -n \"$prompt\" ] || die \"--prompt is required\"\n project=\"$(project_abs \"$project\")\"\n agent=\"$(resolve_agent \"$agent\")\"\n validate_agent \"$agent\"\n schedule_init\n local id log_file now tmp\n id=\"$(schedule_id cr)\"\n log_file=\"$(schedule_log_dir)/cron-${id}.log\"\n now=\"$(date -u +\"%Y-%m-%dT%H:%M:%SZ\")\"\n tmp=\"$(mktemp)\"\n jq --arg id \"$id\" --arg type \"cron\" --arg name \"$name\" --arg project \"$project\" \\\n --arg agent \"$agent\" --arg profile \"$profile\" --arg cron_expr \"$cron_expr\" --arg prompt \"$prompt\" \\\n --arg sandbox \"$sandbox\" --arg approval \"$approval\" --arg now \"$now\" --arg env_path \"$PATH\" \\\n --arg platform_id \"com.cc-use.${id}\" --argjson search \"$search\" \\\n '.schedules += [{id:$id,type:$type,name:$name,project_dir:$project,agent:$agent,profile:$profile,cron_expr:$cron_expr,prompt:$prompt,search:$search,sandbox:$sandbox,approval:$approval,enabled:true,notify:true,created_at:$now,platform_id:$platform_id,env_path:$env_path}]' \\\n \"$(schedule_db)\" > \"$tmp\" && mv \"$tmp\" \"$(schedule_db)\"\n schedule_register \"$id\" \"cron\" \"$cron_expr\" \"\" \"$log_file\"\n echo \"added cron schedule: $name ($id)\"\n}\n\ncmd_schedule_list() {\n schedule_init\n jq -r '.schedules[] | [.id,.type,.name,.agent,(.profile // \"-\"),(if .type == \"heartbeat\" then \"every \\(.interval_minutes)m\" else .cron_expr end),(.enabled|tostring)] | @tsv' \"$(schedule_db)\" |\n awk -F '\\t' 'BEGIN{printf \"%-12s %-10s %-28s %-8s %-12s %-18s %s\\n\",\"ID\",\"TYPE\",\"NAME\",\"AGENT\",\"PROFILE\",\"SCHEDULE\",\"ENABLED\"} {printf \"%-12s %-10s %-28s %-8s %-12s %-18s %s\\n\",$1,$2,$3,$4,$5,$6,$7}'\n}\n\ncmd_schedule_status() {\n local id=\"${1:-}\"\n schedule_init\n if [ -z \"$id\" ]; then\n cmd_schedule_list\n return 0\n fi\n schedule_get \"$id\" || die \"schedule not found: $id\"\n local log_file\n log_file=\"$(schedule_log_dir)/$(jq -r --arg id \"$id\" '.schedules[] | select(.id == $id) | if .type == \"heartbeat\" then \"heartbeat-\" + .id + \".log\" else \"cron-\" + .id + \".log\" end' \"$(schedule_db)\")\"\n if [ -f \"$log_file\" ]; then\n echo \"log: $log_file\"\n tail -10 \"$log_file\"\n fi\n}\n\ncmd_schedule_remove() {\n local id=\"${1:-}\"\n [ -n \"$id\" ] || die \"schedule-remove requires ID\"\n schedule_init\n schedule_get \"$id\" >/dev/null || die \"schedule not found: $id\"\n schedule_unregister \"$id\"\n local tmp\n tmp=\"$(mktemp)\"\n jq --arg id \"$id\" '.schedules |= map(select(.id != $id))' \"$(schedule_db)\" > \"$tmp\" && mv \"$tmp\" \"$(schedule_db)\"\n echo \"removed schedule: $id\"\n}\n\ncmd_schedule_run() {\n local id=\"${1:-}\"\n [ -n \"$id\" ] || die \"schedule-run requires ID\"\n schedule_init\n local entry type\n entry=\"$(schedule_get \"$id\")\" || die \"schedule not found: $id\"\n type=\"$(printf '%s' \"$entry\" | jq -r '.type')\"\n case \"$type\" in\n heartbeat) schedule_run_heartbeat \"$entry\" ;;\n cron) schedule_run_cron \"$entry\" ;;\n *) die \"unsupported schedule type: $type\" ;;\n esac\n}\n\nschedule_run_cron() {\n local entry=\"$1\"\n local id name project agent profile sandbox approval prompt search env_path log_file start duration command output status\n id=\"$(printf '%s' \"$entry\" | jq -r '.id')\"\n name=\"$(printf '%s' \"$entry\" | jq -r '.name')\"\n project=\"$(printf '%s' \"$entry\" | jq -r '.project_dir')\"\n agent=\"$(printf '%s' \"$entry\" | jq -r '.agent // \"codex\"')\"\n profile=\"$(printf '%s' \"$entry\" | jq -r '.profile // \"\"')\"\n sandbox=\"$(printf '%s' \"$entry\" | jq -r '.sandbox // \"danger-full-access\"')\"\n approval=\"$(printf '%s' \"$entry\" | jq -r '.approval // \"never\"')\"\n prompt=\"$(printf '%s' \"$entry\" | jq -r '.prompt')\"\n search=\"$(printf '%s' \"$entry\" | jq -r '.search // false')\"\n env_path=\"$(printf '%s' \"$entry\" | jq -r '.env_path // \"\"')\"\n source_user_shell_profile\n [ -n \"$env_path\" ] && export PATH=\"$env_path\"\n log_file=\"$(schedule_log_dir)/cron-${id}.log\"\n log_rotate \"$log_file\"\n start=\"$(now_epoch)\"\n {\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] === Cron job start: $name ===\"\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] Project: $project\"\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] Agent: $agent\"\n } >> \"$log_file\"\n cd \"$project\" || die \"cannot cd to $project\"\n set +e\n if [ -f \"$prompt\" ] && [ -x \"$prompt\" ]; then\n output=\"$(\"$prompt\" 2>&1)\"\n status=$?\n else\n command=\"$(build_agent_exec_command \"$agent\" \"$profile\" \"$sandbox\" \"$approval\" \"$project\" \"$search\")\"\n output=\"$(eval \"$command\"' \"$prompt\"' 2>&1 \u003c /dev/null)\"\n status=$?\n fi\n set -e\n duration=$(( $(now_epoch) - start ))\n {\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] Exit code: $status\"\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] Duration: ${duration}s\"\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] Output:\"\n printf '%s\\n' \"$output\"\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] === Cron job end (${duration}s, exit $status) ===\"\n } >> \"$log_file\"\n if [ \"$status\" -ne 0 ] && [ \"$(printf '%s' \"$entry\" | jq -r '.notify // false')\" = \"true\" ]; then\n notify_send \"Cron Failed\" \"Job '$name' exited with code $status (${duration}s)\"\n fi\n return \"$status\"\n}\n\nschedule_run_heartbeat() {\n local entry=\"$1\"\n local id name project agent profile sandbox approval session heartbeat_file env_path log_file state_file start duration output summary result\n id=\"$(printf '%s' \"$entry\" | jq -r '.id')\"\n name=\"$(printf '%s' \"$entry\" | jq -r '.name')\"\n project=\"$(printf '%s' \"$entry\" | jq -r '.project_dir')\"\n agent=\"$(printf '%s' \"$entry\" | jq -r '.agent // \"codex\"')\"\n profile=\"$(printf '%s' \"$entry\" | jq -r '.profile // \"\"')\"\n sandbox=\"$(printf '%s' \"$entry\" | jq -r '.sandbox // \"danger-full-access\"')\"\n approval=\"$(printf '%s' \"$entry\" | jq -r '.approval // \"never\"')\"\n session=\"$(printf '%s' \"$entry\" | jq -r '.session_name // \"\"')\"\n heartbeat_file=\"$(printf '%s' \"$entry\" | jq -r '.heartbeat_file')\"\n env_path=\"$(printf '%s' \"$entry\" | jq -r '.env_path // \"\"')\"\n source_user_shell_profile\n [ -n \"$env_path\" ] && export PATH=\"$env_path\"\n [ -n \"$session\" ] || session=\"$(session_name_for_project \"$project\")\"\n log_file=\"$(schedule_log_dir)/heartbeat-${id}.log\"\n state_file=\"$(heartbeat_state_file \"$project\")\"\n log_rotate \"$log_file\"\n heartbeat_state_init \"$state_file\"\n start=\"$(now_epoch)\"\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] === Heartbeat start: $name ===\" >> \"$log_file\"\n if [ ! -f \"$heartbeat_file\" ]; then\n duration=$(( $(now_epoch) - start ))\n heartbeat_state_update \"$state_file\" \"error\" \"$duration\" \"heartbeat file not found\"\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] ERROR: heartbeat file not found: $heartbeat_file\" >> \"$log_file\"\n return 1\n fi\n output=\"$(\"$0\" delegate \"$(cat \"$heartbeat_file\")\" --project \"$project\" --agent \"$agent\" --profile \"$profile\" --session \"$session\" --sandbox \"$sandbox\" --approval \"$approval\" --initial-quiet-seconds 30 --poll-interval 2 --max-observations 1 2>&1 || true)\"\n duration=$(( $(now_epoch) - start ))\n printf '%s\\n' \"$output\" >> \"$log_file\"\n if \"$0\" scrollback --project \"$project\" --agent \"$agent\" --session \"$session\" --lines 200 2>/dev/null | grep -q 'HEARTBEAT_OK'; then\n result=\"ok\"\n summary=\"\"\n else\n result=\"alert\"\n summary=\"$(\"$0\" scrollback --project \"$project\" --agent \"$agent\" --session \"$session\" --lines 60 2>/dev/null | grep -v '^

cc-use You are the outer supervisor. Use this skill's helper as an implementation detail to start and supervise an inner CC session in tmux. Here, CC means a coding command-line agent. Depending on the host and local configuration, that can mean Claude Code, Codex CLI, or another compatible coding CLI. When To Use This Skill Use cc-use for long-term tasks where the outer session should keep the global state clean and deliberate while an inner interactive session handles focused execution. The point is not just parallelism; it is supervision. The outer session keeps the plan, product intent, r…

| tail -10 | tr '\\n' ' ' | head -c 200)\"\n fi\n heartbeat_state_update \"$state_file\" \"$result\" \"$duration\" \"$summary\"\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] Result: $result ${summary}\" >> \"$log_file\"\n if [ \"$result\" = \"alert\" ] && [ \"$(printf '%s' \"$entry\" | jq -r '.notify // false')\" = \"true\" ]; then\n notify_send \"Heartbeat Alert\" \"$summary\"\n fi\n echo \"[$(date '+%Y-%m-%d %H:%M:%S')] === Heartbeat end (${duration}s) ===\" >> \"$log_file\"\n}\n\nmain() {\n local cmd\n cmd=\"${1:-}\"\n [ -n \"$cmd\" ] || { usage; exit 1; }\n shift || true\n\n case \"$cmd\" in\n delegate)\n [ \"$#\" -ge 1 ] || die \"delegate requires TASK\"\n task=\"$1\"; shift\n cmd_delegate \"$task\" \"$@\"\n ;;\n monitor)\n cmd_monitor \"$@\"\n ;;\n project-status)\n cmd_project_status \"$@\"\n ;;\n scrollback)\n cmd_scrollback \"$@\"\n ;;\n schedule-add)\n cmd_schedule_add \"$@\"\n ;;\n schedule-list)\n cmd_schedule_list \"$@\"\n ;;\n schedule-status)\n cmd_schedule_status \"$@\"\n ;;\n schedule-remove)\n cmd_schedule_remove \"$@\"\n ;;\n schedule-run)\n cmd_schedule_run \"$@\"\n ;;\n snapshot)\n [ \"$#\" -eq 1 ] || die \"snapshot requires SESSION\"\n tmux_capture \"$1\"\n ;;\n kill)\n [ \"$#\" -eq 1 ] || die \"kill requires SESSION\"\n tmux kill-session -t \"$1\" >/dev/null 2>&1 || true\n ;;\n list)\n tmux list-sessions -F \"#{session_name}\" 2>/dev/null || true\n ;;\n *)\n usage\n exit 1\n ;;\n esac\n}\n\nif [ \"${BASH_SOURCE[0]}\" = \"$0\" ]; then\n main \"$@\"\nfi\n","content_type":"text/plain; charset=utf-8","language":null,"size":35709,"content_sha256":"143d692318d2592a13a622801a076779c87613570aac157405b061eefae89882"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"cc-use","type":"text"}]},{"type":"paragraph","content":[{"text":"You are the outer supervisor. Use this skill's ","type":"text"},{"text":"scripts/cc-use","type":"text","marks":[{"type":"code_inline"}]},{"text":" helper as an implementation detail to start and supervise an inner CC session in tmux.","type":"text"}]},{"type":"paragraph","content":[{"text":"Here, ","type":"text"},{"text":"CC","type":"text","marks":[{"type":"strong"}]},{"text":" means a coding command-line agent. Depending on the host and local configuration, that can mean Claude Code, Codex CLI, or another compatible coding CLI.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"When To Use This Skill","type":"text"}]},{"type":"paragraph","content":[{"text":"Use cc-use for long-term tasks where the outer session should keep the global state clean and deliberate while an inner interactive session handles focused execution. The point is not just parallelism; it is supervision. The outer session keeps the plan, product intent, risks, compatibility concerns, and acceptance criteria in view while the inner session does bounded work.","type":"text"}]},{"type":"paragraph","content":[{"text":"This helps when a task is long enough that a single conversation may lose local details, pollute context with logs, or drift away from the top-level objective. The inner session can do implementation, command execution, exploration, and interactive TUI work, while the outer session preserves a compact supervisory context and performs final judgment.","type":"text"}]},{"type":"paragraph","content":[{"text":"Do not pass the whole long-term task to the inner session as one giant prompt. Break it into small, concrete requests, then inspect, steer, and refine like a human supervisor would:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Ask for one focused investigation, implementation step, test case, or verification action.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Wait for an ","type":"text"},{"text":"inspect","type":"text","marks":[{"type":"code_inline"}]},{"text":" observation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Read the snapshot semantically.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Decide the next short request, wait, intervene, ask the user, or verify.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Repeat until the outer session has enough evidence to accept or reject the work.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Good scenarios:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"End-to-end verification:","type":"text","marks":[{"type":"strong"}]},{"text":" The outer session acts like a tester. It asks the inner session to run realistic workflows, edge cases, and command sequences, then evaluates the reported result and runs any final checks itself.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Task decomposition and implementation:","type":"text","marks":[{"type":"strong"}]},{"text":" For a large project with a plan or design document, the outer session decomposes the plan into small implementation requests and feeds them to the inner session one at a time.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Adversarial testing:","type":"text","marks":[{"type":"strong"}]},{"text":" The outer session designs high-level adversarial cases based on project history, product positioning, architecture, compatibility requirements, and likely regressions. The inner session executes those cases and reports what happens.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Interactive product testing:","type":"text","marks":[{"type":"strong"}]},{"text":" For TUI products such as Claude Code, Codex CLI, or plugin/skill/MCP workflows, normal one-shot command tests may be insufficient. The inner session can install the in-development skill, MCP server, or plugin inside an interactive terminal environment, then receive follow-up input from the outer session to validate that the integration works in the real TUI.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"User Experience","type":"text"}]},{"type":"paragraph","content":[{"text":"The expected user flow is natural language in the outer TUI:","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Use cc-use to implement this long task: ...","type":"text"}]}]},{"type":"paragraph","content":[{"text":"You should then:","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Start or reuse an inner CC session for the same agent family as the outer session.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Break the user's request into short, focused inner requests.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Send each inner request exactly as written, without wrapper text.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Monitor by screen stability, not by parsing agent-specific UI rules.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"When the screen stays quiet long enough, inspect the saved screen snapshot semantically and decide whether to wait, steer, or verify.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Run final acceptance checks yourself from the outer session.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Commands","type":"text"}]},{"type":"paragraph","content":[{"text":"Run commands from the target project root unless you pass an explicit ","type":"text"},{"text":"--project DIR","type":"text","marks":[{"type":"code_inline"}]},{"text":". Use ","type":"text"},{"text":"--agent codex","type":"text","marks":[{"type":"code_inline"}]},{"text":" from Codex and ","type":"text"},{"text":"--agent claude","type":"text","marks":[{"type":"code_inline"}]},{"text":" from Claude Code. Do not cross-delegate between agent families.","type":"text"}]},{"type":"paragraph","content":[{"text":"--project","type":"text","marks":[{"type":"code_inline"}]},{"text":" controls the tmux working directory, the derived session name, and the ","type":"text"},{"text":".cc-use/state/","type":"text","marks":[{"type":"code_inline"}]},{"text":" location. If omitted, it defaults to the current directory. Passing ","type":"text"},{"text":"--project \"$PWD\"","type":"text","marks":[{"type":"code_inline"}]},{"text":" is recommended when the outer session may change directories.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"delegate","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Start or reuse the inner session, send one short request exactly as provided, and wait until one observation is emitted:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"\u003cskill_dir>/scripts/cc-use delegate \"TASK_TEXT\" --project \"$PWD\" --agent codex","type":"text"}]},{"type":"paragraph","content":[{"text":"Important options:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--project DIR","type":"text","marks":[{"type":"code_inline"}]},{"text":": target project root. Also determines state location.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--agent codex|claude","type":"text","marks":[{"type":"code_inline"}]},{"text":": inner agent family. Match the outer agent family.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--session NAME","type":"text","marks":[{"type":"code_inline"}]},{"text":": override the derived tmux session name.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--profile NAME","type":"text","marks":[{"type":"code_inline"}]},{"text":": Codex only; use only if the user explicitly requests an inner Codex profile and only when creating the session.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--initial-quiet-seconds N","type":"text","marks":[{"type":"code_inline"}]},{"text":": how long a stable screen must stay quiet before an observation is emitted. Default is ","type":"text"},{"text":"30","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--poll-interval N","type":"text","marks":[{"type":"code_inline"}]},{"text":": seconds between screen captures while waiting. Default is ","type":"text"},{"text":"2","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--replace","type":"text","marks":[{"type":"code_inline"}]},{"text":": kill and recreate an existing session. Use only for recovery or an explicit fresh-start decision.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"TASK_TEXT","type":"text","marks":[{"type":"code_inline"}]},{"text":" is passed through unchanged. Keep task decomposition in the outer session. Do not ask the helper to add role instructions, policy text, or task wrappers.","type":"text"}]},{"type":"paragraph","content":[{"text":"For Codex, omit ","type":"text"},{"text":"--profile","type":"text","marks":[{"type":"code_inline"}]},{"text":" by default. Existing tmux/TUI sessions are reused and do not need the profile on later requests.","type":"text"}]},{"type":"paragraph","content":[{"text":"Expected behavior:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the session does not exist, the helper creates a persistent tmux session named like ","type":"text"},{"text":"ccu-\u003cproject-name>","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the session already exists, the helper reuses it.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The command normally returns one JSON event after the screen becomes stable.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the screen keeps changing, the command may block until the screen becomes quiet.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"monitor","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Observe an existing derived session and wait for one observation:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"\u003cskill_dir>/scripts/cc-use monitor --project \"$PWD\" --agent codex","type":"text"}]},{"type":"paragraph","content":[{"text":"Use this after a previous observation suggests waiting, after you have waited based on your own semantic judgment, or after the user asks for status.","type":"text"}]},{"type":"paragraph","content":[{"text":"Important options:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--project DIR","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"--agent codex|claude","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"--session NAME","type":"text","marks":[{"type":"code_inline"}]},{"text":": identify the target session.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--initial-quiet-seconds N","type":"text","marks":[{"type":"code_inline"}]},{"text":", ","type":"text"},{"text":"--poll-interval N","type":"text","marks":[{"type":"code_inline"}]},{"text":": same meaning as ","type":"text"},{"text":"delegate","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Expected behavior:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the screen changes, the helper resets the quiet timer and continues waiting.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the screen stays unchanged long enough, the helper saves a snapshot and emits an ","type":"text"},{"text":"inspect","type":"text","marks":[{"type":"code_inline"}]},{"text":" observation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the tmux session is gone, the helper emits ","type":"text"},{"text":"session_unavailable","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"project-status","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"Check the derived project/session status without sending input:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"\u003cskill_dir>/scripts/cc-use project-status --project \"$PWD\" --agent codex","type":"text"}]},{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"--json","type":"text","marks":[{"type":"code_inline"}]},{"text":" when you need machine-readable output:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"\u003cskill_dir>/scripts/cc-use project-status --project \"$PWD\" --agent codex --json","type":"text"}]},{"type":"paragraph","content":[{"text":"Expected text output includes:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"project","type":"text","marks":[{"type":"code_inline"}]},{"text":": resolved project directory.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"session","type":"text","marks":[{"type":"code_inline"}]},{"text":": derived or explicit session name.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"agent","type":"text","marks":[{"type":"code_inline"}]},{"text":": selected agent family.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"session_available","type":"text","marks":[{"type":"code_inline"}]},{"text":": whether tmux currently has the session.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"observations","type":"text","marks":[{"type":"code_inline"}]},{"text":": number of saved observations for this session.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"silence_seconds","type":"text","marks":[{"type":"code_inline"}]},{"text":": seconds since the last detected screen change.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"seconds_until_next_check","type":"text","marks":[{"type":"code_inline"}]},{"text":": current watch schedule hint from state.","type":"text"}]}]}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"scrollback","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"If the saved screen snapshot does not include enough context, inspect recent tmux scrollback on demand. This is a temporary read to stdout, not a persistent transcript:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"\u003cskill_dir>/scripts/cc-use scrollback --project \"$PWD\" --agent codex --lines 2000","type":"text"}]},{"type":"paragraph","content":[{"text":"For paged inspection, use tmux line ranges. Negative numbers refer to scrollback history, ","type":"text"},{"text":"0","type":"text","marks":[{"type":"code_inline"}]},{"text":" is the first visible line, and ","type":"text"},{"text":"-","type":"text","marks":[{"type":"code_inline"}]},{"text":" means the end of the visible pane:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"\u003cskill_dir>/scripts/cc-use scrollback --project \"$PWD\" --agent codex --start -4000 --end -2001\n\u003cskill_dir>/scripts/cc-use scrollback --project \"$PWD\" --agent codex --start -2000 --end -","type":"text"}]},{"type":"paragraph","content":[{"text":"Options:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--lines N","type":"text","marks":[{"type":"code_inline"}]},{"text":": capture from ","type":"text"},{"text":"-N","type":"text","marks":[{"type":"code_inline"}]},{"text":" through the end of the visible pane. Default is ","type":"text"},{"text":"2000","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--start LINE","type":"text","marks":[{"type":"code_inline"}]},{"text":": explicit tmux capture start line.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"--end LINE","type":"text","marks":[{"type":"code_inline"}]},{"text":": explicit tmux capture end line. Default is ","type":"text"},{"text":"-","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Line semantics come from tmux:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Negative numbers are lines in scrollback history.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"0","type":"text","marks":[{"type":"code_inline"}]},{"text":" is the first visible line.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"-","type":"text","marks":[{"type":"code_inline"}]},{"text":" means the end of the visible pane.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"scrollback","type":"text","marks":[{"type":"code_inline"}]},{"text":" only after an ","type":"text"},{"text":"inspect","type":"text","marks":[{"type":"code_inline"}]},{"text":" observation when the saved snapshot is too narrow. Do not use it as a continuous progress feed while the screen is actively changing.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Low-level commands","type":"text"}]},{"type":"paragraph","content":[{"text":"These exist for diagnostics and recovery:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"\u003cskill_dir>/scripts/cc-use list\n\u003cskill_dir>/scripts/cc-use snapshot \u003csession>\n\u003cskill_dir>/scripts/cc-use kill \u003csession>","type":"text"}]},{"type":"paragraph","content":[{"text":"Use ","type":"text"},{"text":"kill","type":"text","marks":[{"type":"code_inline"}]},{"text":" only when the user explicitly asks to close the inner session, or when the session is broken and a fresh session is required.","type":"text"}]},{"type":"paragraph","content":[{"text":"Keep the inner session running by default. A long-running project may span multiple outer conversations or calendar days, and the existing tmux/TUI session preserves useful continuity for later work.","type":"text"}]},{"type":"paragraph","content":[{"text":"Only stop the inner session if the user explicitly asks you to close it, or if the session is broken and you have decided a fresh session is required.","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Scheduled tasks","type":"text"}]},{"type":"paragraph","content":[{"text":"cc-use can also register host-local recurring tasks. Use this only when the user explicitly asks for a persistent local cron or heartbeat workflow.","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"heartbeat","type":"text","marks":[{"type":"code_inline"}]},{"text":" periodically checks a persistent inner tmux session.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"cron","type":"text","marks":[{"type":"code_inline"}]},{"text":" runs a scheduled prompt or executable script.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Schedules are agent-neutral; the default ","type":"text"},{"text":"--agent auto","type":"text","marks":[{"type":"code_inline"}]},{"text":" follows the outer session's agent family when the schedule is created.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Scheduled runs default to ","type":"text"},{"text":"danger-full-access","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"never","type":"text","marks":[{"type":"code_inline"}]},{"text":" approval so local recurring tasks do not stall on routine filesystem or network access.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"For the full workflow, command examples, migration notes, and troubleshooting, read ","type":"text"},{"text":"references/schedules.md","type":"text","marks":[{"type":"code_inline"}]},{"text":".","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Monitoring Model","type":"text"}]},{"type":"paragraph","content":[{"text":"delegate","type":"text","marks":[{"type":"code_inline"}]},{"text":" and ","type":"text"},{"text":"monitor","type":"text","marks":[{"type":"code_inline"}]},{"text":" use adaptive observation:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the tmux screen changes, the outer agent does not read details and lets the inner agent keep working.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the screen stays unchanged past the current quiet threshold, cc-use captures the screen once and emits a neutral ","type":"text"},{"text":"inspect","type":"text","marks":[{"type":"code_inline"}]},{"text":" observation.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The helper does not classify stable screens as wait, intervene, or verify. Always read ","type":"text"},{"text":"screen_path","type":"text","marks":[{"type":"code_inline"}]},{"text":" and make the semantic decision in the outer session.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the snapshot is too narrow, use ","type":"text"},{"text":"scrollback --lines N","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"scrollback --start LINE --end LINE","type":"text","marks":[{"type":"code_inline"}]},{"text":" for temporary context. Do not create persistent transcript logs by default.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"Typical observation:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"json"},"content":[{"text":"{\n \"event\": \"observation\",\n \"session\": \"ccu-my-project\",\n \"observed_at\": 1778223935,\n \"silence_seconds\": 20,\n \"screen_digest\": \"sha256...\",\n \"screen_path\": \"/path/to/project/.cc-use/state/ccu-my-project/screens/ccu-my-project-0001.txt\",\n \"decision\": {\n \"action\": \"inspect\",\n \"next_check_after_seconds\": 0,\n \"reason\": \"The screen is stable; inspect screen_path semantically before deciding whether to wait, steer, or verify.\",\n \"confidence\": 1.0\n }\n}","type":"text"}]},{"type":"paragraph","content":[{"text":"inspect","type":"text","marks":[{"type":"code_inline"}]},{"text":" means only that the screen is stable enough to review. It does not mean the task is complete, blocked, failed, or still running. The outer session must read ","type":"text"},{"text":"screen_path","type":"text","marks":[{"type":"code_inline"}]},{"text":" and decide.","type":"text"}]},{"type":"paragraph","content":[{"text":"session_unavailable","type":"text","marks":[{"type":"code_inline"}]},{"text":" means tmux no longer has the expected session. Decide whether to restart, report failure, or ask the user.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Outer Decision Rules","type":"text"}]},{"type":"paragraph","content":[{"text":"After an ","type":"text"},{"text":"inspect","type":"text","marks":[{"type":"code_inline"}]},{"text":" observation:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If the snapshot shows final output or a prompt after a completed response, run outer acceptance checks.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If it shows tests, builds, downloads, or server commands that may still be running quietly, wait a reasonable interval and call ","type":"text"},{"text":"monitor","type":"text","marks":[{"type":"code_inline"}]},{"text":" again.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If it shows a permission prompt, password prompt, yes/no question, or blocked input, intervene or ask the user.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If it shows an error, send one short corrective request or report the blocker.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"If it is too narrow to understand, call ","type":"text"},{"text":"scrollback","type":"text","marks":[{"type":"code_inline"}]},{"text":" once with enough lines or an explicit range, then decide.","type":"text"}]}]}]},{"type":"paragraph","content":[{"text":"If the screen is actively changing, ","type":"text"},{"text":"delegate","type":"text","marks":[{"type":"code_inline"}]},{"text":" or ","type":"text"},{"text":"monitor","type":"text","marks":[{"type":"code_inline"}]},{"text":" may not return for a while because the quiet timer keeps resetting. This is expected. The helper is designed to avoid consuming active output.","type":"text"}]},{"type":"paragraph","content":[{"text":"Outer acceptance checks must be run outside the inner session. Check the actual files, run relevant tests or commands, inspect UI if applicable, and confirm the work matches the user's request.","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Discipline","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not expose tmux/session/state details unless the user asks.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not pass or synthesize environment variables for the inner session.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not kill the inner session at routine task completion; leave it available for future delegated work.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not rely on the inner screen as proof of success; verify externally.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Do not use ","type":"text"},{"text":"scrollback","type":"text","marks":[{"type":"code_inline"}]},{"text":" as a persistent transcript. It is a temporary tmux history read.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Let the inner agent do implementation work.","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"The outer agent owns acceptance testing and final judgment.","type":"text"}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"cc-use","author":"@skillopedia","source":{"stars":0,"repo_name":"cc-use","origin_url":"https://github.com/zc277584121/cc-use/blob/HEAD/skills/cc-use/SKILL.md","repo_owner":"zc277584121","body_sha256":"fc3ec5b6a48545c5759f53d2ab43ea1a9e5aab70e911afde917b49b796b448a9","cluster_key":"8b47f0b53114427440c9c528888886b86c60a5e70363a732ed184e5407158f4a","clean_bundle":{"format":"clean-skill-bundle-v1","source":"zc277584121/cc-use/skills/cc-use/SKILL.md","attachments":[{"id":"0ade65dd-1c2a-5ec0-be6e-0de11ef4f192","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0ade65dd-1c2a-5ec0-be6e-0de11ef4f192/attachment.md","path":"references/schedules.md","size":6242,"sha256":"82bcd777c71668ec9b7f6b6166742d15e9a0d0c44e1b41b26f99d73bfa8cb782","contentType":"text/markdown; charset=utf-8"},{"id":"0932a3e2-c636-5abc-a685-2571e3d192f1","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/0932a3e2-c636-5abc-a685-2571e3d192f1/attachment","path":"scripts/cc-use","size":35709,"sha256":"143d692318d2592a13a622801a076779c87613570aac157405b061eefae89882","contentType":"text/plain; charset=utf-8"}],"bundle_sha256":"9694be00337e38bfaa9310165d5d6d2ee0f7ee5a7bd30cb2a7fa383f2b832be0","attachment_count":2,"text_attachments":1,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":1,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/cc-use/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"devops-infrastructure","category_label":"DevOps"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"devops-infrastructure","import_tag":"clean-skills-v1","description":"Delegate long-running coding work to an inner CC session running in tmux, while the outer agent stays focused on supervision, monitoring, and end-to-end verification. Use when the user asks to run a long task, offload implementation, keep working while an inner coding agent executes, or use cc-use.\n","allowed-tools":["Bash","Read","Glob","Grep"]}},"renderedAt":1782979951695}

cc-use You are the outer supervisor. Use this skill's helper as an implementation detail to start and supervise an inner CC session in tmux. Here, CC means a coding command-line agent. Depending on the host and local configuration, that can mean Claude Code, Codex CLI, or another compatible coding CLI. When To Use This Skill Use cc-use for long-term tasks where the outer session should keep the global state clean and deliberate while an inner interactive session handles focused execution. The point is not just parallelism; it is supervision. The outer session keeps the plan, product intent, r…