x_claw is a local gateway service for the xllm project, designed around a single target repository and a single active task.
The current positioning is important:
- It is primarily built for
xllmproject workflows - It currently supports only the
codexCLI as its agent execution backend - In the current workflow, all code implementation work is executed by
codex - Users only submit tasks, inspect progress, provide advice, and review results
- The system still keeps internal roles such as
Product Owner,Project Manager,Developer,Tester, andQA Product Owneris the only formal routing owner- Only one active task is allowed at a time
For the full design rationale, see docs/DESIGN.md.
- Minimal command surface: only
start,status, andstop - Single-task workspace model: each task gets its own
task.md,event_log.md,current/,history/, andruns/ - Supervision-oriented interaction: humans participate through
status --advise,--approve, and--reject - Artifact-driven execution: requirements, plans, handoffs, test results, QA, and review all flow through formal artifacts
- Local agent execution: internal roles run through the local
codexCLI - Observable progress:
progress.mdmaintains a user-readable summary and append-only timeline
This version follows a few explicit constraints:
- Single target repository
- Single active task
- No human involvement in the fine-grained runtime state machine
waiting_approvalis the only formal human waiting stateProduct Ownerabsorbs human advice and decides formal routing at route boundaries
The internal stage flow is:
intake
-> product_owner_refinement
-> [project_manager_research, optional]
-> product_owner_dispatch
-> [developer | tester | qa | human_gate | closeout]
- Python
>=3.10 - A locally available
codexCLI - No support yet for agent backends other than
codexCLI - Optional:
git, used to collect target repository context
From the project root:
pip install -e .Install development dependencies:
pip install -e .[dev]Then verify the CLI is available:
x_claw --versionx_claw start \
--repo /path/to/target-repo \
--task "Add a README and a minimal usage guide"Optionally specify a task ID and workspace root:
x_claw start \
--repo /path/to/target-repo \
--task "Fix the login flow" \
--task-id task-login-fix \
--workspace-root ./workspaceThe command prints:
task_idtask_workspace_pathworker_pidprogress_path
x_claw statusstatus prints a fixed supervision view:
active_task_idtask_workspace_pathworker_pidtask_statuscurrent_stagecurrent_owneractive_step_idlatest_updatecurrent_focusnext_stepriskspending_advice_countneeds_human_reviewlatest_review_request_idprogress_path
If there is no active task, status returns an idle view.
x_claw status --advise "Narrow the scope and focus on the CLI only"Notes:
- Advice is appended to
human_advice_log - It does not interrupt the current stage immediately
Product Ownerabsorbs pending advice at formal routing boundaries
Human review is needed only after the flow enters human_gate.
Approve:
x_claw status --approve --comment "Looks good, proceed to closeout"Reject:
x_claw status --reject --comment "Test coverage is still missing failure cases"Notes:
- Both
approveandrejectroute the task back toproduct_owner_dispatch - Human review can happen in multiple rounds
x_claw stopThis marks the current active task as terminated and attempts to stop the gateway worker.
x_claw start --repo REPO --task TEXT [--task-id TASK_ID] [--workspace-root PATH]x_claw status [--workspace-root PATH]
x_claw status --advise TEXT [--workspace-root PATH]
x_claw status --approve [--comment TEXT] [--workspace-root PATH]
x_claw status --reject --comment TEXT [--workspace-root PATH]x_claw stop [--workspace-root PATH]gateway-worker is an internal subcommand and normally should not be called directly.
By default, the workspace root is workspace/ under the current command invocation directory.
Each task gets its own directory:
workspace/
<task_id>/
task.md
event_log.md
gateway.log
current/
history/
runs/
Where:
task.md: the main task record, including runtime state and current artifact pointersevent_log.md: the event logcurrent/: the currently active formal artifactshistory/: archived artifact versionsruns/: per-invocation prompt, response, and run log files
requirement_specexecution_planresearch_briefdev_handofftest_handoffimplementation_resulttest_reportqa_resultrepair_ticketroute_decisioncloseout
progresshuman_advice_logreview_requestreview_decision
Formal task statuses are:
runningwaiting_approvalcompletedfailedterminated
Meaning:
running: the gateway is actively advancing the workflowwaiting_approval: the workflow is waiting for human reviewcompleted: the task has finished successfullyfailed: a stage execution failedterminated: the task was explicitly stopped
Role prompts are stored in:
src/x_claw/agents/product_owner.mdsrc/x_claw/agents/project_manager.mdsrc/x_claw/agents/developer.mdsrc/x_claw/agents/tester.mdsrc/x_claw/agents/qa.md
At runtime, x_claw combines:
- the role prompt
- the current stage objective
task.md- the artifacts required for the stage
into a single agent invocation executed through the local codex CLI.
Run the test suite with:
PYTHONPATH=src python -m unittest discover -s tests -p 'test*.py'If pytest is installed locally, you can also run:
python -m pytest- It is currently aimed at the
xllmproject, not yet a fully generalized multi-repo orchestration framework - Only one active task is supported at a time
- It is single-repository only
- It currently supports only the local
codexCLI and no other agent backend - In the current workflow, code implementation is executed by
codex gateway-workeris a local background process, not a remote service
- Design document:
docs/DESIGN.md - CLI entrypoint:
src/x_claw/cli.py - Gateway loop:
src/x_claw/gateway.py - Stage executor:
src/x_claw/executor.py