chainlesschain 0.165.6 → 0.165.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/package.json +2 -1
  2. package/src/assets/web-panel/assets/{AIOps-vfoDb6HZ.js → AIOps-B3gWmXjo.js} +1 -1
  3. package/src/assets/web-panel/assets/{ActionButton-Cm5f7p93.js → ActionButton-G9pdT-0e.js} +1 -1
  4. package/src/assets/web-panel/assets/{Analytics-yRuvgWxa.js → Analytics-Ca30J7m2.js} +3 -3
  5. package/src/assets/web-panel/assets/{AppLayout-BROsC4h1.js → AppLayout-BtVTm8PU.js} +5 -5
  6. package/src/assets/web-panel/assets/{Artifacts-CimHApb1.js → Artifacts-BhViNa6u.js} +1 -1
  7. package/src/assets/web-panel/assets/{Audit-DI8kr8zI.js → Audit-DhKq-FnY.js} +1 -1
  8. package/src/assets/web-panel/assets/{BackgroundAgents-DSLzKy-n.js → BackgroundAgents-BL0SVbnE.js} +1 -1
  9. package/src/assets/web-panel/assets/{Backup-DkH_n2r1.js → Backup-BWkblnFi.js} +1 -1
  10. package/src/assets/web-panel/assets/{BaseInput-CKSrUoRA.js → BaseInput-ClaRNrF8.js} +1 -1
  11. package/src/assets/web-panel/assets/{Chat-ClwfMXUS.js → Chat-sZE2Z77o.js} +4 -4
  12. package/src/assets/web-panel/assets/{ChatBubbleRenderer-CjMaqfL7.js → ChatBubbleRenderer-BAfKOnRe.js} +1 -1
  13. package/src/assets/web-panel/assets/{Checkbox-BYTehcQG.js → Checkbox-Cvhay5WM.js} +1 -1
  14. package/src/assets/web-panel/assets/{Codegen-B8AMcp6J.js → Codegen-BpejL-4N.js} +1 -1
  15. package/src/assets/web-panel/assets/{Col-BNSogPo3.js → Col-g2Ki6g_1.js} +1 -1
  16. package/src/assets/web-panel/assets/{Community-JxPvGb8O.js → Community-D2xKbNo9.js} +1 -1
  17. package/src/assets/web-panel/assets/{Compact-DF7bFAgE.js → Compact-DbL1Pds3.js} +1 -1
  18. package/src/assets/web-panel/assets/{Compliance-Bvhqnwrq.js → Compliance-DGtZCV4c.js} +1 -1
  19. package/src/assets/web-panel/assets/{Cowork-BDS0CJvM.js → Cowork-4kQpoNsI.js} +3 -3
  20. package/src/assets/web-panel/assets/{Cron-DqvRfxoQ.js → Cron-BxTYXXAN.js} +2 -2
  21. package/src/assets/web-panel/assets/{Crosschain-CDcIvnqS.js → Crosschain-k0J0LT2N.js} +1 -1
  22. package/src/assets/web-panel/assets/{DID-D7jaUxU3.js → DID-BaqhoPgN.js} +2 -2
  23. package/src/assets/web-panel/assets/{Dashboard-B5A18wEV.js → Dashboard-T4RVPIM1.js} +2 -2
  24. package/src/assets/web-panel/assets/{Dropdown-_6IVkGag.js → Dropdown-DszOToWq.js} +1 -1
  25. package/src/assets/web-panel/assets/{EmailListRenderer-C9PeiKCG.js → EmailListRenderer-C9KJU7HF.js} +1 -1
  26. package/src/assets/web-panel/assets/{FamilyGuardDashboard-DXjuEHrX.js → FamilyGuardDashboard-Cmr0JnsA.js} +1 -1
  27. package/src/assets/web-panel/assets/{Federation-B4IAR9zv.js → Federation-BI-_2xZX.js} +1 -1
  28. package/src/assets/web-panel/assets/{FormItemContext-CxQeSNx1.js → FormItemContext-DsnDEPsl.js} +1 -1
  29. package/src/assets/web-panel/assets/{GenericCardRenderer-B8GS-Y3N.js → GenericCardRenderer-BLncAKKK.js} +1 -1
  30. package/src/assets/web-panel/assets/{Git-BS8SouUX.js → Git-BPQhGXDn.js} +2 -2
  31. package/src/assets/web-panel/assets/{Governance-Dq9aYb5Q.js → Governance-CyElbUQW.js} +1 -1
  32. package/src/assets/web-panel/assets/{Inference-BrCEe9AJ.js → Inference-CcSntBQD.js} +1 -1
  33. package/src/assets/web-panel/assets/{KnowledgeGraph-DybOpiY2.js → KnowledgeGraph-p6e7HZ2r.js} +1 -1
  34. package/src/assets/web-panel/assets/{Logs-DBpzbRfx.js → Logs-CNEtr-wz.js} +2 -2
  35. package/src/assets/web-panel/assets/MarkdownRenderer-Bj9xI0YH.js +1 -0
  36. package/src/assets/web-panel/assets/{Marketplace-Cc7CCSCu.js → Marketplace-Dd2notAJ.js} +1 -1
  37. package/src/assets/web-panel/assets/{McpTools-DFaIhOfu.js → McpTools-BBsN2CSW.js} +4 -4
  38. package/src/assets/web-panel/assets/{Memory-KCqlp9ol.js → Memory-Dg2uTvwx.js} +2 -2
  39. package/src/assets/web-panel/assets/{MobileBridge-Bys84ySN.js → MobileBridge-r1YMRiJV.js} +1 -1
  40. package/src/assets/web-panel/assets/{MobileProjects-B-6qU-je.js → MobileProjects-C-89kSm4.js} +1 -1
  41. package/src/assets/web-panel/assets/{Mtc-BgY-fvCq.js → Mtc-CrPZcVgf.js} +5 -5
  42. package/src/assets/web-panel/assets/{MtcAudit-B8pCmqQJ.js → MtcAudit-sxi7hqJb.js} +4 -4
  43. package/src/assets/web-panel/assets/{Multisig-BbOmYutA.js → Multisig-CAgOMfF1.js} +3 -3
  44. package/src/assets/web-panel/assets/{NLProgramming-BocLQz_M.js → NLProgramming-DafaPts3.js} +1 -1
  45. package/src/assets/web-panel/assets/{Notes-CSwbxEop.js → Notes-CJM-xUW_.js} +3 -3
  46. package/src/assets/web-panel/assets/{NotificationSettings-CqFNSYG3.js → NotificationSettings-L0ZjfAh_.js} +1 -1
  47. package/src/assets/web-panel/assets/{OrderTableRenderer-C6gMfAk7.js → OrderTableRenderer-BB1CvCK0.js} +1 -1
  48. package/src/assets/web-panel/assets/{Organization-QrDXVdMJ.js → Organization-DeLtgAD8.js} +4 -4
  49. package/src/assets/web-panel/assets/{Overflow-Cxntotjt.js → Overflow-CKC2b10z.js} +1 -1
  50. package/src/assets/web-panel/assets/{P2P-CIdBOwNq.js → P2P-eyf2rzY1.js} +2 -2
  51. package/src/assets/web-panel/assets/{PdhVaultBrowser-CT5aP8rD.js → PdhVaultBrowser-5upNIOW8.js} +3 -3
  52. package/src/assets/web-panel/assets/{Permissions-DH7OM8XU.js → Permissions-B8p3W6JK.js} +4 -4
  53. package/src/assets/web-panel/assets/{PersonalDataHub-CnJqbWce.js → PersonalDataHub-BnRMxTq3.js} +5 -5
  54. package/src/assets/web-panel/assets/{Pipeline-5C3HG1kH.js → Pipeline-DjCNI1li.js} +1 -1
  55. package/src/assets/web-panel/assets/{Privacy-B4yIp7xK.js → Privacy-u6gXLbWT.js} +1 -1
  56. package/src/assets/web-panel/assets/{ProjectInit-BMvt-2M0.js → ProjectInit-BZAw4tkM.js} +2 -2
  57. package/src/assets/web-panel/assets/{ProjectSettings-CvSTEMRG.js → ProjectSettings-B1Tr72q7.js} +2 -2
  58. package/src/assets/web-panel/assets/{Projects-BKBJxEek.js → Projects-DO7HFuBQ.js} +1 -1
  59. package/src/assets/web-panel/assets/{Providers-BdwUqFWN.js → Providers-BjCztyhj.js} +1 -1
  60. package/src/assets/web-panel/assets/{QrScannerModal-DtnCKlTm.js → QrScannerModal-ZWyCUbR1.js} +1 -1
  61. package/src/assets/web-panel/assets/{QuickAsk-sTbgwyNr.js → QuickAsk-DhDjeW4G.js} +1 -1
  62. package/src/assets/web-panel/assets/{Recommend-Bzr14gSb.js → Recommend-R_CN2MuU.js} +1 -1
  63. package/src/assets/web-panel/assets/{RemoteSession-C_TF5IaJ.js → RemoteSession-uxFcujeu.js} +2 -2
  64. package/src/assets/web-panel/assets/{Reputation-GCAM4H2K.js → Reputation-DX8D7rks.js} +1 -1
  65. package/src/assets/web-panel/assets/{Row-Dir0r6OQ.js → Row-BYahQILD.js} +1 -1
  66. package/src/assets/web-panel/assets/{RssFeed-CpGnlecX.js → RssFeed-CUSQ2tm-.js} +3 -3
  67. package/src/assets/web-panel/assets/{Search-DMMamC6u.js → Search-CnN_S8Cs.js} +1 -1
  68. package/src/assets/web-panel/assets/{Security-yqay5yG-.js → Security-DcZlh-O4.js} +4 -4
  69. package/src/assets/web-panel/assets/{Services-C5i2wh9G.js → Services-ZhBOjzIX.js} +2 -2
  70. package/src/assets/web-panel/assets/{Skeleton-vUqk35yj.js → Skeleton-D5Qnq_lI.js} +1 -1
  71. package/src/assets/web-panel/assets/{Skills-DzcSkhot.js → Skills-BC9cZ3Be.js} +1 -1
  72. package/src/assets/web-panel/assets/{Sla-CB6qbYNr.js → Sla-DauJ3E8_.js} +1 -1
  73. package/src/assets/web-panel/assets/SpeechSettings-DbNeZ_fh.js +1 -0
  74. package/src/assets/web-panel/assets/{SyncSettings-D-RrsxTJ.js → SyncSettings-DUvJbSct.js} +2 -2
  75. package/src/assets/web-panel/assets/{Tasks-DFxdOJiq.js → Tasks-BXa-5noQ.js} +1 -1
  76. package/src/assets/web-panel/assets/{Templates-SKAob_Aq.js → Templates-JxaiUt_3.js} +1 -1
  77. package/src/assets/web-panel/assets/{Tenant-BPfsfHQ-.js → Tenant-BW4ERQN8.js} +1 -1
  78. package/src/assets/web-panel/assets/{Terminal-8iw7FpUf.js → Terminal-DltUbdtv.js} +2 -2
  79. package/src/assets/web-panel/assets/{TimelineRenderer-C4Gjj5Su.js → TimelineRenderer-CMoZz0Tc.js} +1 -1
  80. package/src/assets/web-panel/assets/{Tokens-COYhN18e.js → Tokens-D_VEV60K.js} +1 -1
  81. package/src/assets/web-panel/assets/{Trigger-B-JzXcf6.js → Trigger-CCXTCs0R.js} +1 -1
  82. package/src/assets/web-panel/assets/{Trust-BJ5bg0nI.js → Trust-lkGRIPcG.js} +1 -1
  83. package/src/assets/web-panel/assets/{UkeySign-BG_ByRMf.js → UkeySign-BfGeQ9HX.js} +1 -1
  84. package/src/assets/web-panel/assets/{VideoEditing-B3kOnSiU.js → VideoEditing-BEC7pYvc.js} +1 -1
  85. package/src/assets/web-panel/assets/{Wallet-CcoGFnK7.js → Wallet-BZdG24o0.js} +4 -4
  86. package/src/assets/web-panel/assets/{WebAuthn-DdT8vRC_.js → WebAuthn-yoEddedp.js} +4 -4
  87. package/src/assets/web-panel/assets/{WorkflowEditor-CZu3M9N8.js → WorkflowEditor-BXZEprOW.js} +1 -1
  88. package/src/assets/web-panel/assets/{chat-DxJt3Qba.js → chat-gg0bzZal.js} +1 -1
  89. package/src/assets/web-panel/assets/{colors-DdYfwJaB.js → colors-DjRVRuin.js} +1 -1
  90. package/src/assets/web-panel/assets/{compact-item-BG3SUzwj.js → compact-item-su-dieAc.js} +1 -1
  91. package/src/assets/web-panel/assets/{createContext-By51z2-1.js → createContext-Ci3S8oKF.js} +1 -1
  92. package/src/assets/web-panel/assets/devWarning-CxbFX9uH.js +1 -0
  93. package/src/assets/web-panel/assets/{hasIn-B0apZ3KJ.js → hasIn-D8F10heH.js} +1 -1
  94. package/src/assets/web-panel/assets/{index-DE76D-kA.js → index-11wtYQiF.js} +1 -1
  95. package/src/assets/web-panel/assets/{index-BkvcEo4p.js → index-1IgxgALJ.js} +1 -1
  96. package/src/assets/web-panel/assets/{index-Bos5_aMV.js → index-1agckWSq.js} +1 -1
  97. package/src/assets/web-panel/assets/{index-BfWYsB9t.js → index-5JqhujnR.js} +1 -1
  98. package/src/assets/web-panel/assets/{index-CAhHirVH.js → index-6Tniqk1s.js} +1 -1
  99. package/src/assets/web-panel/assets/{index-BYINoRLK.js → index-8Z-8BIlN.js} +1 -1
  100. package/src/assets/web-panel/assets/{index-B5rLiEo0.js → index-BCI5v0yB.js} +1 -1
  101. package/src/assets/web-panel/assets/{index-BZ_0qm4g.js → index-BDJntYmJ.js} +1 -1
  102. package/src/assets/web-panel/assets/{index-CWEuZWCK.js → index-BGzixOGZ.js} +1 -1
  103. package/src/assets/web-panel/assets/{index-BLIbGOLX.js → index-BMMOVoLD.js} +1 -1
  104. package/src/assets/web-panel/assets/{index-bP_VlDb4.js → index-BTFpdBtt.js} +1 -1
  105. package/src/assets/web-panel/assets/{index-B3rWuPMW.js → index-Ba_HyPnE.js} +1 -1
  106. package/src/assets/web-panel/assets/{index-Da_WBdLX.js → index-BbF1IHof.js} +1 -1
  107. package/src/assets/web-panel/assets/{index-RD6O-0C6.js → index-BgT9su_e.js} +1 -1
  108. package/src/assets/web-panel/assets/{index-CpjZhgNd.js → index-BzPB6kGZ.js} +1 -1
  109. package/src/assets/web-panel/assets/{index-Q2SCX-MI.js → index-C6ygzplr.js} +1 -1
  110. package/src/assets/web-panel/assets/{index-BIrJfqO4.js → index-CC3ZDjzY.js} +1 -1
  111. package/src/assets/web-panel/assets/{index-BBPf3TpM.js → index-CEmXRhAE.js} +1 -1
  112. package/src/assets/web-panel/assets/index-CJGOlduY.js +1 -0
  113. package/src/assets/web-panel/assets/{index-Cp6e-hGw.js → index-CMPqd5Cv.js} +1 -1
  114. package/src/assets/web-panel/assets/{index-kf57LJ93.js → index-COWd8uGx.js} +1 -1
  115. package/src/assets/web-panel/assets/{index-CW93tZDv.js → index-CPIYSp4H.js} +1 -1
  116. package/src/assets/web-panel/assets/{index-BewKYrX9.js → index-CR0h6seT.js} +1 -1
  117. package/src/assets/web-panel/assets/{index-p1_8SbI1.js → index-CUmDhC4j.js} +1 -1
  118. package/src/assets/web-panel/assets/index-CkBCN5yH.js +1 -0
  119. package/src/assets/web-panel/assets/{index-ZxtP8jG7.js → index-CusgZPtc.js} +1 -1
  120. package/src/assets/web-panel/assets/{index-BWF8_mkx.js → index-DBAETXft.js} +1 -1
  121. package/src/assets/web-panel/assets/{index-BP94CrBV.js → index-DIJ2qFOC.js} +1 -1
  122. package/src/assets/web-panel/assets/{index-CNIxXMmN.js → index-Dbq4NMET.js} +1 -1
  123. package/src/assets/web-panel/assets/{index-CzmQElZy.js → index-DkMEF5VT.js} +1 -1
  124. package/src/assets/web-panel/assets/{index-ZFbps9po.js → index-DkfQR3hM.js} +1 -1
  125. package/src/assets/web-panel/assets/{index-Dz49VOyQ.js → index-DnLucOn9.js} +1 -1
  126. package/src/assets/web-panel/assets/{index-oxRrmFO9.js → index-DugB_aKa.js} +1 -1
  127. package/src/assets/web-panel/assets/{index-Bissefox.js → index-DyLUarhZ.js} +3 -3
  128. package/src/assets/web-panel/assets/{index-DaIz0NAW.js → index-T6_6ygJZ.js} +1 -1
  129. package/src/assets/web-panel/assets/{index-SQqOlR3d.js → index-Tu8eWqh-.js} +1 -1
  130. package/src/assets/web-panel/assets/{index-DCn8IcxV.js → index-W7XUgdVL.js} +1 -1
  131. package/src/assets/web-panel/assets/{index-3jWkIu5j.js → index-dHZinfko.js} +1 -1
  132. package/src/assets/web-panel/assets/{index-C1C9i79A.js → index-jyNgp5FI.js} +1 -1
  133. package/src/assets/web-panel/assets/{initDefaultProps-BWJktcg8.js → initDefaultProps-Cv4p8e4w.js} +1 -1
  134. package/src/assets/web-panel/assets/{motion-BEXBzUFV.js → motion-B8EwmMOw.js} +1 -1
  135. package/src/assets/web-panel/assets/{move-BUKwn2sx.js → move-B8R9F8TK.js} +1 -1
  136. package/src/assets/web-panel/assets/{mtc-parser-FTI7btqQ.js → mtc-parser-DoFYz5Bp.js} +1 -1
  137. package/src/assets/web-panel/assets/{omit-CsLtSPH3.js → omit-CHWYLBjI.js} +1 -1
  138. package/src/assets/web-panel/assets/{pickAttrs-DWZxsT_S.js → pickAttrs-CXuPDO77.js} +1 -1
  139. package/src/assets/web-panel/assets/{placementArrow-Bcfs43CX.js → placementArrow-BaAtUUon.js} +1 -1
  140. package/src/assets/web-panel/assets/{responsiveObserve-a9bcC1p-.js → responsiveObserve-DCc4zcDD.js} +1 -1
  141. package/src/assets/web-panel/assets/{slide-BDTzgOXN.js → slide-B_lx89oZ.js} +1 -1
  142. package/src/assets/web-panel/assets/{statusUtils-Iq1j_HUg.js → statusUtils-DE8DPmR0.js} +1 -1
  143. package/src/assets/web-panel/assets/{styleChecker-DAZEYxeh.js → styleChecker-1ktXOsL_.js} +1 -1
  144. package/src/assets/web-panel/assets/{useFlexGapSupport-DVkjyDrh.js → useFlexGapSupport-xH89-wjh.js} +1 -1
  145. package/src/assets/web-panel/assets/{useFs-wXTpNTHt.js → useFs-DscvfW5p.js} +1 -1
  146. package/src/assets/web-panel/assets/{usePersonalDataHub-CtQM_aZr.js → usePersonalDataHub-RdMKQta7.js} +1 -1
  147. package/src/assets/web-panel/assets/{vnode-hjEoG85v.js → vnode-Z3wTni2T.js} +1 -1
  148. package/src/assets/web-panel/assets/{zoom-BHVpyKg_.js → zoom-B0iChCsm.js} +1 -1
  149. package/src/assets/web-panel/index.html +1 -1
  150. package/src/command-help-index.json +3 -3
  151. package/src/commands/agent.js +91 -60
  152. package/src/commands/git.js +39 -0
  153. package/src/commands/plugin.js +17 -2
  154. package/src/commands/session-group.js +131 -0
  155. package/src/commands/session-location.js +48 -0
  156. package/src/commands/session.js +11 -0
  157. package/src/commands/sync-providers.js +4 -1
  158. package/src/commands/update.js +1 -0
  159. package/src/data/changelog.json +27 -1
  160. package/src/gateways/ws/ws-agent-handler.js +20 -12
  161. package/src/harness/jsonl-session-store.js +279 -37
  162. package/src/harness/mcp-client.js +701 -91
  163. package/src/harness/session-index.js +15 -4
  164. package/src/lib/agent-worktree.js +8 -1
  165. package/src/lib/auto-mode-safety-classifier.js +3 -17
  166. package/src/lib/background-agent-keeper-protocol.js +26 -6
  167. package/src/lib/background-agent-supervisor.js +17 -1
  168. package/src/lib/browser-evidence.js +1405 -0
  169. package/src/lib/chrome-connector.js +465 -79
  170. package/src/lib/claude-project-auto-memory.js +481 -0
  171. package/src/lib/claude-project-storage-layout.js +104 -0
  172. package/src/lib/cloud/cloud-client.js +40 -0
  173. package/src/lib/execution-location-local-supervisor.mjs +226 -0
  174. package/src/lib/execution-location-runner-lifecycle.js +991 -0
  175. package/src/lib/execution-location-target-preflight.js +333 -0
  176. package/src/lib/execution-location-target.js +783 -13
  177. package/src/lib/file-lines.js +6 -1
  178. package/src/lib/gateway-client-resilience.js +571 -0
  179. package/src/lib/gitlab-mr-worktree.js +176 -0
  180. package/src/lib/hooks-v2-producers.js +119 -15
  181. package/src/lib/hooks-v2-workspace-context.js +44 -1
  182. package/src/lib/host-resource-budget.js +295 -0
  183. package/src/lib/ide-context.js +15 -2
  184. package/src/lib/llm-config-defaults.js +43 -0
  185. package/src/lib/mcp-lifecycle-authority.js +887 -0
  186. package/src/lib/mcp-oauth.js +101 -20
  187. package/src/lib/mcp-tls.js +103 -3
  188. package/src/lib/paths.js +260 -32
  189. package/src/lib/permission-request.js +48 -0
  190. package/src/lib/plugin-runtime/bin.js +3 -1
  191. package/src/lib/plugin-runtime/hooks.js +3 -1
  192. package/src/lib/plugin-runtime/install.js +117 -1
  193. package/src/lib/plugin-runtime/lsp.js +4 -4
  194. package/src/lib/plugin-runtime/marketplace-archive-source.js +40 -5
  195. package/src/lib/plugin-runtime/marketplace-catalog.js +13 -2
  196. package/src/lib/plugin-runtime/marketplace-command-descriptor.js +343 -0
  197. package/src/lib/plugin-runtime/marketplace-command-source.js +580 -0
  198. package/src/lib/plugin-runtime/marketplace-source-adapter.js +33 -8
  199. package/src/lib/plugin-runtime/mcp.js +3 -1
  200. package/src/lib/plugin-runtime/monitors.js +3 -1
  201. package/src/lib/plugin-runtime/remote-source.js +151 -6
  202. package/src/lib/plugin-runtime/settings.js +3 -1
  203. package/src/lib/plugin-runtime/trust.js +274 -13
  204. package/src/lib/process-execution-broker/credential-agent.js +210 -41
  205. package/src/lib/process-execution-broker/index.js +15 -1
  206. package/src/lib/process-execution-broker/linux-cgroup-v2.js +391 -0
  207. package/src/lib/process-execution-broker/platform-sandbox.js +50 -28
  208. package/src/lib/project-mcp-trust.js +165 -10
  209. package/src/lib/resume-session.js +9 -6
  210. package/src/lib/session-core-singletons.js +26 -11
  211. package/src/lib/session-host-lease.js +52 -16
  212. package/src/lib/session-lifecycle-scope.js +153 -0
  213. package/src/lib/session-message-fabric.js +168 -21
  214. package/src/lib/session-projection.js +244 -4
  215. package/src/lib/session-store-guard.js +3 -1
  216. package/src/lib/session-workbench-store.js +466 -0
  217. package/src/lib/spellcheck.js +211 -0
  218. package/src/lib/sub-agent-context.js +9 -9
  219. package/src/lib/sync-cli-db.js +485 -129
  220. package/src/lib/sync-credentials.js +31 -20
  221. package/src/lib/web-fetch.js +112 -40
  222. package/src/lib/web-search.js +127 -61
  223. package/src/lib/workspace-trust.js +793 -0
  224. package/src/repl/agent-repl.js +124 -5
  225. package/src/repl/permission-prompt.js +10 -12
  226. package/src/runtime/agent-core.js +311 -18
  227. package/src/runtime/bootstrap.js +37 -13
  228. package/src/runtime/coding-agent-contract-shared.cjs +11 -4
  229. package/src/runtime/headless-runner.js +234 -36
  230. package/src/runtime/headless-stream.js +181 -6
  231. package/src/runtime/mcp-config.js +298 -8
  232. package/src/runtime/policies/agent-policy.js +8 -0
  233. package/src/runtime/status-diagnostics-lite.js +9 -1
  234. package/src/assets/web-panel/assets/MarkdownRenderer-CFyt8iUd.js +0 -1
  235. package/src/assets/web-panel/assets/SpeechSettings-BHUI7cox.js +0 -1
  236. package/src/assets/web-panel/assets/devWarning-DorRZcI9.js +0 -1
  237. package/src/assets/web-panel/assets/index-BETiL0a3.js +0 -1
  238. package/src/assets/web-panel/assets/index-BhAVHuW8.js +0 -1
