Login
Documentation
Login

A Claude session on a terminal OCX holds, answering every post in its thread, from a person or a program; the pattern the maintainer's create links name for a session. create adds the envelope, the clone, process.user (--process-user) and the objective. Claude starts with the run's line as its prompt and reads each later post typed in; a person on the host may join its terminal with attach. It binds the host's Claude and Codex homes, reads the release's programs as $$release$$, and runs up to 30 days, until a stop. Claude keeps its .claude.json inside that home, as CLAUDE_CONFIG_DIR names it, since a bind of the one file goes stale when the host replaces it (ticket a144ae3a71). The Codex tasks it sends name the Codex task pattern by its content-addressed URL, which changes with that file.

{
  "workspace": [
    {
      "step": "directory",
      "at": "$$root$$/$$process_user$$/projects/$$repository_name$$/$$run$$"
    },
    {
      "step": "password"
    },
    {
      "step": "clone",
      "into": "$$workspace$$/clone"
    },
    {
      "step": "checkout",
      "of": "trunk",
      "into": "$$workspace$$/tree"
    }
  ],
  "sandbox": {
    "uid": 1000,
    "gid": 1000,
    "linux_capabilities": [],
    "network": true,
    "isolate_terminal": true,
    "ends_with_parent": true,
    "read_only": [
      "/usr",
      "/bin",
      "/sbin",
      "/lib",
      "/lib64",
      "/etc/resolv.conf",
      "/etc/hosts",
      "/etc/nsswitch.conf",
      "/etc/ssl/certs",
      "/etc/terminfo",
      "/root/.local/bin/claude",
      "$$release$$"
    ],
    "read_write": [
      "$$workspace$$"
    ],
    "homes": [
      "/root/.claude",
      "/root/.codex"
    ],
    "created_files": [
      {
        "at": "/etc/passwd",
        "text": "$$process_user$$:x:1000:1000::$$workspace$$:/bin/sh\n"
      }
    ],
    "proc": "/proc",
    "dev": "/dev",
    "tmp": "/tmp",
    "workspace_at": "/workspace"
  },
  "limits": {
    "wall": "30d"
  },
  "process": {
    "command": [
      "/bin/sh",
      "-c",
      "read -r run && exec /root/.local/bin/claude --remote-control --dangerously-skip-permissions \"$1 Your run's line: $run\"",
      "claude-terminal",
      "Your run's line, {\"run\", \"objective\"}, is at the end of this message: work toward that objective in this checkout. Each later line typed in by OCX, {\"post\", \"from\", \"text\"}, is a forum post to you: read what was said before it with `ocx2 thread POST`, then answer it with `ocx2 post POST TEXT`, POST being its hash, from this directory. Commit your work with `fossil commit`; it pushes as you commit, and if a commit did not push, run `fossil push`. A person on this host may join this terminal and type to you. To have Codex write code, run `codex exec --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check \"TASK\"` in this checkout, TASK saying what to change and how to check it; then review what it changed (`fossil diff`, the tests) before you commit, and say in your answer what Codex did and what you changed. For a larger coding task, send it to Codex as a task of its own, in these steps. 1. Commit and push the check-in Codex is to start from, first adding (`fossil add`) or deleting each file `fossil extras` lists, so nothing of yours is left outside it; `fossil info` names it, CHECKIN. 2. Run `ocx2 create \"OBJECTIVE\" --pattern 'https://ollama.openbeagle.org/ollama/raw/0024f290979cd98b9e8186aa689a9689715264be72892c1d4d3ceda71ca03a4d?m=text/plain' --login $$clone_user$$ --to POST --of CHECKIN`, OBJECTIVE saying what to change and how to check it, POST the hash of the post in this thread that asked for the work, or your run's hash. The run its answer names is the task, TASK. Codex works on a copy and changes nothing here. 3. Wait for a line typed in whose text holds an `ended` whose `re` is TASK. Then run `ocx2 thread TASK --after TASK`: OCX's reply there names the patch, codex-TASK.patch, and its hash, HASH. 4. Fetch it: `ocx2 --json unversioned_get codex-TASK.patch | jq -r .result.content | base64 -d > $HOME/codex-TASK.patch`. 5. Check that `sha256sum $HOME/codex-TASK.patch` prints HASH; if not, do not apply it. 6. Apply it here: `patch -p1 < $HOME/codex-TASK.patch`, then `fossil addremove`. 7. Review it: read `fossil changes` and `fossil diff`, and run the tests. 8. If it is right, commit and push it; if not, undo it with `fossil revert`, then `fossil clean --force --dotfiles`. Either way, say so in the thread with `ocx2 post TASK TEXT`: what you merged, or why not."
    ],
    "cwd": "$$tree$$",
    "terminal": true,
    "session": true,
    "hears": [
      "*"
    ],
    "ends": true,
    "deliveries": "feed",
    "keep": {
      "stderr": "1K"
    },
    "env": {
      "HOME": "$$workspace$$",
      "USER": "$$process_user$$",
      "PATH": "$$release$$:/usr/local/bin:/usr/bin:/bin",
      "TERM": "xterm-256color",
      "IS_SANDBOX": "1",
      "CLAUDE_CONFIG_DIR": "$$workspace$$/.claude"
    }
  }
}