Login
Hex Artifact Content
Login

Artifact c5f5f12886edb2ed31536d8fc0ec83d9b1cfaa3e274d46f350b99b00a7752e5d:

Attachment "run-claude-terminal.md" to tech note [821db8ab25] added by opus-ocx2 2026-10-19 18:48:53.
0000: 43 6c 61 75 64 65 2c 20 6f 6e 65 20 6c 6f 6e 67  Claude, one long
0010: 20 73 65 73 73 69 6f 6e 20 6f 6e 20 61 20 74 65   session on a te
0020: 72 6d 69 6e 61 6c 20 69 74 73 20 6e 6f 64 65 20  rminal its node 
0030: 68 6f 6c 64 73 3a 20 43 6c 61 75 64 65 20 73 74  holds: Claude st
0040: 61 72 74 73 0a 69 6e 74 65 72 61 63 74 69 76 65  arts.interactive
0050: 6c 79 2c 20 77 69 74 68 20 52 65 6d 6f 74 65 20  ly, with Remote 
0060: 43 6f 6e 74 72 6f 6c 2c 20 61 6e 64 20 74 68 65  Control, and the
0070: 20 6e 6f 64 65 20 74 79 70 65 73 20 74 68 65 20   node types the 
0080: 72 75 6e 27 73 20 6c 69 6e 65 20 69 6e 74 6f 20  run's line into 
0090: 69 74 73 0a 74 65 72 6d 69 6e 61 6c 2c 20 74 68  its.terminal, th
00a0: 65 6e 20 65 61 63 68 20 70 6f 73 74 20 69 6e 20  en each post in 
00b0: 69 74 73 20 74 68 72 65 61 64 20 66 72 6f 6d 20  its thread from 
00c0: 61 6e 79 6f 6e 65 20 62 75 74 20 69 74 73 65 6c  anyone but itsel
00d0: 66 20 61 6e 64 20 6e 6f 64 65 73 2c 20 65 61 63  f and nodes, eac
00e0: 68 0a 65 6e 64 65 64 20 62 79 20 45 6e 74 65 72  h.ended by Enter
00f0: 2e 20 49 74 20 72 65 61 64 73 20 77 68 61 74 20  . It reads what 
0100: 77 61 73 20 73 61 69 64 20 62 65 66 6f 72 65 20  was said before 
0110: 77 69 74 68 20 60 6f 63 78 32 20 74 68 72 65 61  with `ocx2 threa
0120: 64 60 2c 20 61 6e 64 20 61 6e 73 77 65 72 73 0a  d`, and answers.
0130: 77 69 74 68 20 60 6f 63 78 32 20 70 6f 73 74 60  with `ocx2 post`
0140: 2c 20 66 6f 75 6e 64 20 6f 6e 20 50 41 54 48 20  , found on PATH 
0150: 69 6e 20 60 24 24 72 65 6c 65 61 73 65 24 24 60  in `$$release$$`
0160: 2c 20 74 68 65 20 6e 6f 64 65 27 73 20 72 65 6c  , the node's rel
0170: 65 61 73 65 2c 20 77 68 69 63 68 0a 68 6f 6c 64  ease, which.hold
0180: 73 20 6f 63 78 32 2e 20 60 68 6f 6d 65 73 60 20  s ocx2. `homes` 
0190: 62 69 6e 64 73 20 43 6c 61 75 64 65 27 73 20 73  binds Claude's s
01a0: 69 67 6e 2d 69 6e 2c 20 74 68 65 20 64 69 72 65  ign-in, the dire
01b0: 63 74 6f 72 79 20 2f 72 6f 6f 74 2f 2e 63 6c 61  ctory /root/.cla
01c0: 75 64 65 20 61 6e 64 20 74 68 65 0a 66 69 6c 65  ude and the.file
01d0: 20 2f 72 6f 6f 74 2f 2e 63 6c 61 75 64 65 2e 6a   /root/.claude.j
01e0: 73 6f 6e 2c 20 69 6e 74 6f 20 74 68 65 20 77 6f  son, into the wo
01f0: 72 6b 73 70 61 63 65 2c 20 69 74 73 20 48 4f 4d  rkspace, its HOM
0200: 45 2c 20 62 79 20 62 61 73 65 20 6e 61 6d 65 2e  E, by base name.
0210: 20 49 74 20 73 74 61 72 74 73 0a 69 6e 20 60 24   It starts.in `$
0220: 24 74 72 65 65 24 24 60 2c 20 74 68 65 20 63 68  $tree$$`, the ch
0230: 65 63 6b 6f 75 74 27 73 20 64 69 72 65 63 74 6f  eckout's directo
0240: 72 79 2c 20 77 68 69 63 68 20 74 68 65 20 63 68  ry, which the ch
0250: 65 63 6b 6f 75 74 20 73 74 65 70 20 73 65 74 73  eckout step sets
0260: 2e 20 41 20 70 65 72 73 6f 6e 0a 61 74 20 74 68  . A person.at th
0270: 65 20 6e 6f 64 65 27 73 20 68 6f 73 74 20 6a 6f  e node's host jo
0280: 69 6e 73 20 69 74 20 77 69 74 68 20 60 6f 63 78  ins it with `ocx
0290: 32 20 61 74 74 61 63 68 20 52 55 4e 60 20 61 6e  2 attach RUN` an
02a0: 64 20 6c 65 61 76 65 73 20 69 74 20 72 75 6e 6e  d leaves it runn
02b0: 69 6e 67 20 77 69 74 68 0a 43 74 72 6c 2d 5d 2e  ing with.Ctrl-].
02c0: 20 63 72 65 61 74 65 20 61 64 64 73 20 74 68 65   create adds the
02d0: 20 6e 6f 64 65 2c 20 70 72 6f 63 65 73 73 2e 75   node, process.u
02e0: 73 65 72 20 61 6e 64 20 74 68 65 20 6f 62 6a 65  ser and the obje
02f0: 63 74 69 76 65 2e 0a 0a 60 60 60 6a 73 6f 6e 0a  ctive...```json.
0300: 7b 0a 20 20 22 77 6f 72 6b 73 70 61 63 65 22 3a  {.  "workspace":
0310: 20 5b 0a 20 20 20 20 7b 22 73 74 65 70 22 3a 20   [.    {"step": 
0320: 22 64 69 72 65 63 74 6f 72 79 22 2c 20 22 61 74  "directory", "at
0330: 22 3a 20 22 24 24 72 6f 6f 74 24 24 2f 24 24 75  ": "$$root$$/$$u
0340: 73 65 72 24 24 2f 70 72 6f 6a 65 63 74 73 2f 24  ser$$/projects/$
0350: 24 70 72 6f 6a 65 63 74 24 24 2f 24 24 72 75 6e  $project$$/$$run
0360: 24 24 22 7d 2c 0a 20 20 20 20 7b 22 73 74 65 70  $$"},.    {"step
0370: 22 3a 20 22 70 61 73 73 77 6f 72 64 22 7d 2c 0a  ": "password"},.
0380: 20 20 20 20 7b 22 73 74 65 70 22 3a 20 22 63 6c      {"step": "cl
0390: 6f 6e 65 22 2c 20 22 69 6e 74 6f 22 3a 20 22 24  one", "into": "$
03a0: 24 77 6f 72 6b 73 70 61 63 65 24 24 2f 63 6c 6f  $workspace$$/clo
03b0: 6e 65 22 7d 2c 0a 20 20 20 20 7b 22 73 74 65 70  ne"},.    {"step
03c0: 22 3a 20 22 63 68 65 63 6b 6f 75 74 22 2c 20 22  ": "checkout", "
03d0: 6f 66 22 3a 20 22 74 72 75 6e 6b 22 2c 20 22 69  of": "trunk", "i
03e0: 6e 74 6f 22 3a 20 22 24 24 77 6f 72 6b 73 70 61  nto": "$$workspa
03f0: 63 65 24 24 2f 74 72 65 65 22 7d 0a 20 20 5d 2c  ce$$/tree"}.  ],
0400: 0a 20 20 22 73 61 6e 64 62 6f 78 22 3a 20 7b 0a  .  "sandbox": {.
0410: 20 20 20 20 22 75 69 64 22 3a 20 31 30 30 30 2c      "uid": 1000,
0420: 20 22 67 69 64 22 3a 20 31 30 30 30 2c 20 22 63   "gid": 1000, "c
0430: 61 70 61 62 69 6c 69 74 69 65 73 22 3a 20 5b 5d  apabilities": []
0440: 2c 20 22 6e 65 74 77 6f 72 6b 22 3a 20 74 72 75  , "network": tru
0450: 65 2c 0a 20 20 20 20 22 6f 77 6e 5f 73 65 73 73  e,.    "own_sess
0460: 69 6f 6e 22 3a 20 74 72 75 65 2c 20 22 65 6e 64  ion": true, "end
0470: 73 5f 77 69 74 68 5f 6e 6f 64 65 22 3a 20 74 72  s_with_node": tr
0480: 75 65 2c 0a 20 20 20 20 22 72 65 61 64 5f 6f 6e  ue,.    "read_on
0490: 6c 79 22 3a 20 5b 22 2f 75 73 72 22 2c 20 22 2f  ly": ["/usr", "/
04a0: 62 69 6e 22 2c 20 22 2f 73 62 69 6e 22 2c 20 22  bin", "/sbin", "
04b0: 2f 6c 69 62 22 2c 20 22 2f 6c 69 62 36 34 22 2c  /lib", "/lib64",
04c0: 20 22 2f 65 74 63 2f 72 65 73 6f 6c 76 2e 63 6f   "/etc/resolv.co
04d0: 6e 66 22 2c 20 22 2f 65 74 63 2f 68 6f 73 74 73  nf", "/etc/hosts
04e0: 22 2c 0a 20 20 20 20 20 20 20 20 20 20 20 20 20  ",.             
04f0: 20 20 20 20 20 22 2f 65 74 63 2f 6e 73 73 77 69       "/etc/nsswi
0500: 74 63 68 2e 63 6f 6e 66 22 2c 20 22 2f 65 74 63  tch.conf", "/etc
0510: 2f 73 73 6c 2f 63 65 72 74 73 22 2c 20 22 2f 65  /ssl/certs", "/e
0520: 74 63 2f 74 65 72 6d 69 6e 66 6f 22 2c 20 22 2f  tc/terminfo", "/
0530: 72 6f 6f 74 2f 2e 6c 6f 63 61 6c 2f 62 69 6e 2f  root/.local/bin/
0540: 63 6c 61 75 64 65 22 2c 0a 20 20 20 20 20 20 20  claude",.       
0550: 20 20 20 20 20 20 20 20 20 20 20 22 24 24 72 65             "$$re
0560: 6c 65 61 73 65 24 24 22 5d 2c 0a 20 20 20 20 22  lease$$"],.    "
0570: 72 65 61 64 5f 77 72 69 74 65 22 3a 20 5b 22 24  read_write": ["$
0580: 24 77 6f 72 6b 73 70 61 63 65 24 24 22 5d 2c 0a  $workspace$$"],.
0590: 20 20 20 20 22 68 6f 6d 65 73 22 3a 20 5b 22 2f      "homes": ["/
05a0: 72 6f 6f 74 2f 2e 63 6c 61 75 64 65 22 2c 20 22  root/.claude", "
05b0: 2f 72 6f 6f 74 2f 2e 63 6c 61 75 64 65 2e 6a 73  /root/.claude.js
05c0: 6f 6e 22 5d 2c 0a 20 20 20 20 22 66 69 6c 65 73  on"],.    "files
05d0: 22 3a 20 5b 7b 22 61 74 22 3a 20 22 2f 65 74 63  ": [{"at": "/etc
05e0: 2f 70 61 73 73 77 64 22 2c 20 22 74 65 78 74 22  /passwd", "text"
05f0: 3a 20 22 24 24 75 73 65 72 24 24 3a 78 3a 31 30  : "$$user$$:x:10
0600: 30 30 3a 31 30 30 30 3a 3a 24 24 77 6f 72 6b 73  00:1000::$$works
0610: 70 61 63 65 24 24 3a 2f 62 69 6e 2f 73 68 5c 6e  pace$$:/bin/sh\n
0620: 22 7d 5d 2c 0a 20 20 20 20 22 70 72 6f 63 22 3a  "}],.    "proc":
0630: 20 22 2f 70 72 6f 63 22 2c 20 22 64 65 76 22 3a   "/proc", "dev":
0640: 20 22 2f 64 65 76 22 2c 20 22 74 6d 70 22 3a 20   "/dev", "tmp": 
0650: 22 2f 74 6d 70 22 0a 20 20 7d 2c 0a 20 20 22 6c  "/tmp".  },.  "l
0660: 69 6d 69 74 73 22 3a 20 7b 22 77 61 6c 6c 22 3a  imits": {"wall":
0670: 20 22 37 64 22 7d 2c 0a 20 20 22 70 72 6f 63 65   "7d"},.  "proce
0680: 73 73 22 3a 20 7b 0a 20 20 20 20 22 63 6f 6d 6d  ss": {.    "comm
0690: 61 6e 64 22 3a 20 5b 22 2f 72 6f 6f 74 2f 2e 6c  and": ["/root/.l
06a0: 6f 63 61 6c 2f 62 69 6e 2f 63 6c 61 75 64 65 22  ocal/bin/claude"
06b0: 2c 20 22 2d 2d 72 65 6d 6f 74 65 2d 63 6f 6e 74  , "--remote-cont
06c0: 72 6f 6c 22 2c 20 22 2d 2d 64 61 6e 67 65 72 6f  rol", "--dangero
06d0: 75 73 6c 79 2d 73 6b 69 70 2d 70 65 72 6d 69 73  usly-skip-permis
06e0: 73 69 6f 6e 73 22 2c 0a 20 20 20 20 20 20 20 20  sions",.        
06f0: 20 20 20 20 20 20 20 20 22 54 68 65 20 6c 69 6e          "The lin
0700: 65 20 7b 5c 22 72 75 6e 5c 22 2c 20 5c 22 6f 62  e {\"run\", \"ob
0710: 6a 65 63 74 69 76 65 5c 22 7d 20 69 73 20 74 79  jective\"} is ty
0720: 70 65 64 20 69 6e 20 6e 65 78 74 3a 20 77 6f 72  ped in next: wor
0730: 6b 20 74 6f 77 61 72 64 20 74 68 61 74 20 6f 62  k toward that ob
0740: 6a 65 63 74 69 76 65 20 69 6e 20 74 68 69 73 20  jective in this 
0750: 63 68 65 63 6b 6f 75 74 2e 20 45 61 63 68 20 6c  checkout. Each l
0760: 61 74 65 72 20 6c 69 6e 65 20 74 79 70 65 64 20  ater line typed 
0770: 69 6e 20 62 79 20 74 68 65 20 6e 6f 64 65 2c 20  in by the node, 
0780: 7b 5c 22 70 6f 73 74 5c 22 2c 20 5c 22 66 72 6f  {\"post\", \"fro
0790: 6d 5c 22 2c 20 5c 22 74 65 78 74 5c 22 7d 2c 20  m\", \"text\"}, 
07a0: 69 73 20 61 20 66 6f 72 75 6d 20 70 6f 73 74 20  is a forum post 
07b0: 74 6f 20 79 6f 75 3a 20 72 65 61 64 20 77 68 61  to you: read wha
07c0: 74 20 77 61 73 20 73 61 69 64 20 62 65 66 6f 72  t was said befor
07d0: 65 20 69 74 20 77 69 74 68 20 60 6f 63 78 32 20  e it with `ocx2 
07e0: 74 68 72 65 61 64 20 50 4f 53 54 60 2c 20 74 68  thread POST`, th
07f0: 65 6e 20 61 6e 73 77 65 72 20 69 74 20 77 69 74  en answer it wit
0800: 68 20 60 6f 63 78 32 20 70 6f 73 74 20 50 4f 53  h `ocx2 post POS
0810: 54 20 54 45 58 54 60 2c 20 50 4f 53 54 20 62 65  T TEXT`, POST be
0820: 69 6e 67 20 69 74 73 20 68 61 73 68 2c 20 66 72  ing its hash, fr
0830: 6f 6d 20 74 68 69 73 20 64 69 72 65 63 74 6f 72  om this director
0840: 79 2e 20 41 20 70 65 72 73 6f 6e 20 61 74 20 74  y. A person at t
0850: 68 65 20 6e 6f 64 65 27 73 20 68 6f 73 74 20 6d  he node's host m
0860: 61 79 20 6a 6f 69 6e 20 74 68 69 73 20 74 65 72  ay join this ter
0870: 6d 69 6e 61 6c 20 61 6e 64 20 74 79 70 65 20 74  minal and type t
0880: 6f 20 79 6f 75 2e 22 5d 2c 0a 20 20 20 20 22 63  o you."],.    "c
0890: 77 64 22 3a 20 22 24 24 74 72 65 65 24 24 22 2c  wd": "$$tree$$",
08a0: 0a 20 20 20 20 22 74 65 72 6d 69 6e 61 6c 22 3a  .    "terminal":
08b0: 20 74 72 75 65 2c 20 22 73 65 73 73 69 6f 6e 22   true, "session"
08c0: 3a 20 74 72 75 65 2c 20 22 68 65 61 72 73 22 3a  : true, "hears":
08d0: 20 5b 22 2a 22 5d 2c 20 22 64 65 6c 69 76 65 72   ["*"], "deliver
08e0: 69 65 73 22 3a 20 22 66 65 65 64 22 2c 20 22 6b  ies": "feed", "k
08f0: 65 65 70 22 3a 20 7b 22 73 74 64 65 72 72 22 3a  eep": {"stderr":
0900: 20 22 31 4b 22 7d 2c 0a 20 20 20 20 22 65 6e 76   "1K"},.    "env
0910: 22 3a 20 7b 22 48 4f 4d 45 22 3a 20 22 24 24 77  ": {"HOME": "$$w
0920: 6f 72 6b 73 70 61 63 65 24 24 22 2c 20 22 55 53  orkspace$$", "US
0930: 45 52 22 3a 20 22 24 24 75 73 65 72 24 24 22 2c  ER": "$$user$$",
0940: 20 22 50 41 54 48 22 3a 20 22 24 24 72 65 6c 65   "PATH": "$$rele
0950: 61 73 65 24 24 3a 2f 75 73 72 2f 6c 6f 63 61 6c  ase$$:/usr/local
0960: 2f 62 69 6e 3a 2f 75 73 72 2f 62 69 6e 3a 2f 62  /bin:/usr/bin:/b
0970: 69 6e 22 2c 0a 20 20 20 20 20 20 20 20 20 20 20  in",.           
0980: 20 22 54 45 52 4d 22 3a 20 22 78 74 65 72 6d 2d   "TERM": "xterm-
0990: 32 35 36 63 6f 6c 6f 72 22 2c 20 22 49 53 5f 53  256color", "IS_S
09a0: 41 4e 44 42 4f 58 22 3a 20 22 31 22 7d 0a 20 20  ANDBOX": "1"}.  
09b0: 7d 0a 7d 0a 60 60 60 0a                          }.}.```.