@@ -5,7 +5,7 @@
5
5
  "a2a": "Usage: chainlesschain a2a [options] [command]\n\nA2A Protocol — agent-to-agent communication\n\nOptions:\n -h, --help display help for command\n\nCommands:\n register [options] <name> Register an agent card\n discover [options] Discover agents by capability or skill\n submit [options] <agent-id> <input> Submit a task to an agent\n status [options] <task-id> Get task status\n complete <task-id> <output> Mark a task as completed\n fail <task-id> <error> Mark a task as failed\n peers [options] List all registered agents\n cards [options] List all agent cards with details\n negotiate [options] <agent-id> <capabilities> Check if an agent supports required capabilities\n task-statuses [options] List V2 task statuses (Phase 81)\n card-statuses [options] List V2 card statuses (Phase 81)\n subscription-types [options] List V2 subscription types (Phase 81)\n negotiation-results [options] List V2 negotiation outcomes (Phase 81)\n validate-card [options] <name> Validate an agent card against the A2A schema\n set-card-status [options] <cardId> <status> Transition a card between active/inactive/expired\n card-status [options] <cardId> Show a card's V2 status\n send-task-v2 [options] <agentId> <input> Submit a V2 task (in-memory, with optional timeout)\n start-working [options] <taskId> Transition a V2 task to working\n request-input [options] <taskId> <prompt> Request user input while a V2 task is working\n provide-input [options] <taskId> <input> Provide input for an input-required V2 task\n complete-task-v2 [options] <taskId> [output] Complete a V2 task (from working only)\n fail-task-v2 [options] <taskId> [error] Fail a V2 task with an error message\n cancel-task [options] <taskId> [reason] Cancel a non-terminal V2 task\n check-timeout [options] <taskId> Check V2 task timeout (auto-fails if past deadline)\n task-v2 [options] <taskId> Show a V2 task snapshot\n tasks-v2 [options] List V2 tasks\n negotiate-v2 [options] <cardJson> Phase 81 capability negotiation against an agent card\n stats-v2 [options] Aggregate V2 stats (tasks + cards + subscriptions)\n enums-v2 Show V2 governance enums\n register-agent-v2 [options] Register an a2a agent profile (pending)\n activate-agent-v2 <id> Activate agent\n suspend-agent-v2 <id> Suspend agent\n retire-agent-v2 <id> Retire agent (terminal)\n touch-agent-v2 <id> Refresh lastTouchedAt\n get-agent-v2 <id> Get agent\n list-agents-v2 List agents\n create-message-v2 [options] Create an a2a message (queued)\n start-message-v2 <id> Transition message to sending\n deliver-message-v2 <id> Transition message to delivered\n fail-message-v2 [options] <id> Fail message\n cancel-message-v2 [options] <id> Cancel message\n get-message-v2 <id> Get message\n list-messages-v2 List messages\n set-max-active-agents-v2 <n> Set per-owner active cap\n set-max-pending-messages-v2 <n> Set per-agent pending cap\n set-agent-idle-ms-v2 <n> Set idle threshold\n set-message-stuck-ms-v2 <n> Set stuck threshold\n auto-suspend-idle-agents-v2 Auto-suspend idle agents\n auto-fail-stuck-messages-v2 Auto-fail stuck sending messages\n gov-stats-v2 V2 governance aggregate stats\n help [command] display help for command\n",
