A tmux session manager for running and restoring Codex, Claude, Gemini, and custom coding-agent CLIs, with logging and monitoring built in.
This project was formerly named Codex CLI Farm. Existing codex-* commands,
CODEX_* environment variables, and codexfarm state paths remain supported for
backward compatibility.
- Automated session management: Long-lived tmux session that persists across reboots
- Durable pane history: Optional tmux-deep-history integration adds rotated raw/normalized transcripts, a seamless Page Up handoff beyond tmux's in-memory buffer, and compatible timestamped farm logs
- Unified monitoring: Watch all agent instances from a single consolidated view
- Fast navigation: Optional "board" session for quick switching between instances
- Exact snapshot/restore: Save each provider conversation by ID and restore every manifest row independently
- Status updates: Tracks RUN/READY/ERR in tmux metadata and notifies when a window becomes READY
- Memory warnings: Flag tmux windows whose pane process trees exceed a chosen RSS threshold
- Autosave/autorestore (optional): Systemd user services to persist sessions across logins
- Prompt loopers: Run one prompt or a prompt sequence repeatedly with retries, completion gates, git safety checks, logs, presets, and tmux visibility. See Agent Looper Reference for every parameter and default.
- Tool wrappers:
claude-*andgemini-*commands use the same tmux workflow
- Bash 3.2+ and Python 3.10+.
tmuxfor farm sessions, boards, status inspection, save/restore, and farm-launched loopers.- The selected provider executable on
PATH(codex,claude,gemini, or a custom command). - Optional
multitailfor the richercodex-watchview. Without it, watch falls back totail. - Optional
lsofimproves exact-session discovery for Claude, Gemini, and Codex panes whose lifecycle hook has not run. - Git only for looper backup branches and git-progress circuit breakers.
- Systemd user services only for autosave/autorestore.
- Optional network access during
setup.sh --with-deep-historyto download the checksum-pinned plugin release.
setup.sh reports missing operating-system dependencies; it does not install packages. Source it when you want the current shell's PATH refreshed. The script keeps strict shell options inside helper scopes, so sourcing it should not leak options or functions into your shell.
Run the setup script to create helper scripts, install the Codex session-identity hook and pinned deep-history integration, and auto-reload your shell:
source ./setup.sh --with-deep-historyThis will:
- Report missing
tmuxandmultitailcommands without running package-manager installs - Create helper scripts in
$HOME/bin/ - Merge the session-identity hook into
${CODEX_HOME:-~/.codex}/hooks.json - Set up logging directories
- Add
$HOME/binto your PATH automatically (bash/zsh/fish) and the current session - Verify and install the pinned
tmux-deep-historyrelease under$XDG_DATA_HOME/codexfarm/plugins/(or~/.local/share/codexfarm/plugins/)
If tmux is unavailable, core tmux commands will not work until you install it. If multitail is unavailable, codex-watch falls back to a simpler tail view.
Omit --with-deep-history when you want the legacy flat-log backend only. Re-running the setup
command is safe; the installed version can change only when this repository's reviewed lock changes.
Codex requires review for non-managed command hooks. Open /hooks in Codex CLI
after setup and trust the Agent CLI Farm hook. It receives the active Codex
session_id on SessionStart and UserPromptSubmit, then records it as an
invisible tmux pane option. Use ./setup.sh --without-session-hook (or
CODEXFARM_INSTALL_SESSION_HOOK=0) when you do not want setup to change the
user hook file.
To explicitly inspect the ID recorded for the current pane, run this inside that pane (the command intentionally prints the otherwise hidden conversation ID):
tmux show-options -p -v -t "$TMUX_PANE" @codexfarm_session_id
tmux show-options -p -v -t "$TMUX_PANE" @codexfarm_session_sourceDeep history is intentionally opt-in because terminal transcripts can contain commands, private
paths, credentials, and other sensitive output. Once installed, the default auto backend starts
recording current tmux panes and enables the plugin's global tmux hooks for panes created afterward.
Set CODEXFARM_HISTORY_BACKEND=legacy when launching a pane to turn those hooks off and use only
the flat compatibility log. If the plugin is absent, codex-add reports the legacy fallback
instead of silently making deep history look active.
From any project directory:
codex-addOr specify a path:
codex-add /path/to/projectUse a named farm without exporting CODEX_SESSION:
codex-add work /path/to/project
codex-add work # current directory in the "work" farmClaude and Gemini use the same tmux workflow with wrappers:
claude-add /path/to/project
gemini-add /path/to/projectLaunch notes:
- A single non-path positional value is treated as a farm name. Use
--session NAMEwhen that would be ambiguous. - Provider flags after
--are passed as argv data, which is the preferred path for one-off native options:codex-add -d /repo -- --model gpt-5.4. CODEX_ARGS,CLAUDE_ARGS, andGEMINI_ARGSremain trusted shell fragments for compatibility. Set them only from config you control.
Create starter files in the project where an agent should work, then follow the printed next steps:
codex-looperFor guided setup:
codex-looper init --interactive --forceAfter editing PROMPT.md, start a looper in the default farm:
codex-looper
claude-looper
claude-looper -- --dangerously-skip-permissionscodex-looper and claude-looper default to a hybrid interface: the real agent TTY stays visible in a tmux pane while the looper tracks session JSONL files for turn completion. Use --interface json when you specifically need the older noninteractive JSON stream mode.
For bounded smoke runs, legacy prompt sequences, completion-gated loops, or named farms:
codex-looper --once --label repo-smoke
codex-looper --mode sequence --prompt-file prompts.md --once
claude-looper --complete-on 'EXIT_SIGNAL:\s*true' --plan-file fix_plan.md --backup
codex-looper --cb-no-progress 3 --cb-output-decline 2 --backup
codex-looper --cb-output-match 'STATUS:\s*BLOCKED' --cb-output-match-repeats 3
codex-looper --preset rai
claude-looper --farm-session work --label cleanup-pass --cwd /path/to/project
codex-looper --local --once --label local-smokeLooper labels are used for logs and agent session names only. Farm tmux window names stay tied to CODEX_NAME or the working directory basename.
Farm-launched loopers use a two-pane tmux layout by default. Claude hybrid runs use the main pane as the merged supervisor/status/control surface and the second pane for the live Claude Code TTY. Non-hybrid split runs use the second pane as a looper control pane with the live agent transcript. Use --tmux-layout single or CODEX_LOOPER_LAYOUT=single to keep one pane.
Inspect a running looper or agent without attaching:
codex-status activity
codex-status loopersQueue a safe stop without attaching:
codex-looper control stop LOOPER-rai --after-loop --reason "merge checkpoint"Record the agent's current high-level focus without attaching:
codex-looper control focus LOOPER-rai --summary "Verifying that live screenshots are still reaching the validation loop."Send or record an operator note without attaching:
codex-looper control note LOOPER-rai --delivery btw --note "controller drift was fixed after the latest calibration"
codex-looper control note LOOPER-rai --delivery record --note-file ./handoff-note.mdIn the split looper control pane, enter b NOTE to send NOTE through Claude's
/btw side channel to the active hybrid pane. Notes are also recorded in the
run directory as operator_notes.jsonl. When run state does not include a
hybrid pane id, pass an explicit --pane; broad tmux pane scanning requires
--allow-pane-scan after verifying the intended recipient.
Agents can refresh the visible supervisor focus line from inside a run with
codex-looper control focus --run-dir "$CODEX_LOOPER_RUN_DIR" --summary "...".
Keep it to one human-readable sentence about the larger stroke of work; the
append-only history is stored in focus.jsonl.
See Agent Looper Reference for prompt format, CLI parameters, config defaults, stop conditions, farm integration, and current backend limits.
Looper defaults and limits:
- The
runsubcommand is optional. In an initialized directory,codex-loopermeanscodex-looper run. - Prompt mode defaults to
singlewithPROMPT.md. A custom--prompt-filealso defaults tosingle; the legacy default fileprompts.mdimpliessequence. - Running loopers reload the prompt file before each loop by default, so prompt edits apply on the next pass. Set
reload_prompt_each_loop = falseonly when a run must keep the startup prompt text. - Config loading is strict: documented scalars must have the expected TOML type, numeric values must be finite, and invalid regexes fail before the loop starts.
- Backup branches point to committed
HEADonly; they are not dirty-worktree snapshots. Pruning stays inside the exact configured prefix namespace. - The no-progress circuit breaker fingerprints committed
HEAD, status entries, tracked metadata, and file contents while ignoring the looper run directory. - The output-match circuit breaker stops repeated project-defined status reports, for example a loop that keeps saying it is blocked.
- Run directories include a high-resolution timestamp and random suffix; the current-log pointer is updated atomically. In split mode, if tmux cannot create the control pane, live transcript streaming falls back to the supervisor pane.
- Every looper run writes durable machine-readable state to
state.json, append-only lifecycle history toevents.jsonl, visible focus history tofocus.jsonl, and accepts optional operator commands incontrol.jsonlin its run directory.codex-status loopersreads state files, flags active states whose supervisor process is gone or defunct as stale, andcodex-status loopers --repair-stale-loopersrecords those states as externally stopped so stop reasons survive pane exits and can be scraped without tmux. codex-looper control stop --nowinterrupts all known runtime targets, including hybrid tmux pane descendants and process groups. Usecodex-looper control stop LABEL --forcefor a stuck looper that needs SIGTERM/SIGKILL escalation and stale-state repair.
Monitor all Codex logs in real-time:
codex-watchNotes:
- On small terminals (phones),
codex-watchauto-switches to a simpler mode. - Force simple mode:
codex-watch --simpleorCODEX_WATCH_MODE=tail codex-watch. - Force full mode:
codex-watch --mode multitail. - With the installed deep-history backend, one
pipe-paneowner writes durable segmented history and mirrors the live raw stream into the same flat logs used bycodex-watch. - Flat compatibility logs contain output emitted after the pane pipe is enabled. Deep history separately captures scrollback already visible when recording starts.
- Deep history is not a literal extension of tmux's internal grid. Use
Prefix + [for recent copy-mode history; when Page Up reaches the absolute top, the farm's default seamless handoff opens the older disk transcript in a popup.Prefix + Hopens the full Deep History menu, andAlt-uopens older history directly from copy mode. Mouse-wheel scrolling remains inside tmux's native buffer and does not cross the disk-history boundary. - Plugin installation raises tmux's global history limit from its usual 2,000 rows to 50,000 for panes created afterward. Existing panes keep their original in-memory limit, but
codex-addbackfills deep-history recording for existing tmux panes unless another output pipe already owns one. Recreate panes (or save and reboot the farm) only when you also want the larger in-memory limit. codex-watchdiscovers log files once at startup. Restart it to include newly-created logs.- Multi-file tail output keeps source labels so interleaved lines can still be traced to a window log.
- First run shows an optional tmux tips prompt; choose Yes to see basics. Answer "Don't show again" to persist your preference. Re-enable temporarily with
CODEX_TIPS_PROMPT=1or permanently by removing~/.local/state/codexfarm/no_tips.
Snapshot your current Codex windows:
codex-save # writes to ~/.config/codexfarm/manifest.tsv
CODEX_SESSION=work codex-save
# writes to ~/.config/codexfarm/manifests/work.tsv
codex-save --all-registered
# writes one manifest per farm registered for autoservice
# Explicitly permit legacy latest-session fallbacks:
codex-save --allow-fallbackRestore them later (e.g., after reboot or on SSH login):
codex-restore -a # recreates and attaches to the sessionReboot a running farm through the complete save, stop, and restore sequence:
codex-farm-reboot # reboot the default farm and attach
codex-farm-reboot --detach # restore without attaching
codex-farm-reboot work # reboot the named "work" farm
codex-farm-reboot --allow-fallback --detach
claude-farm-reboot --detach # use Claude defaults for fallback restore commands
gemini-farm-reboot --detach # use Gemini defaults for fallback restore commandsThe reboot command saves before stopping anything, stops a linked board before the main farm, restores the farm, and recreates the board only when it existed beforehand. Run it from a separate terminal or a different tmux session; it refuses to kill the session or board that is currently hosting the command. Checkpoint active agent work first because exact provider-session discovery is best-effort.
Use -f to force re-creation of existing-named windows.
Managed panes keep a stable logical name in tmux metadata even while a CLI
changes its visible native title. Duplicate logical names are valid: restore
matches the first manifest occurrence to the first existing window, the second
to the second, and so on. Force restore removes all matching occurrences before
recreating every row.
Saved Codex, Claude, and Gemini windows require exact session IDs by default.
Codex first uses fresh hook metadata owned by the pane's current provider
process; all providers can fall back to live session-file discovery. If any
recognized provider ID is unresolved, codex-save exits nonzero and leaves the
previous manifest intact. --allow-fallback explicitly permits
codex resume --last, claude --continue, or gemini --resume latest.
Only pane 0 is saved. Split layouts and scrollback are not reconstructed. Missing saved directories fall back to $HOME with a warning.
Manifests are written owner-only and via atomic replacement, but they are still trusted executable input because restore launches the recorded commands.
Check installed-helper freshness and manifest resume coverage without printing session IDs:
codex-doctor
CODEX_SESSION=work codex-doctor
codex-doctor --source /path/to/agent-cli-farm /path/to/manifest.tsvThe doctor exits nonzero for stale or missing installed helpers, malformed or unsafe manifests, blank commands, non-UUID or fallback provider resumes, and duplicate logical names. Duplicate names are supported by restore, but the warning makes them explicit before destructive force restores.
If tmux sessions are already running (no manifest needed):
codex-resume # joins the main Codex session if present
codex-resume work # joins the named "work" farm
codex-resume work --boardFlags:
--boardto prefer the board session first.--session NAMEto force a specific farm when a positional argument would be ambiguous.
codex-add can install systemd user services to autosave hourly and restore on login.
You can trigger it directly:
codex-add --install-autoserviceThe installed systemd unit names are always the same: codex-autosave.service, codex-autosave.timer, and codex-autorestore.service. Installing autoservice for a named farm adds that farm to ~/.config/codexfarm/farms.tsv; it does not create a second background service:
codex-add --session work --install-autoservice
codex-add --session personal --install-autoserviceAutosave/autorestore iterates the registry, so each registered farm is saved to its own manifest and restored into its own tmux session.
Set CODEX_AUTOSERVICE_CHOICE=yes to auto-accept the prompt, or no to suppress it.
codex-add auto-starts codex-annotator, which tracks RUN, READY, or ERR state in tmux window options. For Codex/Claude panes it inspects recent output for prompts/approval selections; other panes fall back to the command-based heuristic.
By default, the annotator does not rewrite tmux window titles. That lets Codex's native title animation remain visible while still making codex-status windows show state. When a window transitions from RUN to READY, the annotator emits a tmux display-message notification.
Important: the RUN/READY/ERR status is best-effort and based on terminal-output and command heuristics. Node-backed tools are recognized from pane start commands as well as current commands. Use READY as a signal, not a guarantee. Codex's native title animation is usually the primary visual signal.
Run codex-memoryflag to prefix high-memory tmux windows with a marker such as *200+MB**. It scans tmux sockets available to the current user, sums each window's pane process trees by RSS, and renames windows at or above the threshold. Existing memory markers are updated or cleared on each run, so window renaming is an intentional side effect.
codex-memoryflag # flag windows at 200 MiB and up
codex-memoryflag 500 # flag windows at 500 MiB and up
codex-memoryflag 1G # flag windows at 1024 MiB and up
codex-memoryflag -n # dry runThe status annotator preserves memory markers if legacy title updates are enabled, so a title can read *200+MB** *RUN* project-name.
Tuning and controls:
- Disable autostart:
CODEX_ANNOTATOR_AUTOSTART=0 - Disable annotator (if started):
CODEX_ANNOTATOR_ENABLED=0 - Re-enable legacy title prefixes:
CODEX_ANNOTATOR_UPDATE_TITLES=1 - Disable READY notifications:
CODEX_ANNOTATOR_NOTIFY_READY=0 - Customize READY notification text:
CODEX_ANNOTATOR_READY_MESSAGE(default:READY: {name}) - Adjust RUN detection:
CODEX_ANNOTATOR_RUNNING_REGEX(default:(codex|node|ssh)) - Scope sessions:
CODEX_ANNOTATOR_SESSION_REGEX(default:^codex) - Ignore windows/sessions prefixed with
!(configurable viaCODEX_ANNOTATOR_IGNORE_PREFIX) - Adjust capture depth:
CODEX_ANNOTATOR_CAPTURE_LINES(default:200)
codex-add [session] [directory]- Add a new Codex instance, optionally selecting a named farmcodex-annotator- Track RUN/READY/ERR state and notify when windows become READYcodex-memoryflag [threshold]- Flag high-memory tmux windows; default threshold is 200 MiBcodex-watch- Monitor all Codex logs in consolidated viewcodex-looper [init|doctor|run]- Run a single prompt or prompt sequence repeatedly with logs and stop detection; see looper referencecodex-status [--session SESSION] [sessions|windows|activity|logs|loopers]- Show status information;loopers --repair-stale-loopersmarks active state files stopped when their supervisor process is gonecodex-board [create|link|switch] [session]- Manage the default or a named board session for navigationcodex-resume [session] [--board]- Attach/switch to an existing Codex/tmux session or named farm boardcodex-doctor [--session NAME] [--source DIR] [manifest]- Check installed-helper freshness and manifest resume coverage without displaying session IDscodex-save [--allow-fallback] [manifest]- Snapshot current windows to a manifest (TSV), requiring exact provider IDs by defaultcodex-restore [-a] [-f] [manifest]- Restore windows from a manifestcodex-farm-reboot [--detach] [--allow-fallback] [session]- Safely save, stop, restore, and optionally attach to a farm
Claude and Gemini equivalents use the same tmux workflow and accept the same flags:
claude-add, claude-annotator, claude-board, claude-farm-reboot, claude-looper, claude-restore, claude-resume, claude-save, claude-status, claude-watch, gemini-add, gemini-annotator, gemini-board, gemini-farm-reboot, gemini-looper, gemini-restore, gemini-resume, gemini-save, gemini-status, gemini-watch.
Common:
CODEX_SESSION- tmux session name (default:codexfarm)CODEX_NAME- window name (default: directory basename)CODEX_CMD- command to run (default:codex)CODEX_ARGS- additional arguments for codexCODEX_STATE_BASENAME- state/log directory base name (default:codexfarm)CODEX_TIPS_PROMPT- show tmux tips prompt:0to disable,1to force (default respects a persisted opt-out)CODEX_LOCK_TITLES- set to1to keep Codex windows named after their directory (default0lets Codex's native title updates show)CODEX_REMAIN_ON_EXIT- keep tmux windows visible after the pane command exits (default1; set to0to close windows on exit)CODEX_WATCH_MODE-auto(default),tail, ormultitailto control codex-watch displayCODEX_STATUS_ACTIVITY_LINES- recent pane lines shown bycodex-status activity(default8)CODEX_LOOPER_STATE_ROOT- run-state directory forcodex-status loopers(default:.agent-looper/runsin the current directory)CODEX_AUTOSERVICE_CHOICE-yesornoto persist autoservice choiceCODEX_ANNOTATOR_AUTOSTART- set to0to skip starting the annotatorCODEX_LOOPER_PYTHON_BIN- Python 3.10+ interpreter forcodex-looper(default searchespython3, then versionedpython3.14throughpython3.10)CODEX_ANNOTATOR_PYTHON_BIN- Python 3.10+ interpreter forcodex-annotator(default searchespython3, then versionedpython3.14throughpython3.10)CODEXFARM_PYTHON_BIN- Python 3.10+ interpreter to prefer during./setup.shCODEXFARM_WITH_DEEP_HISTORY- set to1as an alternative tosetup.sh --with-deep-historyCODEXFARM_INSTALL_SESSION_HOOK- set to0to leave the Codex user hook file unchanged during setupCODEXFARM_HISTORY_BACKEND-auto(default),legacy, ordeep-history; auto uses the pinned plugin when installed and otherwise preserves legacy loggingCODEXFARM_DEEP_HISTORY_BIN- override the deep-history executable discovered under the XDG data directoryCODEXFARM_DEEP_HISTORY_PYTHON_BIN- override the Python 3.10+ interpreter used by deep-history hooks and loggers (default searches supportedpython3and versioned commands)CODEXFARM_DEEP_HISTORY_SEAMLESS_PAGEUP- set to0to keep tmux's ordinary Page Up behavior at the top of copy mode instead of opening the older disk transcript (default1)CODEX_LOOPER_LAYOUT- looper tmux layout:auto,single, orsplit; farm launches default tosplit
Annotator-specific:
CODEX_ANNOTATOR_ENABLED- set to0to disable the annotator loopCODEX_ANNOTATOR_UPDATE_TITLES- set to1to restore legacy*RUN*/*READY*/*ERR*title prefixesCODEX_ANNOTATOR_NOTIFY_READY- set to0to disable tmux messages when a window transitions from RUN to READYCODEX_ANNOTATOR_READY_MESSAGE- tmux message template for READY notifications; supports{name}and{state}CODEX_ANNOTATOR_RUNNING_REGEX- regex for pane commands considered RUNNINGCODEX_ANNOTATOR_SESSION_REGEX- regex for sessions to annotateCODEX_ANNOTATOR_SESSION_REGISTRY- file of additional tmux session names to annotate (default:${XDG_STATE_HOME:-$HOME/.local/state}/codexfarm/managed_sessions)CODEX_ANNOTATOR_INTERVAL- polling interval in secondsCODEX_ANNOTATOR_IGNORE_PREFIX- window/session name prefix to ignore (default:!)CODEX_ANNOTATOR_CAPTURE_LINES- number of lines to capture from panes (default:200)
Tool-specific:
claude-addandgemini-addhonorCLAUDE_*orGEMINI_*versions of the common launch variables. For save/restore/resume/status/watch/board commands, select the farm withCODEX_SESSIONor the command's positional/--sessionargument where supported.codex-looperandclaude-looperpass native agent flags after--, for examplecodex-looper --once -- --ask-for-approval neverorclaude-looper --once -- --dangerously-skip-permissions. Built-in Codex and Claude agents can also setmodelandeffortin[agents.*]config. Codex and Claude useinterface = "hybrid"by default; set--interface json,[agents.codex].interface = "json", or[agents.claude].interface = "json"for the older JSON stream path. The Claude flag is spelled--dangerously-skip-permissionsand should only be used in isolated workspaces where unattended edits are acceptable.
Example:
CODEX_CMD="cursor" CODEX_ARGS="--wait" codex-add /my/projectFlags:
codex-add -d: start without attaching (useful in SSH automation)codex-restore -a: attach after restoring;-fto replace same-named windowscodex-save --allow-fallback: explicitly allow provider latest/continue resume commandscodex-farm-reboot -d: save, stop, and restore without attaching; add--allow-fallbackonly when exact identity cannot be recovered
Create a separate board session for quick navigation. The default farm uses the legacy board session name; named farms use <farm>-board:
# Create board session for the default farm
codex-board create
# Create and use a named board
codex-board create work
codex-board link work
codex-board switch work
# Link all Codex windows to the default board
codex-board link
# Switch to the default board session
codex-board switchNow you can use tmux switch-client -t board to scan through all Codex instances while the main codexfarm session continues running.
For named farms, codex-resume work --board jumps directly to work-board.
Boards link existing tmux windows; they do not duplicate provider processes.
- Start or restore your farm, then safely detach:
codex-restore; tmux detach. - Reattach anytime:
codex-resume(ortmux attach -t ${CODEX_SESSION:-codexfarm}). - Prefer
codex-add -din automation to avoid stealing your current terminal. - For mobile networks and roaming devices, use mosh: install
moshon the server (and open UDP 60000-61000), then connect with a mosh-capable client and attach your tmux session. Desktop SSH keeps working the same.- Example client wrapper (tries mosh then ssh):
examples/connect.sh user@host
- Example client wrapper (tries mosh then ssh):
- If your terminal is very small (phones), use
codex-watch --simpleand zoom panes in tmux withPrefix + z. - Optional tmux tweak for mixed desktop/mobile:
tmux set -g aggressive-resize onto let windows resize to the current client.
-
Start many projects at once (non-attaching):
examples/batch-add.sh ~/proj/a ~/proj/b ~/proj/c tmux attach -t ${CODEX_SESSION:-codexfarm}
-
Auto-restore on login (add to shell rc):
# ~/.bashrc or ~/.zshrc source $(pwd)/examples/restore-on-login.sh
-
One-liners:
- Safely reboot and attach:
codex-farm-reboot - Start with a different command:
CODEX_CMD="cursor" CODEX_ARGS="--wait" codex-add -d /path - Start in a named farm without env vars:
codex-add work /path - Watch logs with multitail if available:
codex-watch
- Safely reboot and attach:
All logs are stored in ${XDG_STATE_HOME:-$HOME/.local/state}/${CODEX_STATE_BASENAME:-codexfarm}/logs/ with timestamps:
# View log status
codex-status logs
# Follow specific log
tail -f ~/.local/state/codexfarm/logs/myproject_20240315-143022.log
# Clean old logs (example: older than 7 days)
find ~/.local/state/codexfarm/logs -name "*.log" -mtime +7 -deleteRun the basic validation script (requires tmux):
./validate.sh
./tests/integration/session_resume_smoke.sh
CODEXFARM_DEEP_HISTORY_BIN=/path/to/tmux-deep-history/bin/tmux-deep-history \
./tests/integration/deep_history_smoke.shFor the static checks used in CI without creating live tmux sessions:
VALIDATE_SKIP_TMUX=1 ./validate.shagent-cli-farm/
├── .editorconfig # Shared editor whitespace defaults
├── .github/workflows/ # CI for lint, shell checks, tests, validate, demo
├── pyproject.toml # Ruff and test tooling configuration
├── requirements-dev.txt # Python development dependencies
├── CONTRIBUTING.md # Local development and verification workflow
├── setup.sh # Main setup script
├── bin/ # Helper scripts
│ ├── codex-add # Add new Codex instances
│ ├── codex-annotator # Bash wrapper for annotator
│ ├── codex-annotator.py # Track tmux window status and READY notifications
│ ├── codex-doctor # Diagnose installed-helper and manifest drift
│ ├── codex-save # Save manifest of windows
│ ├── codex-restore # Restore windows from manifest
│ ├── codex-session-hook.py # Record active Codex IDs on managed tmux panes
│ ├── codex-session-hook-install.py # Safely merge the user hook config
│ ├── codex-farm-reboot # Save, stop, and restore a farm
│ ├── codex-watch # Monitor logs
│ ├── codex-board # Navigation helper
│ ├── codex-resume # Resume into existing session(s)
│ ├── codex-status # Status information
│ └── claude-* / gemini-* # Tool wrappers for the same commands
├── docs/
│ ├── looper.md # Detailed looper contract
│ └── QUALITY_REVIEW.md # Hardening review notes from the update guide
├── examples/
│ ├── demo.sh # End-to-end demo of farm
│ └── mock-codex # Fake CLI used by the demo
├── integrations/ # Pinned deep-history lock and atomic installer
├── tests/ # Python unit tests for scripts and looper behavior
├── validate.sh # Basic repo validation script
└── README.md # This file
tmuxcannot mirror the same live pane in two windows (use linked windows or logs)tmuxsurvives client disconnects, but not host reboot or tmux-server exit unless autosave/autorestore recreates windows later.- Autosave/autorestore is systemd-user-only.
- tmux provides one
pipe-paneconsumer per pane; the deep-history backend owns it and mirrors the stream rather than attaching a competing logger. - Existing panes created before the session hook was installed may need one
submitted Codex prompt before hook metadata appears. Save also inspects live
process file descriptors: Codex under
~/.codex/sessions, Claude under~/.claude/projects, and Gemini under a.gemini/.../chatsdirectory. Missing provider IDs stop save unless fallback behavior is explicitly enabled. - A single positional argument to
codex-addis interpreted as a farm name when it does not look like a path. Use--session NAMEto force farm selection when needed. - Gemini looper support is generic command execution, not a verified resumable protocol.
Licensed under the MIT License. See LICENSE for full text.
Unless noted otherwise, all files in this repository are covered by the MIT License.