6
6
  "activitypub": "Usage: chainlesschain activitypub|ap [options] [command]\n\nActivityPub C2S bridge — actors, outbox/inbox, Follow/Create/Like/Announce\n\nOptions:\n -h, --help display help for command\n\nCommands:\n actor Manage local and remote ActivityPub actors\n publish [options] <content> Publish a Create(Note) activity to the actor's outbox\n follow [options] <target> Publish a Follow activity (target: username or actor URL)\n accept [options] <follow-activity-id> Accept a pending Follow request\n unfollow [options] <target> Publish an Undo(Follow) activity\n like [options] <object-id> Publish a Like activity for an object URL\n announce [options] <object-id> Publish an Announce (boost) activity for an object URL\n outbox [options] <username> List an actor's outbox activities\n inbox [options] <username> List an actor's inbox activities\n deliver [options] <username> <activity-json> Simulate inbox delivery — push a JSON activity into a local actor's inbox\n followers [options] <username> List followers of an actor\n search [options] <query> Search actors and/or notes in the local Fediverse index\n following [options] <username> List who this actor is following\n enums-v2 Show V2 enums\n register-actor-v2 [options] Register an AP actor profile (pending)\n activate-actor-v2 <id> Activate actor\n suspend-actor-v2 <id> Suspend actor\n deactivate-actor-v2 <id> Deactivate actor (terminal)\n touch-actor-v2 <id> Refresh lastTouchedAt\n get-actor-v2 <id> Get actor\n list-actors-v2 List actors\n create-activity-v2 [options] Create an AP activity (queued)\n start-activity-v2 <id> Transition activity to delivering\n deliver-activity-v2 <id> Transition activity to delivered\n fail-activity-v2 [options] <id> Fail activity\n cancel-activity-v2 [options] <id> Cancel activity\n get-activity-v2 <id> Get activity\n list-activities-v2 List activities\n set-max-active-actors-v2 <n> Set per-owner active cap\n set-max-pending-activities-v2 <n> Set per-actor pending cap\n set-actor-idle-ms-v2 <n> Set idle threshold\n set-activity-stuck-ms-v2 <n> Set stuck threshold\n auto-suspend-idle-actors-v2 Auto-suspend idle actors\n auto-fail-stuck-activities-v2 Auto-fail stuck delivering activities\n gov-stats-v2 V2 governance aggregate stats\n help [command] display help for command\n",
7
7
  "agenda": "Usage: chainlesschain agenda [options] [command]\n\nFire agent-scheduled wakeups / crons / monitors (persisted by the `schedule`\ntool)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n list [options] List all scheduled entries\n run [options] Fire every entry that is due now\n cancel [options] <id> Remove a scheduled entry by id\n prune [options] Remove finished entries (fired / matched / exhausted /\n expired)\n help [command] display help for command\n",
8
- "agent": "Usage: chainlesschain agent|a [options] [task...]\n\nStart an agentic AI session (reads/writes files, runs commands)\n\nArguments:\n task Headless task 鈥?when given (or with -p /\n piped stdin), runs non-interactively\n\nOptions:\n --model <model> Model name\n --provider <provider> LLM provider (ollama, openai,\n volcengine, deepseek, ...)\n --base-url <url> API base URL\n --api-key <key> API key\n --think [level] Enable Anthropic extended thinking\n (level: think | hard | ultra; Anthropic\n models only)\n --ultrathink Maximum Anthropic extended thinking (=\n --think ultra)\n --thinking-budget <n> Thinking token budget for legacy Claude\n models (Sonnet 4.5 / Opus 4.0-4.5 /\n older); clamped below max_tokens.\n Adaptive-thinking models ignore it (they\n use --think's effort). Requires\n --think/--ultrathink.\n --image <path> Attach an image (png/jpg/jpeg/gif/webp)\n to the prompt for a vision-capable model\n (headless; repeatable)\n --vision-model <id> Model to use when an image is attached\n (default: config llm.visionModel or\n doubao-seed-2-0-lite-260215)\n --session <id> Resume a previous agent session\n -c, --continue Resume the most recent session (no id\n needed 鈥?claude --continue parity)\n --resume [id] Resume a session by id (no id 鈫?most\n recent 鈥?claude --resume parity)\n --fork-session When resuming, branch into a NEW session\n id and leave the original untouched\n (claude --fork-session parity)\n --fork-request-id <key> Stable idempotency key for\n --fork-session retries (omit for a new\n fork each invocation)\n --add-dir <dir> Extra working directory the agent may\n read/search/edit (repeatable)\n --checkpoint Auto-snapshot the work tree before each\n mutating tool (DEFAULT inside a git\n repo; cc checkpoint restore to roll\n back)\n --no-checkpoint Disable auto-checkpointing (it is on by\n default inside git repos)\n --managed-checkpoint Checkpoint bounded mutating tools with\n Process Broker; unavailable writer\n lifetimes are reported as coverage none\n --managed-checkpoint-state <dir> Durable managed-checkpoint state\n directory (must be outside the\n workspace)\n --managed-checkpoint-exclude <path> Explicit workspace path excluded from\n managed checkpoints; repeatable and\n reported as partial coverage\n --safe-mode Run bare: disable project memory,\n settings hooks, memory recall, IDE\n context, status line and update notice\n (permission rules STAY active)\n --bare Everything --safe-mode disables PLUS\n skills, plugins and MCP/IDE auto-connect\n — minimal fast surface for scripted\n calls (explicit --mcp-config still\n loads; permission rules STAY active)\n --ephemeral No session persistence: nothing is\n written to the session store (headless;\n a --resume id still replays history\n read-only)\n --capabilities Print a machine-readable capability\n manifest (JSON: protocol version, tools,\n permission modes, exit codes) and exit\n --disable-slash-commands Interactive REPL: don't dispatch '/'\n input as slash commands — it reaches the\n model verbatim (/exit and /quit stay\n live)\n --ax-screen-reader Screen-reader friendly output: no ANSI\n colors, no in-place status line repaints\n (also CC_SCREEN_READER=1)\n --worktree Run this session in a fresh git worktree\n (isolated branch; auto-removed when the\n session changes nothing)\n --no-worktree Background Git task: explicitly share\n the current work tree (intended for\n read-only tasks; writable runs are not\n isolated)\n --unattended Enable fail-closed shell action policy\n for scheduled/event-driven runs\n --unattended-allow <classes> Comma-separated action classes\n explicitly allowed for unattended shell\n runs\n --sandbox [image] Run shell commands in an ephemeral\n Docker sandbox (network disabled by\n default)\n --sandbox-mode <mode> Sandbox posture: off | workspace-write |\n strict (explicit isolation modes fail\n closed)\n --sandbox-network Allow network access inside --sandbox\n --otlp <file> Write the agent run's OpenTelemetry\n spans (model/tool/retry) as OTLP/JSON to\n <file>\n --otlp-content Include prompt/response CONTENT in\n --otlp spans (off by default; content is\n redacted unless this is set)\n --auto-rewake When an async `asyncRewake` hook (e.g. a\n background test) fails at turn end,\n re-engage the agent to fix it (bounded\n by --max-rewakes)\n --auto-pin Force-pin the original task (first user\n turn) through compaction (ON by default;\n disable with CC_AUTO_PIN=0 or config\n context.autoPin=false)\n --max-rewakes <n> Max auto-rewake re-drives per run\n (default 1); implies --auto-rewake\n --bg, --background Start as a detached background agent and\n return its id immediately\n --agent-id <id> Agent id for scoped memory recall\n --recall-limit <n> Top-K memories to inject into system\n prompt\n --recall-query <q> Query string for startup memory recall\n --no-recall-memory Disable startup memory recall\n --vim Start the interactive REPL in vim-mode\n line editing (toggle later with /vim; or\n CC_VIM=1)\n --no-stream Disable streamed response rendering\n --no-park-on-exit Close the session-core handle on exit\n instead of parking it\n --bundle <path> Agent bundle directory (may execute\n local MCP commands from mcp.json)\n -p, --print [prompt] Headless: run one non-interactive turn\n and exit\n --output-format <fmt> Headless output: text | json |\n stream-json (default: \"text\")\n --max-turns <n> Cap agent loop iterations (headless)\n --json-schema <file> Headless structured output: final reply\n must be JSON validating against this\n schema (invalid replies retried)\n --allowed-tools <list> Comma/space-separated tool allow-list\n (headless)\n --disallowed-tools <list> Comma/space-separated tool deny-list\n (headless)\n --permission-mode <mode> manual | auto | dontAsk | default | plan\n | acceptEdits | bypassPermissions (plan\n headless-only)\n --no-file-refs Disable @path file-reference expansion\n in the prompt (headless)\n --no-slash-macros Disable /name custom-command\n (.claude/commands) expansion in the\n prompt (headless)\n --system-prompt <text> Replace the built-in system prompt\n (literal text or @file)\n --append-system-prompt <text> Append extra guidance to the system\n prompt (literal text or @file)\n --no-project-memory Skip auto-loaded project memory (cc.md /\n CLAUDE.md / AGENTS.md hierarchy,\n .chainlesschain/rules.md,\n .claude/rules/*.md) — a lean system\n prompt for token-tight surfaces (e.g.\n IDE chat). The agent can still read\n those files with tools when it needs\n them.\n --output-style <name> Apply a named output-style persona\n (.claude/output-styles/<name>.md or a\n built-in: concise | explanatory |\n learning)\n --input-format <fmt> Headless input: text | stream-json\n (NDJSON user events on stdin,\n multi-turn) (default: \"text\")\n --trace-id <id> Correlation id stamped as `trace_id` on\n every stream-json output line (also read\n from CC_TRACE_ID). Lets an IDE/bridge\n trace one run across its own logs, the\n CLI, transcripts and diagnostics.\n Auto-generated per run when omitted.\n --fallback-model <model> Backup model(s) to try in order when the\n primary fails (transient error or\n model-not-found). Repeatable or\n comma-separated; up to 3. A\n `provider:model` entry (e.g.\n openai:gpt-4o) falls back\n cross-provider, using that provider's\n API key from its env var (skipped if\n unset — never reuses the primary key).\n Defaults to config llm.fallbackModels.\n --include-partial-messages Emit live assistant-text deltas as\n stream_event lines (requires\n --output-format stream-json)\n --goal [id] Bind a cc goal into the run (id, or omit\n the value to auto-resolve the active\n goal)\n --goal-assess After the run, ask the model to assess\n goal progress and persist it (opt-in;\n costs one extra completion; requires\n --goal)\n --goal-condition <spec> Session completion condition; re-drives\n outer turns until met. Prefix\n exit-zero:/file-exists:/contains:/regex:\n (deterministic) or model:<desc>\n (model-judged)\n --max-outer-turns <n> Max outer re-drive turns for\n --goal-condition (default 10, hard cap\n 100)\n --goal-max-tokens <n> Token budget across --goal-condition\n outer turns\n --goal-max-cost <usd> Cost budget (USD) across\n --goal-condition outer turns\n --goal-max-time <ms> Wall-clock budget (ms) across\n --goal-condition outer turns\n --mcp-config <file> Load ad-hoc MCP servers from a JSON file\n for this run (headless); their tools\n become callable (mcp__<server>__<tool>)\n --no-mcp Don't auto-connect MCP servers\n registered with `cc mcp add\n --auto-connect` (--mcp-config still\n loads)\n --ide Force-enable IDE bridge auto-connect:\n discover a running editor's MCP server\n via ~/.chainlesschain/ide/*.json\n (default: auto inside an IDE integrated\n terminal)\n --no-ide Disable IDE bridge auto-connect\n --pdh Force-enable PDH bridge auto-connect:\n discover the Android app's\n device-capability MCP server via\n ~/.chainlesschain/pdh-bridge/*.json\n (default: auto when\n CHAINLESSCHAIN_PDH_PORT is set)\n --no-pdh Disable PDH bridge auto-connect\n --jetbrains Force-enable IntelliJ IDEA built-in MCP\n (IDEA >= 2025.2) as server `idea`\n (default: auto when the ChainlessChain\n JetBrains plugin injects\n CHAINLESSCHAIN_JETBRAINS_MCP_URL)\n --no-jetbrains Disable IDEA built-in MCP auto-connect\n --interactive-approvals Stream mode: confirm-tier approvals\n become approval_request/approval\n stdin-stdout events instead of failing\n closed (chat-panel UX)\n --permission-prompt-tool <tool> Defer tool approvals to an MCP tool\n (mcp__<server>__<tool>; requires\n --mcp-config) instead of headless\n fail-closed\n --remote-control Route confirm-tier approvals to paired\n mobile/web devices — requires a relay or\n explicit LAN opt-in; headless waits\n fail-closed, interactive races the\n terminal prompt (also /remote-control)\n --remote-control-allow-lan Permit --remote-control to expose its\n authenticated WS endpoint on a trusted\n LAN\n --channels <list> Inbound channels for the interactive\n session (webhook[:port],telegram) —\n external events enter as user turns;\n webhook needs its bearer token, telegram\n needs channels.telegram.allowFrom\n --settings <file> Merge an extra\n .claude/settings.json-shaped file for\n this run: permission rules\n (allow/ask/deny) + native config\n overrides (model, env)\n --max-budget-usd <amount> Hard USD spend cap: stop the run before\n the next paid LLM call once the\n estimated cost reaches this (headless;\n uses the cc cost price table)\n --session-budget Enable the durable session-wide budget\n authority (headless; requires\n --session/--resume/--continue)\n --session-max-concurrent <n> Durable session cap for concurrent child\n work\n --session-max-spawns <n> Durable session cap for total child-work\n admissions\n --session-max-depth <n> Durable session cap for child-agent\n nesting depth\n --session-max-turns <n> Durable session cap for model turns\n across resumes\n --session-max-tokens <n> Durable session cap for\n provider-reported tokens across resumes\n --session-max-cost-usd <amount> Durable session cost cap across resumes\n (requires priced provider usage)\n --session-max-wall-ms <n> Durable session cap for cumulative\n active wall time\n --session-max-tool-ms <n> Durable session cap for aggregate tool\n execution time\n --observability-workspace <id> Persist a workspace scope on new session\n authority for causal reports\n --observability-team <id> Persist a team scope on new session\n authority for causal reports\n --observability-policy <id> Persist a policy scope on new session\n authority for causal reports\n --strict-mcp-config Use ONLY --mcp-config servers; ignore\n registered (cc mcp add) and IDE-bridge\n MCP for a reproducible tool surface\n --project-mcp Opt in to loading a project-scoped\n .mcp.json (default off; a checked-in\n .mcp.json can spawn commands)\n --replay-user-messages Stream-input mode: echo each accepted\n stdin user message back as a `user`\n event (transcript/correlation)\n --allow-dangerous-bypass Bypass all permission prompts in\n headless mode (DANGEROUS: auto-approves\n all tool calls) (default: false)\n -y, --yolo Alias for --allow-dangerous-bypass\n (default: false)\n --dangerously-skip-permissions Alias for --allow-dangerous-bypass\n (default: false)\n -h, --help display help for command\n",
8
+ "agent": "Usage: chainlesschain agent|a [options] [task...]\n\nStart an agentic AI session (reads/writes files, runs commands)\n\nArguments:\n task Headless task 鈥?when given (or with -p /\n piped stdin), runs non-interactively\n\nOptions:\n --model <model> Model name\n --provider <provider> LLM provider (ollama, openai,\n volcengine, deepseek, ...)\n --base-url <url> API base URL\n --api-key <key> API key\n --think [level] Enable Anthropic extended thinking\n (level: think | hard | ultra; Anthropic\n models only)\n --ultrathink Maximum Anthropic extended thinking (=\n --think ultra)\n --thinking-budget <n> Thinking token budget for legacy Claude\n models (Sonnet 4.5 / Opus 4.0-4.5 /\n older); clamped below max_tokens.\n Adaptive-thinking models ignore it (they\n use --think's effort). Requires\n --think/--ultrathink.\n --image <path> Attach an image (png/jpg/jpeg/gif/webp)\n to the prompt for a vision-capable model\n (headless; repeatable)\n --vision-model <id> Model to use when an image is attached\n (default: config llm.visionModel or\n doubao-seed-2-0-lite-260215)\n --session <id> Resume a previous agent session\n -c, --continue Resume the most recent session (no id\n needed 鈥?claude --continue parity)\n --resume [id] Resume a session by id (no id 鈫?most\n recent 鈥?claude --resume parity)\n --fork-session When resuming, branch into a NEW session\n id and leave the original untouched\n (claude --fork-session parity)\n --fork-request-id <key> Stable idempotency key for\n --fork-session retries (omit for a new\n fork each invocation)\n --add-dir <dir> Extra working directory the agent may\n read/search/edit (repeatable)\n --checkpoint Auto-snapshot the work tree before each\n mutating tool (DEFAULT inside a git\n repo; cc checkpoint restore to roll\n back)\n --no-checkpoint Disable auto-checkpointing (it is on by\n default inside git repos)\n --managed-checkpoint Checkpoint bounded mutating tools with\n Process Broker; unavailable writer\n lifetimes are reported as coverage none\n --managed-checkpoint-state <dir> Durable managed-checkpoint state\n directory (must be outside the\n workspace)\n --managed-checkpoint-exclude <path> Explicit workspace path excluded from\n managed checkpoints; repeatable and\n reported as partial coverage\n --safe-mode Run bare: disable project memory,\n settings hooks, memory recall, IDE\n context, status line and update notice\n (permission rules STAY active)\n --bare Everything --safe-mode disables PLUS\n skills, plugins and MCP/IDE auto-connect\n — minimal fast surface for scripted\n calls (explicit --mcp-config still\n loads; permission rules STAY active)\n --ephemeral No session persistence: nothing is\n written to the session store (headless;\n a --resume id still replays history\n read-only)\n --capabilities Print a machine-readable capability\n manifest (JSON: protocol version, tools,\n permission modes, exit codes) and exit\n --disable-slash-commands Interactive REPL: don't dispatch '/'\n input as slash commands — it reaches the\n model verbatim (/exit and /quit stay\n live)\n --ax-screen-reader Screen-reader friendly output: no ANSI\n colors, no in-place status line repaints\n (also CC_SCREEN_READER=1)\n --worktree Run this session in a fresh git worktree\n (isolated branch; auto-removed when the\n session changes nothing)\n --no-worktree Background Git task: explicitly share\n the current work tree (intended for\n read-only tasks; writable runs are not\n isolated)\n --unattended Enable fail-closed shell action policy\n for scheduled/event-driven runs\n --unattended-allow <classes> Comma-separated action classes\n explicitly allowed for unattended shell\n runs\n --sandbox [image] Run shell commands in an ephemeral\n Docker sandbox (network disabled by\n default)\n --sandbox-mode <mode> Sandbox posture: off | workspace-write |\n strict (explicit isolation modes fail\n closed)\n --sandbox-network Allow network access inside --sandbox\n --otlp <file> Write the agent run's OpenTelemetry\n spans (model/tool/retry) as OTLP/JSON to\n <file>\n --otlp-content Include prompt/response CONTENT in\n --otlp spans (off by default; content is\n redacted unless this is set)\n --auto-rewake When an async `asyncRewake` hook (e.g. a\n background test) fails at turn end,\n re-engage the agent to fix it (bounded\n by --max-rewakes)\n --auto-pin Force-pin the original task (first user\n turn) through compaction (ON by default;\n disable with CC_AUTO_PIN=0 or config\n context.autoPin=false)\n --max-rewakes <n> Max auto-rewake re-drives per run\n (default 1); implies --auto-rewake\n --bg, --background Start as a detached background agent and\n return its id immediately\n --agent-id <id> Agent id for scoped memory recall\n --recall-limit <n> Top-K memories to inject into system\n prompt\n --recall-query <q> Query string for startup memory recall\n --no-recall-memory Disable startup memory recall\n --vim Start the interactive REPL in vim-mode\n line editing (toggle later with /vim; or\n CC_VIM=1)\n --no-stream Disable streamed response rendering\n --no-park-on-exit Close the session-core handle on exit\n instead of parking it\n --bundle <path> Agent bundle directory (may execute\n local MCP commands from mcp.json)\n -p, --print [prompt] Headless: run one non-interactive turn\n and exit\n --output-format <fmt> Headless output: text | json |\n stream-json (default: \"text\")\n --max-turns <n> Cap agent loop iterations (headless)\n --json-schema <file> Headless structured output: final reply\n must be JSON validating against this\n schema (invalid replies retried)\n --allowed-tools <list> Comma/space-separated tool allow-list\n (headless)\n --disallowed-tools <list> Comma/space-separated tool deny-list\n (headless)\n --permission-mode <mode> manual | auto | dontAsk | default | plan\n | acceptEdits | bypassPermissions (plan\n headless-only)\n --no-file-refs Disable @path file-reference expansion\n in the prompt (headless)\n --no-slash-macros Disable /name custom-command\n (.claude/commands) expansion in the\n prompt (headless)\n --system-prompt <text> Replace the built-in system prompt\n (literal text or @file)\n --append-system-prompt <text> Append extra guidance to the system\n prompt (literal text or @file)\n --no-project-memory Skip auto-loaded project memory (cc.md /\n CLAUDE.md / AGENTS.md hierarchy,\n .chainlesschain/rules.md,\n .claude/rules/*.md) — a lean system\n prompt for token-tight surfaces (e.g.\n IDE chat). The agent can still read\n those files with tools when it needs\n them.\n --output-style <name> Apply a named output-style persona\n (.claude/output-styles/<name>.md or a\n built-in: concise | explanatory |\n learning)\n --input-format <fmt> Headless input: text | stream-json\n (NDJSON user events on stdin,\n multi-turn) (default: \"text\")\n --trace-id <id> Correlation id stamped as `trace_id` on\n every stream-json output line (also read\n from CC_TRACE_ID). Lets an IDE/bridge\n trace one run across its own logs, the\n CLI, transcripts and diagnostics.\n Auto-generated per run when omitted.\n --fallback-model <model> Backup model(s) to try in order when the\n primary fails (transient error or\n model-not-found). Repeatable or\n comma-separated; up to 3. A\n `provider:model` entry (e.g.\n openai:gpt-4o) falls back\n cross-provider, using that provider's\n API key from its env var (skipped if\n unset — never reuses the primary key).\n Defaults to config llm.fallbackModels.\n --include-partial-messages Emit live assistant-text deltas as\n stream_event lines (requires\n --output-format stream-json)\n --include-hook-events Emit redacted hook and subagent\n lifecycle events (requires\n --output-format stream-json)\n --goal [id] Bind a cc goal into the run (id, or omit\n the value to auto-resolve the active\n goal)\n --goal-assess After the run, ask the model to assess\n goal progress and persist it (opt-in;\n costs one extra completion; requires\n --goal)\n --goal-condition <spec> Session completion condition; re-drives\n outer turns until met. Prefix\n exit-zero:/file-exists:/contains:/regex:\n (deterministic) or model:<desc>\n (model-judged)\n --max-outer-turns <n> Max outer re-drive turns for\n --goal-condition (default 10, hard cap\n 100)\n --goal-max-tokens <n> Token budget across --goal-condition\n outer turns\n --goal-max-cost <usd> Cost budget (USD) across\n --goal-condition outer turns\n --goal-max-time <ms> Wall-clock budget (ms) across\n --goal-condition outer turns\n --mcp-config <file> Load ad-hoc MCP servers from a JSON file\n for this run (headless); their tools\n become callable (mcp__<server>__<tool>)\n --no-mcp Don't auto-connect MCP servers\n registered with `cc mcp add\n --auto-connect` (--mcp-config still\n loads)\n --ide Force-enable IDE bridge auto-connect:\n discover a running editor's MCP server\n via ~/.chainlesschain/ide/*.json\n (default: auto inside an IDE integrated\n terminal)\n --no-ide Disable IDE bridge auto-connect\n --pdh Force-enable PDH bridge auto-connect:\n discover the Android app's\n device-capability MCP server via\n ~/.chainlesschain/pdh-bridge/*.json\n (default: auto when\n CHAINLESSCHAIN_PDH_PORT is set)\n --no-pdh Disable PDH bridge auto-connect\n --jetbrains Force-enable IntelliJ IDEA built-in MCP\n (IDEA >= 2025.2) as server `idea`\n (default: auto when the ChainlessChain\n JetBrains plugin injects\n CHAINLESSCHAIN_JETBRAINS_MCP_URL)\n --no-jetbrains Disable IDEA built-in MCP auto-connect\n --interactive-approvals Stream mode: confirm-tier approvals\n become approval_request/approval\n stdin-stdout events instead of failing\n closed (chat-panel UX)\n --permission-prompt-tool <tool> Defer tool approvals to an MCP tool\n (mcp__<server>__<tool>; requires\n --mcp-config) instead of headless\n fail-closed\n --remote-control Route confirm-tier approvals to paired\n mobile/web devices — requires a relay or\n explicit LAN opt-in; headless waits\n fail-closed, interactive races the\n terminal prompt (also /remote-control)\n --remote-control-allow-lan Permit --remote-control to expose its\n authenticated WS endpoint on a trusted\n LAN\n --channels <list> Inbound channels for the interactive\n session (webhook[:port],telegram) —\n external events enter as user turns;\n webhook needs its bearer token, telegram\n needs channels.telegram.allowFrom\n --settings <file> Merge an extra\n .claude/settings.json-shaped file for\n this run: permission rules\n (allow/ask/deny) + native config\n overrides (model, env)\n --max-budget-usd <amount> Hard USD spend cap: stop the run before\n the next paid LLM call once the\n estimated cost reaches this (headless;\n uses the cc cost price table)\n --session-budget Enable the durable session-wide budget\n authority (headless; requires\n --session/--resume/--continue)\n --session-max-concurrent <n> Durable session cap for concurrent child\n work\n --session-max-spawns <n> Durable session cap for total child-work\n admissions\n --session-max-depth <n> Durable session cap for child-agent\n nesting depth\n --session-max-turns <n> Durable session cap for model turns\n across resumes\n --session-max-tokens <n> Durable session cap for\n provider-reported tokens across resumes\n --session-max-cost-usd <amount> Durable session cost cap across resumes\n (requires priced provider usage)\n --session-max-wall-ms <n> Durable session cap for cumulative\n active wall time\n --session-max-tool-ms <n> Durable session cap for aggregate tool\n execution time\n --observability-workspace <id> Persist a workspace scope on new session\n authority for causal reports\n --observability-team <id> Persist a team scope on new session\n authority for causal reports\n --observability-policy <id> Persist a policy scope on new session\n authority for causal reports\n --strict-mcp-config Use ONLY --mcp-config servers; ignore\n registered (cc mcp add) and IDE-bridge\n MCP for a reproducible tool surface\n --project-mcp Opt in to loading a project-scoped\n .mcp.json (default off; a checked-in\n .mcp.json can spawn commands)\n --replay-user-messages Stream-input mode: echo each accepted\n stdin user message back as a `user`\n event (transcript/correlation)\n --allow-dangerous-bypass Bypass all permission prompts in\n headless mode (DANGEROUS: auto-approves\n all tool calls) (default: false)\n -y, --yolo Alias for --allow-dangerous-bypass\n (default: false)\n --dangerously-skip-permissions Alias for --allow-dangerous-bypass\n (default: false)\n -h, --help display help for command\n",
9
9
  "agent-network": "Usage: chainlesschain agent-network|anet [options] [command]\n\nDecentralized Agent Network (Phase 24) — DID / registry / credentials / task\nrouting\n\nOptions:\n -h, --help display help for command\n\nCommands:\n config [options] Show network constants & reputation weights\n dimensions [options] List reputation dimensions\n task-statuses [options] List task lifecycle statuses\n did-create [options] Create an Agent DID (Ed25519 + DID document)\n did-resolve [options] <did> Resolve DID → DID document\n dids [options] List Agent DIDs\n did-deactivate [options] <did> Deactivate a DID (also forces registry offline)\n sign [options] <did> <data> Sign data with agent's Ed25519 key\n verify [options] <did> <data> <signature> Verify a signature from an agent\n register [options] <did> <orgId> Register an Agent in the federated registry\n unregister [options] <did> Remove an Agent from the registry\n heartbeat [options] <did> Bump last_heartbeat (forces online)\n discover [options] Discover agents (capability / org / status)\n sweep [options] Mark stale online agents offline\n peer-add [options] <peerId> Add/update a Kademlia peer (k-bucket auto-computed)\n peer-remove [options] <peerId> Remove a peer\n peers [options] List peers (optionally by k-bucket)\n auth-start [options] <did> Issue an auth challenge for a DID\n auth-complete [options] <sessionId> <signature> Complete auth with signature over challenge\n auth-validate [options] <token> Validate a session token (returns agentDid or exits 1)\n auth-sessions [options] List auth sessions\n credential-issue [options] <issuerDid> <subjectDid> Issue a VC with HMAC/Ed25519 proof\n credential-verify [options] <id> Verify a VC (signature + expiry + revocation)\n credential-revoke [options] <id> Revoke a credential\n credential-show [options] <id> Show a credential\n credentials [options] List credentials (filter by subject/issuer/status/type)\n task-route [options] <sourceOrg> <taskType> Route task → pick best-rep agent matching capability\n task-show [options] <taskId> Show a task\n task-status [options] <taskId> <status> Update task status (terminal states set completedAt)\n task-cancel [options] <taskId> Cancel a task (sets CANCELLED + reason)\n tasks [options] List tasks\n rep-update [options] <did> <dimension> <score> Record a reputation observation\n rep-show [options] <did> Show reputation summary (weighted total + per-dim avg)\n rep-history [options] <did> Show reputation history (newest first)\n rep-top [options] Top agents by dimension (or total)\n stats [options] Network-level statistics\n agent-maturities-v2 List V2 agent maturity states\n task-lifecycles-v2 List V2 task lifecycle states\n stats-v2 V2 agent-network stats\n get-max-active-agents-v2 Get max active agents per network (V2)\n set-max-active-agents-v2 <n> Set max active agents per network (V2)\n get-max-pending-tasks-v2 Get max pending tasks per agent (V2)\n set-max-pending-tasks-v2 <n> Set max pending tasks per agent (V2)\n get-agent-idle-ms-v2 Get agent idle threshold (V2)\n set-agent-idle-ms-v2 <ms> Set agent idle threshold (V2)\n get-task-stuck-ms-v2 Get task stuck threshold (V2)\n set-task-stuck-ms-v2 <ms> Set task stuck threshold (V2)\n active-agent-count-v2 <networkId> Active agent count for network (V2)\n pending-task-count-v2 <agentId> Pending task count for agent (V2)\n register-agent-v2 [options] <id> Register a V2 agent\n get-agent-v2 <id> Get a V2 agent\n list-agents-v2 [options] List V2 agents\n set-agent-status-v2 <id> <next> Set V2 agent status\n activate-agent-v2 <id> Activate a V2 agent\n suspend-agent-v2 <id> Suspend a V2 agent\n revoke-agent-v2 <id> Revoke a V2 agent\n touch-agent-v2 <id> Touch a V2 agent\n create-task-v2 [options] <id> Create a V2 task\n get-task-v2 <id> Get a V2 task\n list-tasks-v2 [options] List V2 tasks\n set-task-status-v2 <id> <next> Set V2 task status\n start-task-v2 <id> Start a V2 task\n complete-task-v2 <id> Complete a V2 task\n fail-task-v2 <id> Fail a V2 task\n cancel-task-v2 <id> Cancel a V2 task\n auto-suspend-idle-agents-v2 Auto-suspend idle V2 agents\n auto-fail-stuck-tasks-v2 Auto-fail stuck V2 tasks\n help [command] display help for command\n",
10
10
  "agents": "Usage: chainlesschain agents [options] [command]\n\nUser-defined subagents (.claude/agents/*.md)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n background|bg [options] List background agent sessions\n logs [options] <id> Print recent output from a background agent\n view [options] <id> Show a detailed background agent view\n stop [options] <id> Stop a running background agent\n rename [options] <id> <title...> Rename a background agent session\n list|ls [options] List discovered subagents (project +\n personal)\n show [options] <name> Show an agent's metadata + system prompt\n run [options] <name> [task...] Run a task headlessly as the named subagent\n new [options] <name> Scaffold a new agent file (project-native\n .chainlesschain/agents/)\n help [command] display help for command\n",
11
11
  "android": "Usage: chainlesschain android [options] [command]\n\nAndroid-native bridge: ContentResolver / SAF / Accessibility / Shizuku / root\n(Plan A A7)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n caps [options] Probe what bridge capabilities are available on this\n device\n contacts ContentResolver: contacts\n sms ContentResolver: SMS\n calls ContentResolver: call log\n app PackageManager: app inventory + Intent\n fs SAF / sandbox filesystem\n a11y Accessibility Service\n shizuku Shizuku ADB-like privileges\n root Magisk root su\n perms [options] <name> Check (and request) a runtime permission\n help [command] display help for command\n",
@@ -63,7 +63,7 @@
63
63
  "federation": "Usage: chainlesschain federation [options] [command]\n\nFederation hardening system (Phase 58)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n circuit-states [options] List circuit breaker states\n health-statuses [options] List health statuses\n health-metrics [options] List health check metric types\n register [options] <node-id> Register a federation node with circuit breaker\n remove [options] <node-id> Remove a federation node\n breaker-show [options] <node-id> Show circuit breaker state for a node\n breakers [options] List circuit breakers\n failure [options] <node-id> Record a failure for a node (may trip breaker)\n success [options] <node-id> Record a success for a node (may close breaker)\n half-open [options] <node-id> Try transitioning an open breaker to half-open\n reset [options] <node-id> Reset circuit breaker to closed state\n check [options] <node-id> Record a health check result\n check-show [options] <check-id> Show health check details\n checks [options] List health checks\n node-health [options] <node-id> Get aggregated health status for a node\n pool-init [options] <node-id> Initialize a connection pool for a node\n pool-acquire [options] <node-id> Acquire a connection from pool\n pool-release [options] <node-id> Release a connection back to pool\n pool-stats [options] <node-id> Show connection pool stats\n pools [options] List all connection pools\n pool-destroy [options] <node-id> Destroy a connection pool\n stats [options] Federation hardening statistics\n node-statuses-v2 [options] List V2 node lifecycle statuses\n default-failure-threshold [options] Default circuit-breaker failure threshold\n failure-threshold [options] Current failure threshold\n set-failure-threshold [options] <n> Set failure threshold (positive integer)\n default-half-open-cooldown-ms [options] Default half-open cooldown in ms\n half-open-cooldown-ms [options] Current half-open cooldown in ms\n set-half-open-cooldown-ms [options] <ms> Set half-open cooldown (positive integer ms)\n default-unhealthy-threshold [options] Default consecutive-unhealthy isolation threshold\n unhealthy-threshold [options] Current consecutive-unhealthy threshold\n set-unhealthy-threshold [options] <n> Set consecutive-unhealthy threshold\n default-max-active-nodes [options] Default max active nodes cap\n max-active-nodes [options] Current max active nodes cap\n active-node-count [options] Number of currently ACTIVE nodes\n set-max-active-nodes [options] <n> Set max active nodes cap\n register-v2 [options] <node-id> Register a node with V2 lifecycle tracking\n node-status-v2 [options] <node-id> Get V2 node status\n set-node-status-v2 [options] <node-id> <status> Transition node to a new status\n record-health-v2 [options] <node-id> Record a V2 health check (throws on invalid input)\n trip-circuit [options] <node-id> Force-trip a circuit breaker (closed/half_open → open)\n auto-isolate-unhealthy [options] Bulk-isolate ACTIVE nodes with N consecutive UNHEALTHY checks\n stats-v2 [options] V2 federation hardening statistics\n help [command] display help for command\n",
64
64
  "fflag": "Usage: chainlesschain fflag [options] [command]\n\nFeature Flags V2 governance (in-memory, CLI v0.143.0)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2 Show V2 maturity + lifecycle enums\n register-profile-v2 [options] Register a feature flag profile (pending)\n activate-profile-v2 <id> Transition profile to active\n pause-profile-v2 <id> Transition profile to paused\n archive-profile-v2 <id> Transition profile to archived (terminal)\n touch-profile-v2 <id> Refresh lastTouchedAt\n get-profile-v2 <id> Get a profile by id\n list-profiles-v2 List all profiles\n create-eval-v2 [options] Create an eval (queued)\n evaluating-eval-v2 <id> Mark eval as evaluating\n evaluate-eval-v2 <id> Mark eval as evaluated (terminal)\n fail-eval-v2 [options] <id> Mark eval as failed (terminal)\n cancel-eval-v2 [options] <id> Mark eval as cancelled (terminal)\n get-eval-v2 <id> Get an eval by id\n list-evals-v2 List all evals\n config-v2 Show V2 config (caps + idle/stuck windows)\n set-max-active-profiles-v2 <n> Set max active profiles per owner\n set-max-pending-evals-v2 <n> Set max pending evals per profile\n set-profile-idle-ms-v2 <ms> Set profile idle window\n set-eval-stuck-ms-v2 <ms> Set eval stuck window\n auto-pause-idle-v2 Auto-pause idle active profiles\n auto-fail-stuck-v2 Auto-fail stuck evaluating evals\n gov-stats-v2 Show V2 governance stats\n help [command] display help for command\n",
65
65
  "fusion": "Usage: chainlesschain fusion [options] [command]\n\nProtocol fusion & AI social (Phase 72-73)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n protocols [options] List supported protocols\n quality-levels [options] List quality levels\n send [options] Send cross-protocol message\n msg-show [options] <id> Show message details\n messages [options] List unified messages\n map-identity [options] Create identity mapping\n identity [options] <did> Look up identity mapping by DID\n identities [options] List identity mappings\n verify-identity [options] <id> Verify an identity mapping\n assess [options] <content> Assess content quality\n quality-show [options] <id> Show quality score details\n quality-scores [options] List quality scores\n quality-report [options] Content quality report\n translate [options] <text> Translate text (simulated)\n detect-lang [options] <text> Detect language of text\n translation-stats [options] Translation cache statistics\n stats [options] Protocol fusion & AI social statistics\n bridge-maturities-v2 List BRIDGE_MATURITY_V2 enum values\n translation-runs-v2 List TRANSLATION_RUN_V2 enum values\n max-active-bridges-per-operator Get current max-active-bridges-per-operator cap\n set-max-active-bridges-per-operator <n> Set max-active-bridges-per-operator cap\n max-running-translations-per-bridge Get current max-running-translations-per-bridge cap\n set-max-running-translations-per-bridge <n> Set max-running-translations-per-bridge cap\n bridge-idle-ms Get current bridge-idle-ms threshold\n set-bridge-idle-ms <n> Set bridge-idle-ms threshold\n translation-stuck-ms Get current translation-stuck-ms threshold\n set-translation-stuck-ms <n> Set translation-stuck-ms threshold\n active-bridge-count [options] Count non-retired, non-provisional bridges (optionally by operator)\n running-translation-count [options] Count RUNNING translations (optionally by bridge)\n register-bridge-v2 [options] <bridge-id> Register V2 bridge (provisional by default)\n bridge-v2 <bridge-id> Show V2 bridge state\n list-bridges-v2 [options] List V2 bridges\n set-bridge-maturity-v2 [options] <bridge-id> <status> Transition V2 bridge maturity\n activate-bridge [options] <bridge-id> Shortcut for activate transition\n degrade-bridge [options] <bridge-id> Shortcut for degrade transition\n deprecate-bridge [options] <bridge-id> Shortcut for deprecate transition\n retire-bridge [options] <bridge-id> Shortcut for retire transition\n touch-bridge-usage <bridge-id> Mark V2 bridge as used now (for idle auto-retire)\n enqueue-translation-v2 [options] <translation-id> Enqueue a V2 translation run\n translation-v2 <translation-id> Show V2 translation state\n list-translations-v2 [options] List V2 translations\n set-translation-status-v2 [options] <translation-id> <status> Transition V2 translation status\n start-translation [options] <translation-id> Shortcut for start transition\n succeed-translation [options] <translation-id> Shortcut for succeed transition\n fail-translation [options] <translation-id> Shortcut for fail transition\n cancel-translation [options] <translation-id> Shortcut for cancel transition\n auto-retire-idle-bridges Bulk-retire ACTIVE/DEGRADED/DEPRECATED bridges whose lastUsedAt is older than bridgeIdleMs\n auto-fail-stuck-running-translations Bulk-fail RUNNING translations whose startedAt is older than translationStuckMs\n stats-v2 Show V2 stats with all-enum zero-initialized counters\n help [command] display help for command\n",
66
- "git": "Usage: chainlesschain git [options] [command]\n\nGit integration for knowledge base versioning\n\nOptions:\n -h, --help display help for command\n\nCommands:\n status [options] Show git status of the knowledge base\n directory\n init [options] Initialize a git repository\n auto-commit [options] Auto-commit all changes with a generated\n message\n hooks [options] Install git hooks for the knowledge base\n history-analyze [options] Analyze repository history and statistics\n enums-v2 [options] List Git V2 enums\n config-set-v2 [options] Set Git V2 caps/thresholds\n register-repo-v2 [options] <id> Register Git V2 repo\n activate-repo-v2 <id> Activate Git V2 repo\n archive-repo-v2 <id> Archive Git V2 repo\n decommission-repo-v2 <id> Decommission Git V2 repo\n touch-repo-v2 <id> Touch Git V2 repo\n get-repo-v2 [options] <id> Get Git V2 repo\n list-repos-v2 [options] List Git V2 repos\n create-commit-v2 [options] <id> Create Git V2 commit\n start-commit-v2 <id> Start Git V2 commit\n commit-commit-v2 <id> Commit Git V2 commit\n fail-commit-v2 [options] <id> Fail Git V2 commit\n cancel-commit-v2 [options] <id> Cancel Git V2 commit\n get-commit-v2 <id> Get Git V2 commit\n list-commits-v2 List Git V2 commits\n auto-archive-repos-v2 Auto-archive idle Git V2 repos\n auto-fail-commits-v2 Auto-fail stuck Git V2 commits\n gov-stats-v2 [options] Git V2 governance stats\n help [command] display help for command\n",
66
+ "git": "Usage: chainlesschain git [options] [command]\n\nGit integration for knowledge base versioning\n\nOptions:\n -h, --help display help for command\n\nCommands:\n gitlab-mr [options] <reference> Render a local GitLab MR/worktree footer (no\n network I/O)\n status [options] Show git status of the knowledge base\n directory\n init [options] Initialize a git repository\n auto-commit [options] Auto-commit all changes with a generated\n message\n hooks [options] Install git hooks for the knowledge base\n history-analyze [options] Analyze repository history and statistics\n enums-v2 [options] List Git V2 enums\n config-set-v2 [options] Set Git V2 caps/thresholds\n register-repo-v2 [options] <id> Register Git V2 repo\n activate-repo-v2 <id> Activate Git V2 repo\n archive-repo-v2 <id> Archive Git V2 repo\n decommission-repo-v2 <id> Decommission Git V2 repo\n touch-repo-v2 <id> Touch Git V2 repo\n get-repo-v2 [options] <id> Get Git V2 repo\n list-repos-v2 [options] List Git V2 repos\n create-commit-v2 [options] <id> Create Git V2 commit\n start-commit-v2 <id> Start Git V2 commit\n commit-commit-v2 <id> Commit Git V2 commit\n fail-commit-v2 [options] <id> Fail Git V2 commit\n cancel-commit-v2 [options] <id> Cancel Git V2 commit\n get-commit-v2 <id> Get Git V2 commit\n list-commits-v2 List Git V2 commits\n auto-archive-repos-v2 Auto-archive idle Git V2 repos\n auto-fail-commits-v2 Auto-fail stuck Git V2 commits\n gov-stats-v2 [options] Git V2 governance stats\n help [command] display help for command\n",
67
67
  "goal": "Usage: chainlesschain goal [options] [command]\n\nCross-session persistent goals / OKRs\n\nOptions:\n -h, --help display help for command\n\nCommands:\n set|add [options] <objective> Create a goal with an objective (and\n optional key results)\n list|ls [options] List goals (newest first)\n show [options] <id> Show a goal in full\n kr Manage key results\n progress [options] <id> Record progress: set a percentage and/or\n append a note\n link [options] <id> [sessionId] Attach a session to a goal (defaults to\n the latest session)\n unlink [options] <id> [sessionId] Detach a session from a goal\n pause [options] <id> Mark a goal paused\n resume [options] <id> Mark a goal resumed\n close [options] <id> Mark a goal closed (done)\n abandon [options] <id> Mark a goal abandoned\n rm|delete [options] <id> Delete a goal\n active [options] Show the goal that would bind to a run\n (resolution order)\n help [command] display help for command\n",
68
68
  "governance": "Usage: chainlesschain governance [options] [command]\n\nCommunity governance — proposals, voting, impact analysis, prediction\n\nOptions:\n -h, --help display help for command\n\nCommands:\n types [options] List proposal types\n statuses [options] List proposal statuses\n impact-levels [options] List impact levels\n create [options] <title> Create a governance proposal (starts as draft)\n list [options] List proposals\n show [options] <proposal-id> Show proposal details\n activate [options] <proposal-id> Activate a draft proposal for voting\n close [options] <proposal-id> Close voting — auto-resolves to passed/rejected\n expire <proposal-id> Mark a draft/active proposal as expired\n vote [options] <proposal-id> <voter-did> <yes|no|abstain> Cast a vote (replaces any prior vote by same voter)\n votes [options] <proposal-id> List votes for a proposal\n tally [options] <proposal-id> Show vote tally with quorum/threshold check\n analyze [options] <proposal-id> Run heuristic impact analysis on a proposal\n predict [options] <proposal-id> Predict voting outcome (heuristic or vote-based)\n stats [options] Governance statistics\n proposer-maturities-v2 [options] List proposer V2 maturity states\n delegation-lifecycles-v2 [options] List delegation V2 lifecycle states\n default-max-active-proposers-per-realm Default per-realm active proposer cap\n max-active-proposers-per-realm Current per-realm active proposer cap\n set-max-active-proposers-per-realm <n> Set per-realm active proposer cap\n default-max-active-delegations-per-delegator Default per-delegator active delegation cap\n max-active-delegations-per-delegator Current per-delegator active delegation cap\n set-max-active-delegations-per-delegator <n> Set per-delegator active delegation cap\n default-proposer-idle-ms Default proposer idle window (ms)\n proposer-idle-ms Current proposer idle window (ms)\n set-proposer-idle-ms <ms> Set proposer idle window (ms)\n default-pending-delegation-ms Default pending delegation window (ms)\n pending-delegation-ms Current pending delegation window (ms)\n set-pending-delegation-ms <ms> Set pending delegation window (ms)\n active-proposer-count [options] Count active V2 proposers (scope by realm)\n active-delegation-count [options] Count active V2 delegations (scope by delegator)\n register-proposer-v2 [options] <proposer-id> Register a V2 proposer\n proposer-v2 <proposer-id> Get V2 proposer record\n set-proposer-maturity-v2 [options] <proposer-id> <status> Set proposer V2 maturity status\n activate-proposer [options] <proposer-id> Activate V2 proposer\n suspend-proposer [options] <proposer-id> Suspend V2 proposer\n retire-proposer [options] <proposer-id> Retire V2 proposer (terminal)\n touch-proposer-activity <proposer-id> Touch V2 proposer lastActivityAt\n create-delegation-v2 [options] <delegation-id> Create V2 vote delegation\n delegation-v2 <delegation-id> Get V2 delegation record\n set-delegation-status-v2 [options] <delegation-id> <status> Set delegation V2 status\n activate-delegation [options] <delegation-id> Activate V2 delegation\n revoke-delegation [options] <delegation-id> Revoke V2 delegation (terminal)\n expire-delegation [options] <delegation-id> Expire V2 delegation (terminal)\n auto-retire-idle-proposers Auto-retire active/suspended proposers past idle window\n auto-expire-stale-pending-delegations Auto-expire pending delegations past window\n stats-v2 V2 governance statistics\n help [command] display help for command\n",
69
69
  "hardening": "Usage: chainlesschain hardening [options] [command]\n\nSecurity hardening — baselines, audits, regression detection\n\nOptions:\n -h, --help display help for command\n\nCommands:\n baseline Performance baseline management\n audit Security audit management\n config-check [options] <config-path> Audit a config file (presence, required keys, placeholders)\n deploy-check [options] Evaluate the 6-item production-deployment checklist\n audit-statuses-v2 [options] List V2 audit lifecycle statuses\n baseline-statuses-v2 [options] List V2 baseline lifecycle statuses\n severities-v2 [options] List V2 severity buckets\n default-max-concurrent-audits [options] Default concurrent audit cap\n max-concurrent-audits [options] Current concurrent audit cap\n set-max-concurrent-audits [options] <n> Set concurrent audit cap\n default-baseline-retention-ms [options] Default baseline retention in ms\n baseline-retention-ms [options] Current baseline retention in ms\n set-baseline-retention-ms [options] <ms> Set baseline retention in ms\n default-audit-timeout-ms [options] Default audit timeout in ms\n audit-timeout-ms [options] Current audit timeout in ms\n set-audit-timeout-ms [options] <ms> Set audit timeout in ms\n running-audit-count [options] Number of currently RUNNING audits\n register-audit-v2 [options] <name> Register a V2 audit entry (PENDING)\n start-audit [options] <audit-id> Start a PENDING audit (enforces concurrency cap)\n complete-audit [options] <audit-id> Complete a RUNNING audit\n set-audit-status-v2 [options] <audit-id> <status> Transition audit to a new status\n audit-status-v2 [options] <audit-id> Get V2 audit status\n auto-timeout-audits [options] Bulk-fail RUNNING audits past auditTimeoutMs\n create-baseline-v2 [options] <name> Create a V2 baseline (DRAFT)\n activate-baseline [options] <baseline-id> Activate a DRAFT baseline (supersedes previous ACTIVE)\n set-baseline-status-v2 [options] <baseline-id> <status> Transition baseline to a new status\n baseline-status-v2 [options] <baseline-id> Get V2 baseline status\n auto-archive-stale-baselines [options] Bulk-archive SUPERSEDED baselines past retention\n stats-v2 [options] V2 hardening statistics\n help [command] display help for command\n",
@@ -140,7 +140,7 @@
140
140
  "seshsearch": "Usage: chainlesschain seshsearch [options] [command]\n\nSession Search V2 governance\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n config-v2\n set-max-active-v2 <n>\n set-max-pending-v2 <n>\n set-idle-ms-v2 <n>\n set-stuck-ms-v2 <n>\n register-profile-v2 [options] <id> <owner>\n activate-profile-v2 <id>\n stale-profile-v2 <id>\n archive-profile-v2 <id>\n touch-profile-v2 <id>\n get-profile-v2 <id>\n list-profiles-v2\n create-query-v2 [options] <id> <profileId>\n searching-query-v2 <id>\n complete-query-v2 <id>\n fail-query-v2 <id> [reason]\n cancel-query-v2 <id> [reason]\n get-query-v2 <id>\n list-queries-v2\n auto-stale-idle-v2\n auto-fail-stuck-v2\n gov-stats-v2\n reset-state-v2\n help [command] display help for command\n",
141
141
  "seshtail": "Usage: chainlesschain seshtail [options] [command]\n\nSession Tail V2 governance\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n config-v2\n set-max-active-v2 <n>\n set-max-pending-v2 <n>\n set-idle-ms-v2 <n>\n set-stuck-ms-v2 <n>\n register-sub-v2 [options] <id> <owner>\n activate-sub-v2 <id>\n pause-sub-v2 <id>\n close-sub-v2 <id>\n touch-sub-v2 <id>\n get-sub-v2 <id>\n list-subs-v2\n create-event-v2 [options] <id> <subId>\n tailing-event-v2 <id>\n complete-event-v2 <id>\n fail-event-v2 <id> [reason]\n cancel-event-v2 <id> [reason]\n get-event-v2 <id>\n list-events-v2\n auto-pause-idle-v2\n auto-fail-stuck-v2\n gov-stats-v2\n reset-state-v2\n help [command] display help for command\n",
142
142
  "seshu": "Usage: chainlesschain seshu [options] [command]\n\nSession Usage V2 governance\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n config-v2\n set-max-active-v2 <n>\n set-max-pending-v2 <n>\n set-idle-ms-v2 <n>\n set-stuck-ms-v2 <n>\n register-budget-v2 [options] <id> <owner>\n activate-budget-v2 <id>\n exhaust-budget-v2 <id>\n archive-budget-v2 <id>\n touch-budget-v2 <id>\n get-budget-v2 <id>\n list-budgets-v2\n create-record-v2 [options] <id> <budgetId>\n recording-record-v2 <id>\n record-record-v2 <id>\n reject-record-v2 <id> [reason]\n cancel-record-v2 <id> [reason]\n get-record-v2 <id>\n list-records-v2\n auto-exhaust-idle-v2\n auto-reject-stuck-v2\n gov-stats-v2\n reset-state-v2\n help [command] display help for command\n",
143
- "session": "Usage: chainlesschain session [options] [command]\n\nConversation session management\n\nOptions:\n -h, --help display help for command\n\nCommands:\n mcp-recovery Inspect or adjudicate verified MCP outcome-unknown calls\n location Inspect verified execution location, capabilities, and handoff safety\n budget Inspect or adjudicate a durable session budget authority\n message Durable cross-session inbox, addressing, policy and receipts\n list [options] List saved sessions\n projection [options] Emit the canonical versioned session projection for IDEs\n show [options] <id> Show a session's messages\n pr-status [options] [id] PR/CI monitor + controlled auto-merge decision for a session's linked PR\n resume [options] [id] Resume a session in chat mode (id optional — interactive picker, or most recent when piped)\n export [options] <id> Export a session as Markdown (canonical JSONL transcript, then legacy DB fallback)\n search [options] <query> Full-text search across agent session transcripts (JSONL --resume store)\n delete [options] <id> Delete a session\n rename [options] <id> <title...> Rename a headless (JSONL) session — shows up in session list\n prune [options] Delete JSONL sessions whose last activity is older than a cutoff (newest N always kept)\n migrate [options] [source] Migrate legacy JSON session files to JSONL\n validate [options] [id] Validate JSONL session files\n verify [options] [id] Verify transcript hash-chain integrity (tamper-evidence); omit id to verify all\n repair [options] <id> Diagnose and repair one crash-partial final transcript record only\n index [options] [query] Build/refresh the SQLite session index; search it, or mirror sessions off-box\n policy [options] <id> Show or set per-session approval policy\n lifecycle [options] List session-core handles (running/idle/parked)\n park <id> Park a session (persist to disk, free process memory)\n unpark <id> Resume a parked session\n end [options] <id> Close a session (optionally consolidate trace into MemoryStore)\n tail [options] <id> Follow a JSONL session's events (NDJSON on stdout)\n usage [options] [id] Aggregate token usage (per-session or global)\n observability [options] <request> Export verified token/USD, retry, tool latency, diff, gate, artifact and PR causality\n observability-authority [options] <id> Print the verified headHash/eventCount/scope binding for a delivery flow\n workflow [options] [id] Inspect coding workflow state (.chainlesschain/sessions/)\n conversation-maturities-v2 [options] List V2 conversation maturity states\n turn-lifecycles-v2 [options] List V2 turn lifecycle states\n stats-v2 [options] Show V2 session stats\n get-max-active-conv-v2 Get max active conversations per user\n set-max-active-conv-v2 <n> Set max active conversations per user\n get-max-pending-turns-v2 Get max pending turns per conversation\n set-max-pending-turns-v2 <n> Set max pending turns per conversation\n get-conv-idle-ms-v2 Get conversation idle ms\n set-conv-idle-ms-v2 <ms> Set conversation idle ms\n get-turn-stuck-ms-v2 Get turn stuck ms\n set-turn-stuck-ms-v2 <ms> Set turn stuck ms\n active-conv-count-v2 <userId> Count active conversations for user\n pending-turn-count-v2 <conversationId> Count pending+streaming turns for conversation\n register-conversation-v2 [options] <id> Register V2 conversation (initial=draft)\n get-conversation-v2 <id> Get V2 conversation by id\n list-conversations-v2 [options] List V2 conversations\n activate-conversation-v2 <id> Transition conversation → active\n pause-conversation-v2 <id> Transition conversation → paused\n archive-conversation-v2 <id> Transition conversation → archived (terminal)\n touch-conversation-v2 <id> Update conversation lastSeenAt\n create-turn-v2 [options] <id> Create V2 turn (initial=pending)\n get-turn-v2 <id> Get V2 turn by id\n list-turns-v2 [options] List V2 turns\n stream-turn-v2 <id> Transition turn → streaming\n complete-turn-v2 <id> Transition turn → completed (terminal)\n fail-turn-v2 <id> Transition turn → failed (terminal)\n cancel-turn-v2 <id> Transition turn → cancelled (terminal)\n auto-archive-idle-conv-v2 Auto-archive idle conversations; output flipped\n auto-fail-stuck-turns-v2 Auto-fail stuck streaming turns; output flipped\n help [command] display help for command\n",
143
+ "session": "Usage: chainlesschain session [options] [command]\n\nConversation session management\n\nOptions:\n -h, --help display help for command\n\nCommands:\n mcp-recovery Inspect or adjudicate verified MCP outcome-unknown calls\n location Inspect verified execution location, capabilities, and handoff safety\n budget Inspect or adjudicate a durable session budget authority\n message Durable cross-session inbox, addressing, policy and receipts\n group CLI-owned durable session groups and atomic batch moves\n list [options] List saved sessions\n projection [options] Emit the canonical versioned session projection for IDEs\n show [options] <id> Show a session's messages\n pr-status [options] [id] PR/CI monitor + controlled auto-merge decision for a session's linked PR\n resume [options] [id] Resume a session in chat mode (id optional — interactive picker, or most recent when piped)\n export [options] <id> Export a session as Markdown (canonical JSONL transcript, then legacy DB fallback)\n search [options] <query> Full-text search across agent session transcripts (JSONL --resume store)\n delete [options] <id> Delete a session\n rename [options] <id> <title...> Rename a headless (JSONL) session — shows up in session list\n prune [options] Delete JSONL sessions whose last activity is older than a cutoff (newest N always kept)\n migrate [options] [source] Migrate legacy JSON session files to JSONL\n validate [options] [id] Validate JSONL session files\n verify [options] [id] Verify transcript hash-chain integrity (tamper-evidence); omit id to verify all\n repair [options] <id> Diagnose and repair one crash-partial final transcript record only\n index [options] [query] Build/refresh the SQLite session index; search it, or mirror sessions off-box\n policy [options] <id> Show or set per-session approval policy\n lifecycle [options] List session-core handles (running/idle/parked)\n park <id> Park a session (persist to disk, free process memory)\n unpark <id> Resume a parked session\n end [options] <id> Close a session (optionally consolidate trace into MemoryStore)\n tail [options] <id> Follow a JSONL session's events (NDJSON on stdout)\n usage [options] [id] Aggregate token usage (per-session or global)\n observability [options] <request> Export verified token/USD, retry, tool latency, diff, gate, artifact and PR causality\n observability-authority [options] <id> Print the verified headHash/eventCount/scope binding for a delivery flow\n workflow [options] [id] Inspect coding workflow state (.chainlesschain/sessions/)\n conversation-maturities-v2 [options] List V2 conversation maturity states\n turn-lifecycles-v2 [options] List V2 turn lifecycle states\n stats-v2 [options] Show V2 session stats\n get-max-active-conv-v2 Get max active conversations per user\n set-max-active-conv-v2 <n> Set max active conversations per user\n get-max-pending-turns-v2 Get max pending turns per conversation\n set-max-pending-turns-v2 <n> Set max pending turns per conversation\n get-conv-idle-ms-v2 Get conversation idle ms\n set-conv-idle-ms-v2 <ms> Set conversation idle ms\n get-turn-stuck-ms-v2 Get turn stuck ms\n set-turn-stuck-ms-v2 <ms> Set turn stuck ms\n active-conv-count-v2 <userId> Count active conversations for user\n pending-turn-count-v2 <conversationId> Count pending+streaming turns for conversation\n register-conversation-v2 [options] <id> Register V2 conversation (initial=draft)\n get-conversation-v2 <id> Get V2 conversation by id\n list-conversations-v2 [options] List V2 conversations\n activate-conversation-v2 <id> Transition conversation → active\n pause-conversation-v2 <id> Transition conversation → paused\n archive-conversation-v2 <id> Transition conversation → archived (terminal)\n touch-conversation-v2 <id> Update conversation lastSeenAt\n create-turn-v2 [options] <id> Create V2 turn (initial=pending)\n get-turn-v2 <id> Get V2 turn by id\n list-turns-v2 [options] List V2 turns\n stream-turn-v2 <id> Transition turn → streaming\n complete-turn-v2 <id> Transition turn → completed (terminal)\n fail-turn-v2 <id> Transition turn → failed (terminal)\n cancel-turn-v2 <id> Transition turn → cancelled (terminal)\n auto-archive-idle-conv-v2 Auto-archive idle conversations; output flipped\n auto-fail-stuck-turns-v2 Auto-fail stuck streaming turns; output flipped\n help [command] display help for command\n",
144
144
  "setup": "Usage: chainlesschain setup [options]\n\nInteractive setup wizard for ChainlessChain\n\nOptions:\n --skip-download Skip binary download\n --skip-services Skip Docker service setup\n -h, --help display help for command\n",
145
145
  "sganal": "Usage: chainlesschain sganal [options] [command]\n\nSocial Graph Analytics V2 governance (in-memory, CLI v0.143.0)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n register-profile-v2 [options]\n activate-profile-v2 <id>\n stale-profile-v2 <id>\n archive-profile-v2 <id>\n touch-profile-v2 <id>\n get-profile-v2 <id>\n list-profiles-v2\n create-run-v2 [options]\n running-run-v2 <id>\n complete-run-v2 <id>\n fail-run-v2 [options] <id>\n cancel-run-v2 [options] <id>\n get-run-v2 <id>\n list-runs-v2\n config-v2\n set-max-active-profiles-v2 <n>\n set-max-pending-runs-v2 <n>\n set-profile-idle-ms-v2 <ms>\n set-run-stuck-ms-v2 <ms>\n auto-stale-idle-v2\n auto-fail-stuck-v2\n gov-stats-v2\n help [command] display help for command\n",
146
146
  "siem": "Usage: chainlesschain siem [options] [command]\n\nSIEM integration — log export to external targets\n\nOptions:\n -h, --help display help for command\n\nCommands:\n targets [options] List SIEM export targets\n add-target [options] <type> <url> Add a SIEM target (splunk_hec, elasticsearch, azure_sentinel)\n export <target-id> Export logs to a SIEM target\n stats [options] Show SIEM export statistics\n formats List SIEM export formats (V2)\n target-types List SIEM target types (V2)\n severities List SIEM severity levels (V2)\n statuses List SIEM target statuses (V2)\n default-batch-size Show default SIEM batch size (V2)\n severity-cef <severity> Map a SIEM severity to its CEF integer (0-10)\n format-log [options] <format> Format a JSON log payload as cef|leef|json\n add-target-v2 [options] Add a SIEM target via canonical options (V2)\n remove-target <target-id> Remove a SIEM target (V2)\n set-status <target-id> <status> Transition a SIEM target's status (V2)\n export-v2 [options] <target-id> Batch-export logs to a target (V2)\n stats-v2 Show extended SIEM stats (byFormat/byType/byStatus, V2)\n by-status <status> List SIEM targets filtered by status (V2)\n enums-v2 Show V2 enums (target maturity + export lifecycle)\n config-v2 Show V2 config thresholds\n set-max-active-targets-v2 <n> Set max active targets per operator\n set-max-pending-exports-v2 <n> Set max pending exports per target\n set-target-idle-ms-v2 <n> Set target idle threshold (ms)\n set-export-stuck-ms-v2 <n> Set export stuck threshold (ms)\n register-target-v2 [options] <id> <operator> Register V2 SIEM target\n activate-target-v2 <id> Activate target\n degrade-target-v2 <id> Degrade target\n retire-target-v2 <id> Retire target (terminal)\n touch-target-v2 <id> Touch target lastTouchedAt\n get-target-v2 <id> Get V2 target\n list-targets-v2 List V2 targets\n create-export-v2 [options] <id> <targetId> Create V2 export (queued)\n start-export-v2 <id> Start export\n deliver-export-v2 <id> Deliver export\n fail-export-v2 <id> [reason] Fail export\n cancel-export-v2 <id> [reason] Cancel export\n get-export-v2 <id> Get V2 export\n list-exports-v2 List V2 exports\n auto-degrade-idle-v2 Auto-degrade idle targets\n auto-fail-stuck-v2 Auto-fail stuck sending exports\n gov-stats-v2 V2 governance aggregate stats\n help [command] display help for command\n",
@@ -30,6 +30,11 @@ import {
30
30
  transformBackgroundLaunchArgv,
31
31
  } from "../lib/background-command-argv.js";
32
32
  import { resolveSessionBudgetRootOptions } from "../lib/session-budget-production-root.js";
33
+ import {
34
+ captureClaudeStorageLaunchEnvironment,
35
+ restoreClaudeStorageLaunchEnvironment,
36
+ validateClaudeStorageLaunchEnvironment,
37
+ } from "../lib/claude-project-auto-memory.js";
33
38
 
34
39
  /**
35
40
  * Resolve + validate `--add-dir` values into absolute, existing, de-duped
@@ -465,6 +470,10 @@ export function registerAgentCommand(program) {
465
470
  "--include-partial-messages",
466
471
  "Emit live assistant-text deltas as stream_event lines (requires --output-format stream-json)",
467
472
  )
473
+ .option(
474
+ "--include-hook-events",
475
+ "Emit redacted hook and subagent lifecycle events (requires --output-format stream-json)",
476
+ )
468
477
  .option(
469
478
  "--goal [id]",
470
479
  "Bind a cc goal into the run (id, or omit the value to auto-resolve the active goal)",
@@ -620,6 +629,20 @@ export function registerAgentCommand(program) {
620
629
  false,
621
630
  )
622
631
  .action(async (task, options, command) => {
632
+ // These variables select canonical config/session storage. Capture and
633
+ // validate them before any project settings file can merge an arbitrary
634
+ // `env` map; settings remain useful for child tools but never acquire
635
+ // launcher authority over transcript or automatic-memory placement.
636
+ const claudeStorageLaunchEnv = captureClaudeStorageLaunchEnvironment();
637
+ try {
638
+ validateClaudeStorageLaunchEnvironment(claudeStorageLaunchEnv, {
639
+ cwd: process.cwd(),
640
+ });
641
+ } catch (error) {
642
+ process.stderr.write(`Error: ${error.message}\n`);
643
+ process.exitCode = 1;
644
+ return;
645
+ }
623
646
  // Scope is immutable session authority. Resolve every scope/fork
624
647
  // conflict before worktree creation, session forking, bootstrap, or any
625
648
  // other externally visible setup performed by this action.
@@ -636,18 +659,16 @@ export function registerAgentCommand(program) {
636
659
  // --capabilities: print the machine-readable manifest and exit — no
637
660
  // config, no bootstrap, no network (gap-analysis 2026-07-11 快速收益 #6).
638
661
  if (options.capabilities) {
639
- const { buildAgentCapabilities } = await import(
640
- "../lib/headless-manifest.js"
641
- );
662
+ const { buildAgentCapabilities } =
663
+ await import("../lib/headless-manifest.js");
642
664
  console.log(JSON.stringify(buildAgentCapabilities(), null, 2));
643
665
  return;
644
666
  }
645
667
  let toolAdmission = null;
646
668
  if (process.env.CC_TOOL_ADMISSION) {
647
669
  try {
648
- const { parseToolAdmissionConfig } = await import(
649
- "../lib/agent-tool-admission.js"
650
- );
670
+ const { parseToolAdmissionConfig } =
671
+ await import("../lib/agent-tool-admission.js");
651
672
  toolAdmission = parseToolAdmissionConfig(
652
673
  process.env.CC_TOOL_ADMISSION,
653
674
  );
@@ -724,9 +745,8 @@ export function registerAgentCommand(program) {
724
745
  // screen readers (mono theme + no repainting status line). Applied
725
746
  // before anything renders.
726
747
  {
727
- const { screenReaderRequested, applyScreenReaderMode } = await import(
728
- "../lib/accessibility.js"
729
- );
748
+ const { screenReaderRequested, applyScreenReaderMode } =
749
+ await import("../lib/accessibility.js");
730
750
  if (screenReaderRequested(options)) {
731
751
  applyScreenReaderMode();
732
752
  }
@@ -759,9 +779,8 @@ export function registerAgentCommand(program) {
759
779
  };
760
780
  if (options.worktree !== undefined || backgroundRequested) {
761
781
  try {
762
- const { resolveBackgroundWorktreePolicy } = await import(
763
- "../lib/background-worktree-policy.js"
764
- );
782
+ const { resolveBackgroundWorktreePolicy } =
783
+ await import("../lib/background-worktree-policy.js");
765
784
  worktreeDecision = resolveBackgroundWorktreePolicy({
766
785
  background: backgroundRequested,
767
786
  worktree: options.worktree,
@@ -813,9 +832,8 @@ export function registerAgentCommand(program) {
813
832
  };
814
833
  if (worktreeDecision.enabled) {
815
834
  try {
816
- const { setupAgentWorktree, finishAgentWorktree } = await import(
817
- "../lib/agent-worktree.js"
818
- );
835
+ const { setupAgentWorktree, finishAgentWorktree } =
836
+ await import("../lib/agent-worktree.js");
819
837
  _finishAgentWorktreeFn = finishAgentWorktree;
820
838
  const detectedRepoRoot = worktreeDecision.repoRoot || invocationCwd;
821
839
  const worktreeCwd =
@@ -843,9 +861,8 @@ export function registerAgentCommand(program) {
843
861
  const { loadHooks } = await import("../lib/settings-hooks.cjs");
844
862
  _worktreeSettingsHooks =
845
863
  loadHooks({ cwd: _worktree.repoRoot }).hooks || null;
846
- const { runWorktreeCreateHooks, dispatchAsyncHooks } = await import(
847
- "../lib/settings-hook-events.js"
848
- );
864
+ const { runWorktreeCreateHooks, dispatchAsyncHooks } =
865
+ await import("../lib/settings-hook-events.js");
849
866
  runWorktreeCreateHooks(_worktreeSettingsHooks, {
850
867
  worktreePath: _worktree.path,
851
868
  branch: _worktree.branch,
@@ -853,9 +870,8 @@ export function registerAgentCommand(program) {
853
870
  cwd: _worktree.path,
854
871
  });
855
872
  if (!_worktreeAsyncSupervisor) {
856
- const { AsyncHookSupervisor } = await import(
857
- "../lib/async-hook-supervisor.js"
858
- );
873
+ const { AsyncHookSupervisor } =
874
+ await import("../lib/async-hook-supervisor.js");
859
875
  _worktreeAsyncSupervisor = new AsyncHookSupervisor({
860
876
  persistStats: true,
861
877
  });
@@ -940,9 +956,8 @@ export function registerAgentCommand(program) {
940
956
  // Claude-Code parity: auto-checkpoint defaults ON inside a git repo
941
957
  // (shadow-commit engine, zero working-tree touch); explicit
942
958
  // --checkpoint / --no-checkpoint always wins.
943
- const { resolveAutoCheckpoint } = await import(
944
- "../lib/auto-checkpoint-default.js"
945
- );
959
+ const { resolveAutoCheckpoint } =
960
+ await import("../lib/auto-checkpoint-default.js");
946
961
  const autoCheckpoint = resolveAutoCheckpoint({
947
962
  flagValue: options.checkpoint,
948
963
  flagSource: command?.getOptionValueSource?.("checkpoint"),
@@ -969,15 +984,13 @@ export function registerAgentCommand(program) {
969
984
  if (headlessIntent) {
970
985
  // Headless replays the JSONL store only, so resolve "most recent"
971
986
  // from there 鈥?a DB-only id would resume into an empty transcript.
972
- const { getLastSessionId } = await import(
973
- "../harness/jsonl-session-store.js"
974
- );
987
+ const { getLastSessionId } =
988
+ await import("../harness/jsonl-session-store.js");
975
989
  options.session = getLastSessionId();
976
990
  } else {
977
991
  // Interactive: picker across both stores (agent REPL rebuilds either).
978
- const { pickRecentSession } = await import(
979
- "../lib/session-picker.js"
980
- );
992
+ const { pickRecentSession } =
993
+ await import("../lib/session-picker.js");
981
994
  const picked = await pickRecentSession(ctx, {
982
995
  message: "Resume which agent session?",
983
996
  });
@@ -1000,9 +1013,8 @@ export function registerAgentCommand(program) {
1000
1013
  // a no-op (silent) for a fresh run.
1001
1014
  if (options.forkSession && options.session) {
1002
1015
  const store = await import("../harness/jsonl-session-store.js");
1003
- const { applyForkSession } = await import(
1004
- "../runtime/headless-runner.js"
1005
- );
1016
+ const { applyForkSession } =
1017
+ await import("../runtime/headless-runner.js");
1006
1018
  const fork = applyForkSession(
1007
1019
  {
1008
1020
  forkSession: true,
@@ -1024,16 +1036,16 @@ export function registerAgentCommand(program) {
1024
1036
  }
1025
1037
  }
1026
1038
 
1027
- // --include-partial-messages only makes sense for NDJSON output: the
1028
- // stream-input mode is always NDJSON, otherwise require stream-json
1029
- // explicitly (fail fast rather than silently dropping the deltas).
1039
+ // Event projections only make sense for NDJSON output: the stream-input
1040
+ // mode is always NDJSON, otherwise require stream-json explicitly (fail
1041
+ // fast rather than silently dropping an opt-in machine contract).
1030
1042
  if (
1031
- options.includePartialMessages &&
1043
+ (options.includePartialMessages || options.includeHookEvents) &&
1032
1044
  options.inputFormat !== "stream-json" &&
1033
1045
  options.outputFormat !== "stream-json"
1034
1046
  ) {
1035
1047
  process.stderr.write(
1036
- "--include-partial-messages requires --output-format stream-json.\n",
1048
+ "--include-partial-messages and --include-hook-events require --output-format stream-json.\n",
1037
1049
  );
1038
1050
  await _finishWorktree();
1039
1051
  process.exit(1);
@@ -1058,6 +1070,12 @@ export function registerAgentCommand(program) {
1058
1070
  // block below may default options.model 鈥?so vision input can tell an
1059
1071
  // explicit model from a settings default.
1060
1072
  const explicitCliModel = options.model;
1073
+ // Launcher environment is captured before a settings file can merge its
1074
+ // own `env` map. In particular, a checked-in project settings file must
1075
+ // not manufacture ANTHROPIC_MODEL / CLAUDE_CODE_* launcher authority.
1076
+ const startupAnthropicModel = process.env.ANTHROPIC_MODEL;
1077
+ const startupAnthropicDefaultModel = process.env.ANTHROPIC_DEFAULT_MODEL;
1078
+ let settingsModel = null;
1061
1079
 
1062
1080
  // --settings native config overrides: a .claude/settings.json-shaped file
1063
1081
  // (and the discovered .claude settings) may set `model` + `env` for this
@@ -1068,9 +1086,8 @@ export function registerAgentCommand(program) {
1068
1086
  let settingsSandbox = null;
1069
1087
  let managedSettingsSandbox = null;
1070
1088
  try {
1071
- const { loadSettingsConfig } = await import(
1072
- "../lib/settings-loader.cjs"
1073
- );
1089
+ const { loadSettingsConfig } =
1090
+ await import("../lib/settings-loader.cjs");
1074
1091
  const sc = loadSettingsConfig({
1075
1092
  cwd: process.cwd(),
1076
1093
  unattendedActionPolicy: options.unattended
@@ -1088,7 +1105,10 @@ export function registerAgentCommand(program) {
1088
1105
  for (const [k, v] of Object.entries(sc.env || {})) {
1089
1106
  process.env[k] = v;
1090
1107
  }
1091
- if (!options.model && sc.model) options.model = sc.model;
1108
+ if (!options.model && sc.model) {
1109
+ options.model = sc.model;
1110
+ settingsModel = sc.model;
1111
+ }
1092
1112
  settingsSandbox = sc.sandbox || null;
1093
1113
  managedSettingsSandbox = sc.managedSandbox || null;
1094
1114
  } catch (error) {
@@ -1099,6 +1119,8 @@ export function registerAgentCommand(program) {
1099
1119
  }
1100
1120
  // User/project settings overrides remain best-effort. Organization
1101
1121
  // managed settings are handled above and may never fail open.
1122
+ } finally {
1123
+ restoreClaudeStorageLaunchEnvironment(claudeStorageLaunchEnv);
1102
1124
  }
1103
1125
 
1104
1126
  let resolvedAgentSandbox;
@@ -1194,7 +1216,7 @@ export function registerAgentCommand(program) {
1194
1216
  // flags there, and BEFORE every dispatch (headless/stream/REPL) since
1195
1217
  // they all read options.provider/model/baseUrl/apiKey.
1196
1218
  {
1197
- const { applyConfigLlmDefaults, reconcileConfigLlmProvider } =
1219
+ const { applyAgentModelDefaults, reconcileConfigLlmProvider } =
1198
1220
  await import("../lib/llm-config-defaults.js");
1199
1221
 
1200
1222
  // Self-repair a MISLABELED config (provider disagrees with the provider
@@ -1222,8 +1244,16 @@ export function registerAgentCommand(program) {
1222
1244
  }
1223
1245
  }
1224
1246
 
1225
- applyConfigLlmDefaults(options, repairedLlm, {
1226
- explicitModel: explicitCliModel, // settings-file model must not ride
1247
+ applyAgentModelDefaults(options, repairedLlm, {
1248
+ explicitModel: explicitCliModel,
1249
+ anthropicModel: startupAnthropicModel,
1250
+ anthropicDefaultModel: startupAnthropicDefaultModel,
1251
+ settingsModel,
1252
+ // ANTHROPIC_DEFAULT_MODEL is deliberately a new-session fallback;
1253
+ // a resume/continue keeps its recorded model unless a higher source
1254
+ // explicitly replaces it.
1255
+ isNewSession:
1256
+ !options.session && !options.continue && !options.resume,
1227
1257
  });
1228
1258
 
1229
1259
  // Also reconcile the RESOLVED options: the editor panel may have already
@@ -1247,9 +1277,8 @@ export function registerAgentCommand(program) {
1247
1277
  // never pollutes spawned-bin test stderr.
1248
1278
  if (!process.env.VITEST && !process.env.VITEST_WORKER_ID) {
1249
1279
  try {
1250
- const { maybeWarnDeprecatedModel } = await import(
1251
- "../lib/model-deprecation.js"
1252
- );
1280
+ const { maybeWarnDeprecatedModel } =
1281
+ await import("../lib/model-deprecation.js");
1253
1282
  maybeWarnDeprecatedModel({ model: options.model });
1254
1283
  } catch {
1255
1284
  /* fail-open: a deprecation notice must never affect the run */
@@ -1335,9 +1364,8 @@ export function registerAgentCommand(program) {
1335
1364
  // stdin; output is always NDJSON. Routed before single-prompt handling
1336
1365
  // so stdin is consumed as events, not as one prompt.
1337
1366
  if (options.inputFormat === "stream-json") {
1338
- const { runAgentHeadlessStream } = await import(
1339
- "../runtime/headless-stream.js"
1340
- );
1367
+ const { runAgentHeadlessStream } =
1368
+ await import("../runtime/headless-stream.js");
1341
1369
  const { parseToolList } = await import("../runtime/headless-runner.js");
1342
1370
  const cwd = process.cwd();
1343
1371
  let outcome;
@@ -1378,6 +1406,7 @@ export function registerAgentCommand(program) {
1378
1406
  // (flag absent) leaves the default-on path byte-identical.
1379
1407
  projectMemory: options.projectMemory,
1380
1408
  includePartialMessages: options.includePartialMessages === true,
1409
+ includeHookEvents: options.includeHookEvents === true,
1381
1410
  goal: options.goal,
1382
1411
  mcpConfig: options.mcpConfig || null,
1383
1412
  useRegisteredMcp: options.mcp !== false,
@@ -1406,6 +1435,7 @@ export function registerAgentCommand(program) {
1406
1435
  // into the system prompt, and a per-turn `structured_result` event is
1407
1436
  // appended after each turn (parity with single-prompt --json-schema).
1408
1437
  jsonSchema: options.jsonSchema || null,
1438
+ claudeStorageLaunchEnv,
1409
1439
  });
1410
1440
  } catch (err) {
1411
1441
  process.stderr.write(
@@ -1569,9 +1599,8 @@ export function registerAgentCommand(program) {
1569
1599
  const resumeRequested =
1570
1600
  Boolean(options.continue) || options.resume !== undefined;
1571
1601
  if (resumeRequested && options.session) {
1572
- const { sessionHasPersistedEvidence } = await import(
1573
- "../harness/jsonl-session-store.js"
1574
- );
1602
+ const { sessionHasPersistedEvidence } =
1603
+ await import("../harness/jsonl-session-store.js");
1575
1604
  if (!sessionHasPersistedEvidence(options.session)) {
1576
1605
  process.stderr.write(
1577
1606
  `Note: no headless transcript for session "${options.session}" 鈥?` +
@@ -1579,16 +1608,14 @@ export function registerAgentCommand(program) {
1579
1608
  );
1580
1609
  }
1581
1610
  }
1582
- const { runAgentHeadless, parseToolList } = await import(
1583
- "../runtime/headless-runner.js"
1584
- );
1611
+ const { runAgentHeadless, parseToolList } =
1612
+ await import("../runtime/headless-runner.js");
1585
1613
  // --goal-condition: validate the spec up front so a bad prefix fails
1586
1614
  // fast (before any model call) with a clear message.
1587
1615
  if (options.goalCondition) {
1588
1616
  try {
1589
- const { parseGoalCondition } = await import(
1590
- "../lib/goal-condition-engine.js"
1591
- );
1617
+ const { parseGoalCondition } =
1618
+ await import("../lib/goal-condition-engine.js");
1592
1619
  parseGoalCondition(options.goalCondition);
1593
1620
  } catch (e) {
1594
1621
  process.stderr.write(`--goal-condition: ${e.message}\n`);
@@ -1656,6 +1683,8 @@ export function registerAgentCommand(program) {
1656
1683
  projectMemory: options.projectMemory,
1657
1684
  // --include-partial-messages: live token deltas as stream_event lines
1658
1685
  includePartialMessages: options.includePartialMessages === true,
1686
+ // --include-hook-events: redacted lifecycle/progress NDJSON lines
1687
+ includeHookEvents: options.includeHookEvents === true,
1659
1688
  // --goal [id]: bind a cc goal into the run (Phase 1)
1660
1689
  goal: options.goal,
1661
1690
  // --goal-assess: run-end LLM progress assessment (Phase 2)
@@ -1707,6 +1736,7 @@ export function registerAgentCommand(program) {
1707
1736
  : undefined,
1708
1737
  // --fallback-model: retry once on a backup model on transient errors
1709
1738
  chatFn: fallbackChatFn,
1739
+ claudeStorageLaunchEnv,
1710
1740
  };
1711
1741
 
1712
1742
  // --json-schema: structured output. Accepts a file path OR inline JSON.
@@ -1872,6 +1902,7 @@ export function registerAgentCommand(program) {
1872
1902
  observabilityScope: hasObservabilityScope
1873
1903
  ? observabilityScope
1874
1904
  : undefined,
1905
+ claudeStorageLaunchEnv,
1875
1906
  });
1876
1907
  await runtime.startAgentSession();
1877
1908
  // Interactive session ended (REPL closed) — settle the worktree.