claude-code-infinite 1.0.21 → 1.0.24

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 (76) hide show
  1. package/README.md +129 -44
  2. package/dist/claude-env.d.ts +14 -1
  3. package/dist/claude-env.d.ts.map +1 -1
  4. package/dist/claude-env.js +17 -1
  5. package/dist/claude-env.js.map +1 -1
  6. package/dist/cli-args.d.ts +15 -0
  7. package/dist/cli-args.d.ts.map +1 -1
  8. package/dist/cli-args.js +17 -0
  9. package/dist/cli-args.js.map +1 -1
  10. package/dist/cli-lifecycle.d.ts +4 -0
  11. package/dist/cli-lifecycle.d.ts.map +1 -1
  12. package/dist/cli-lifecycle.js +18 -0
  13. package/dist/cli-lifecycle.js.map +1 -1
  14. package/dist/cli-main.js +174 -51
  15. package/dist/cli-main.js.map +1 -1
  16. package/dist/cli-output.d.ts +15 -0
  17. package/dist/cli-output.d.ts.map +1 -0
  18. package/dist/cli-output.js +26 -0
  19. package/dist/cli-output.js.map +1 -0
  20. package/dist/config.d.ts +2 -0
  21. package/dist/config.d.ts.map +1 -1
  22. package/dist/config.js.map +1 -1
  23. package/dist/count-tokens.d.ts.map +1 -1
  24. package/dist/count-tokens.js +7 -1
  25. package/dist/count-tokens.js.map +1 -1
  26. package/dist/diagnostics-schema.d.ts +44 -0
  27. package/dist/diagnostics-schema.d.ts.map +1 -0
  28. package/dist/diagnostics-schema.js +162 -0
  29. package/dist/diagnostics-schema.js.map +1 -0
  30. package/dist/diagnostics.d.ts +116 -0
  31. package/dist/diagnostics.d.ts.map +1 -0
  32. package/dist/diagnostics.js +316 -0
  33. package/dist/diagnostics.js.map +1 -0
  34. package/dist/first-tree.d.ts +11 -0
  35. package/dist/first-tree.d.ts.map +1 -0
  36. package/dist/first-tree.js +45 -0
  37. package/dist/first-tree.js.map +1 -0
  38. package/dist/hooks.d.ts +37 -0
  39. package/dist/hooks.d.ts.map +1 -1
  40. package/dist/hooks.js +69 -9
  41. package/dist/hooks.js.map +1 -1
  42. package/dist/link-command.d.ts +50 -0
  43. package/dist/link-command.d.ts.map +1 -0
  44. package/dist/link-command.js +168 -0
  45. package/dist/link-command.js.map +1 -0
  46. package/dist/memtree-links.d.ts +2 -0
  47. package/dist/memtree-links.d.ts.map +1 -1
  48. package/dist/memtree-links.js +4 -0
  49. package/dist/memtree-links.js.map +1 -1
  50. package/dist/memtree-mcp-config.d.ts +28 -5
  51. package/dist/memtree-mcp-config.d.ts.map +1 -1
  52. package/dist/memtree-mcp-config.js +116 -47
  53. package/dist/memtree-mcp-config.js.map +1 -1
  54. package/dist/memtree-mcp.js +1 -1
  55. package/dist/memtree-newest.d.ts +1 -0
  56. package/dist/memtree-newest.d.ts.map +1 -1
  57. package/dist/memtree-newest.js +1 -1
  58. package/dist/memtree-newest.js.map +1 -1
  59. package/dist/memtree.d.ts +7 -0
  60. package/dist/memtree.d.ts.map +1 -1
  61. package/dist/memtree.js +8 -0
  62. package/dist/memtree.js.map +1 -1
  63. package/dist/prefix-store.js +3 -0
  64. package/dist/prefix-store.js.map +1 -1
  65. package/dist/proxy.d.ts +28 -2
  66. package/dist/proxy.d.ts.map +1 -1
  67. package/dist/proxy.js +88 -9
  68. package/dist/proxy.js.map +1 -1
  69. package/dist/reqlog.d.ts +17 -1
  70. package/dist/reqlog.d.ts.map +1 -1
  71. package/dist/reqlog.js.map +1 -1
  72. package/dist/resume-hint.d.ts +25 -0
  73. package/dist/resume-hint.d.ts.map +1 -0
  74. package/dist/resume-hint.js +36 -0
  75. package/dist/resume-hint.js.map +1 -0
  76. package/package.json +3 -3
package/README.md CHANGED
@@ -17,10 +17,27 @@ follows it down to the original messages.
17
17
  * **Search across every session.** Claude can find what was decided, tried or ruled out in any of
18
18
  your past sessions, by exact words or by meaning, filtered by project and date
19
19
  * **Browse each session's MemTree** in your browser, from the link `ccc` prints in the terminal
20
- * **Replaces `/compact` without losing the thread.** In a blind-graded benchmark, MemTree matched
21
- full-context Claude Code and beat Claude Code's built-in `/compact` by 20 points
22
- ([details](#long-session-benchmark))
20
+ * **Never loses anything vs Claude Code.** Sessions are sent word for word until near the context
21
+ limit; past it, MemTree matched full context (69 vs 69) and beat `/compact` by 20 ([benchmark](#long-session-benchmark))
23
22
  * **Unlimited-length sessions**, with relevant past information recalled automatically
23
+ * **A local proxy, so no slowdown.** Requests go straight from your machine to Anthropic and
24
+ MemTree indexes in the background; only the occasional compression step, when a session
25
+ outgrows the context budget, waits on MemTree
26
+
27
+ The magic starts past the context limit. Keep one session going for days and it learns how you
28
+ work: your priorities, the nuances of your projects, your company and your environment. Where
29
+ `/compact` would wipe that detail, MemTree keeps it, so the thread becomes an expert in you. Let it
30
+ orchestrate dozens of subagents on your behalf.
31
+
32
+ > [!IMPORTANT]
33
+ > Requires a Claude Pro or Max subscription.
34
+
35
+ <p align="center">
36
+ <picture>
37
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/crizCraig/claude-code-infinite/main/docs/images/benchmark-dark.svg">
38
+ <img width="600" alt="Long-session benchmark, judged score out of 100: Claude Code Infinite 69, full context 69, /compact 49" src="https://raw.githubusercontent.com/crizCraig/claude-code-infinite/main/docs/images/benchmark-light.svg">
39
+ </picture>
40
+ </p>
24
41
 
25
42
  ## Search across sessions
26
43
 
@@ -67,14 +84,11 @@ tokens; `/compact`'s exclude the one-time `/compact` step. This is one task fami
67
84
 
68
85
  * [node.js 20.3 or newer](https://nodejs.org/en/download/)
69
86
  * [Claude Code (the terminal version)](https://code.claude.com/docs/en/quickstart)
70
- * **Claude Subscription** - optional but highly recommended as this offers up to 1000x cost savings vs Anthropic's API pricing
87
+ * **A Claude Pro or Max subscription**
71
88
 
72
- ## Setup
89
+ <sub>Also works with an Anthropic API key, but that's far costlier than Pro or Max.</sub>
73
90
 
74
- > [!TIP]
75
- > No Claude subscription? Use an Anthropic API key exactly as with vanilla Claude Code
76
- > (`ANTHROPIC_API_KEY` or a Console login). `ccc` forwards it unchanged to api.anthropic.com, and
77
- > you pay Anthropic per token.
91
+ ## Setup
78
92
 
79
93
  1. Install (Node ≥ 20.3; no git needed)
80
94
  ```bash
@@ -96,6 +110,40 @@ The tool supports multiple environments (this selects the MemTree compression AP
96
110
 
97
111
  Each environment maintains its own separate API key.
98
112
 
113
+ ## Commands
114
+
115
+ Type these inside a `ccc` session (the `ccc:` prefix is optional). `ccc` answers them
116
+ locally, so they cost no model turn.
117
+
118
+ | Command | What it does |
119
+ | --- | --- |
120
+ | `/ccc:memtree` | Lists the MemTree commands and links your usage dashboard. |
121
+ | `/ccc:memtree-view` | Shows the link to this session's MemTree page. |
122
+ | `/ccc:memtree-compact [tokens]` | Compacts the session on your next message (to half the budget, or a target such as `400k`) and keeps the compressed history. |
123
+ | `/ccc:memtree-compact off` | Goes back to sending the conversation whole. |
124
+
125
+ From a shell or script (no session needed):
126
+
127
+ | Command | What it does |
128
+ | --- | --- |
129
+ | `ccc link <session-id>` | Prints the session's newest MemTree page URL on stdout, one line and nothing else. `--json` prints `{session_id, url, tree, updated_at}` instead (`updated_at` is the session's last activity). Exit status 0 printed, 1 no saved key or the server could not be reached (5 s timeout), 2 bad invocation, 3 the session has no MemTree yet (or no session with that id on your key; stderr says which). Only your own sessions (those of your saved key) are found. `ccc staging link` / `ccc local link` use that environment's key. |
130
+ | `ccc fetch <memtree-url>` | Prints one of your MemTree pages as JSON, using your saved key. |
131
+
132
+ Environment variables, set when launching `ccc`:
133
+
134
+ | Variable | What it does |
135
+ | --- | --- |
136
+ | `CCC_COMPACT_TARGET=500k` | Compaction target for every session (useful for headless `-p` runs); `off` starts every session with compaction off. |
137
+ | `CCC_MEMTREE_MCP=0` | Turns off the `memtree` MCP tools ([details](#memory-tools)), in interactive and headless (`-p`) runs. |
138
+ | `CCC_MEMTREE_LINK` | Where the MemTree link appears: `turn` (default, end of a turn with a new page), `message` (under every reply), `stop` (end of every turn), `success` (only after an optimized turn), or `off`. |
139
+ | `CCC_AUTO_COMPACT=1` | Restores Claude Code's own auto-compaction setting ([details](#claude-code-auto-compaction)). |
140
+ | `CCC_NO_UPDATE_CHECK=1` | Turns off the update check, and with it automatic updates ([details](#upgrading)). |
141
+ | `CCC_DISABLE_AUTOUPDATE=1` | Keeps the update notice but never installs ([details](#automatic-updates)). |
142
+ | `CCC_NO_DIAGNOSTICS=1` | Turns off diagnostics ([details](#diagnostics)). So do `DO_NOT_TRACK=1`, Claude Code's `DISABLE_TELEMETRY=1` or `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`, and `"diagnostics": false` in `~/.claude-code-infinite/config.json`. |
143
+
144
+ Links are clickable in terminals that support OSC 8 hyperlinks (iTerm2, Ghostty, WezTerm,
145
+ kitty, VS Code, JetBrains, Windows Terminal); elsewhere you get the plain URL.
146
+
99
147
  ## Claude Code auto-compaction
100
148
 
101
149
  `ccc` disables Claude Code's automatic conversation compaction for the Claude process it launches. MemTree manages the context sent to the model, so letting Claude Code independently summarize the full local transcript can compact a conversation MemTree already reduced. Manual `/compact` remains available.
@@ -105,6 +153,13 @@ above a fixed 100k-token threshold, even when the active model has a 1M window
105
153
  and auto-compaction is disabled. `ccc` suppresses that resume-time
106
154
  recommendation as well; it does not disable the manual `/compact` command.
107
155
 
156
+ With auto-compaction off, Claude Code still refuses a request itself, without
157
+ sending it, once its own estimate reaches the window minus 23k (977k on a 1M
158
+ window). MemTree compresses at 900k, so a single large tool round could reach that
159
+ refusal before `ccc` ever saw the request. `ccc` sets
160
+ `CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE` (unless you exported your own) so such a
161
+ request reaches the proxy, which compresses it mid-turn.
162
+
108
163
  A session whose last response reached the verified local refusal threshold
109
164
  (for example one sent whole while MemTree was unavailable) would otherwise be
110
165
  refused locally with "Context limit reached" on every prompt after a resume.
@@ -141,28 +196,45 @@ Claude Code ──▶ localhost proxy (ccc)
141
196
  - Anthropic requests go directly from the local proxy to api.anthropic.com using the authentication Claude Code supplied. PolyChat never sees that credential or Anthropic traffic.
142
197
  - If MemTree is unreachable, slow, or your MemTree plan needs payment, `ccc` degrades to a transparent passthrough so your session is never interrupted.
143
198
 
144
- ### Inline notices
199
+ ### Diagnostics
145
200
 
146
- In interactive sessions, `ccc` reports these MemTree states as display-only lines in Claude Code:
201
+ `ccc` sends a few diagnostics to MemTree so we can see why a session fails to start or stalls:
147
202
 
148
- - `✓ MemTree · conversation optimized · ~813k → 408k tokens`, with the session's newest completed MemTree page on its own line below it and a blank line before the answer, when a compressed turn reflects new indexing (MemTree's index covers more of the conversation than before) or a newly finished MemTree page. The before-count is `ccc`'s size estimate for the request that would otherwise have been sent (MemTree's `usage.raw_prompt_tokens` when `ccc` has none); the after-count is Anthropic's reported compressed input, estimated from bytes until usage arrives. Counts under a million are whole thousands, larger ones one decimal (`1.3m`). Without both counts, or when the result is not smaller, the line reads just `✓ MemTree · conversation optimized`. The line is green when terminal color is available, and plain when `NO_COLOR` or a monochrome terminal is configured. `ccc` uses the standard ANSI green foreground sequence and Node's capability detection, so the same path works in ANSI terminals on macOS/Linux and supported Windows consoles.
149
- - `⚠ MemTree degraded — this turn ran uncompressed` when a blocking compression call fails or times out.
150
- - `⚠ MemTree is off — payment required…` once when compression and indexing are disabled for payment.
151
- - `• MemTree` with the page on its own line below it, once at the end of a user turn, when the turn used a MemTree index whose link has not been shown yet (the first one of the session, then each newly finished index), unless the turn's success line already showed it. The line comes from the `Stop` hook, so it lands after the turn's last message. When MemTree passed the conversation through whole because it already fits the model's budget, the label line reads `• MemTree · /memtree-compact to compact session`. The URL always gets a line to itself, so a long link does not wrap the label or note. The displayed link follows the server's newest completed tree for this session, preserving its pinned namespace and own/served selection. If that lookup is unavailable, it falls back to the compression page; that page can show a completed prefix while its own tree builds. Open it in a browser, read it as JSON with `ccc fetch <url>`, or, from an agent inside the session, `GET $ANTHROPIC_BASE_URL/memtree/<short id>.json` on the loopback proxy without handling the key. Every MemTree call carries Claude Code's session id, so `GET $ANTHROPIC_BASE_URL/memtree/sessions/<session id>.json` lists every page from one session, newest first (the session id is the `--resume` id and the name of the transcript under `~/.claude/projects/`). `/memtree` lists the MemTree commands. Type `/memtree-view` at any time to print the session's latest link. Both also end with a `• Usage` link to your usage dashboard on polychat (`/usage` on the same host as MemTree: `https://app.polychat.co/usage` in production, the staging or local host otherwise); it opens only with your browser signed in to polychat as the same account. `/memtree-compact` is MemTree's replacement for Claude Code's `/compact`: your next message is sent compressed to half the budget (or `/memtree-compact 400k` for another target), and from then on the session follows the compaction rules under [How it works](#how-it-works) with that target. `/memtree-compact off` goes back to sending the conversation whole. `CCC_COMPACT_TARGET=500k` sets the target of every compaction for every session from launch, for benchmarks and headless (`-p`) runs, where the slash command is unavailable; it does not compact by itself, the budget still decides when, and `/memtree-compact off` still turns compaction off for one session. `CCC_COMPACT_TARGET=off` starts every session in the `/memtree-compact off` state instead (`/memtree-compact [N]` still turns it back on). `ccc` answers these commands locally, so they cost no model turn and nothing is added to the conversation; the compaction setting lasts for the life of the `ccc` process. When a session starts and already has a page, which in practice means a resumed one (`ccc --resume`, or `/resume` inside a running session), its latest link is shown right away: `ccc` remembers the newest page per session in `~/.claude-code-infinite/memtree-links.json` (most recent 200 sessions) and a `SessionStart` hook prints it. `CCC_MEMTREE_LINK` changes where the link appears: `turn` (default), `message` (under every finished assistant message, green when the index is new, dim otherwise), `stop` (every turn, on `Stop`), `success` (only on the line below `✓ MemTree · conversation optimized`), or `off`.
203
+ - versions (ccc, Claude Code, Node), how ccc was installed (npm, npx, linked), OS and CPU
204
+ architecture, terminal type and locale;
205
+ - lifecycle events (first run, sign-in prompt shown, key accepted or rejected, session start,
206
+ the MemTree-paused notice shown, update hint or background update result);
207
+ - errors as codes, status numbers, sizes and timings (an Anthropic 401, a MemTree 402, a
208
+ compression timeout).
152
209
 
153
- The newest-tree lookup runs in the background with a 60-second cache, at most eight outstanding fetches, and one 10-second deadline across at most 32 finder pages. `/memtree-view` and resume hooks wait at most 2.5 seconds. Servers with the finder session-ID search (polychat `0202eaa` and later, including reviewed `c67cadb`) use `/v1/memtree/sessions?q=<id>`, following cursors and accepting only the exact session ID. A missing endpoint falls back to the compression page and is not retried for 30 minutes. The older exact route `/usage/memtree/sessions/<id>.json` accepts the bearer key, but excludes index-only calls and does not report completed trees, so it cannot supply this link. No verified server version provides a suitable exact newest-completed-tree lookup yet.
210
+ Never sent: your prompts or any conversation content, file paths, project or repository names,
211
+ hostnames, usernames, environment values, keys or tokens, or error message text. Each event is
212
+ checked against a fixed allowlist on your machine before it is queued, and again by the server.
213
+ They are tied to your MemTree key when you have one, otherwise to a random install id in
214
+ `~/.claude-code-infinite/install_id`. Sending is batched in the background and never slows a
215
+ request; a failed send is dropped.
154
216
 
155
- `/memtree-view` (and the usage link of `/memtree`) emits OSC 8 hyperlinks only when the ccc proxy has a TTY and detects iTerm2 3.1+ (`TERM_PROGRAM=iTerm.app` plus its version), JetBrains (`TERMINAL_EMULATOR=JetBrains-JediTerm`), Ghostty, WezTerm, VS Code, kitty, or Windows Terminal (`WT_SESSION`). Detection happens in the proxy, before hook output is relayed through pipes. `NO_COLOR`, dumb/unknown terminals, tmux/screen, and non-TTY output get a plain URL. Apple Terminal also gets the full visible URL for its normal URL handling. The success and Stop notices retain their visible URLs, and a late lookup cannot repeat the same page already linked by that turn's success notice.
217
+ Turn diagnostics off with any of: `CCC_NO_DIAGNOSTICS=1`, `"diagnostics": false` in
218
+ `~/.claude-code-infinite/config.json`, `DO_NOT_TRACK=1`, or Claude Code's own
219
+ `DISABLE_TELEMETRY=1` / `CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1`.
156
220
 
157
- **The end of a session.** MemTree indexes once about 10k new tokens build up, and each index call carries a request's messages, so a session's last turns, including the reply it ended with (often where a PR was opened), would never be indexed. `ccc` therefore sends one final index call per session: the main conversation plus that last reply, read from Claude Code's transcript, flagged so MemTree indexes the tail even below its minimum (at most once per conversation per 30 minutes; two conversations with an identical first message share that allowance). It goes out 10 minutes after a turn ends with no new request, or at exit for the 3 most recent sessions, inside the 2-second background drain; `-p` and non-TTY runs, which have no `Stop` hook, get it at exit. A failure is logged and never changes `ccc`'s exit code. Until then, `read_lines` with `"tail": true` reads the messages after the tree verbatim. When `ccc` runs inside another Claude Code session, the inner Claude Code writes no transcript unless `CLAUDE_CODE_FORCE_SESSION_PERSISTENCE=1` is set; without it the final index still covers everything through the last request, just not the final reply.
221
+ ### Memory tools
158
222
 
159
- `ccc` installs a minimal session-only Claude Code plugin using the repeatable `--plugin-dir` option. Its `MessageDisplay` hook changes only what the terminal renders and never alters stored assistant content; a `Stop` hook supplies a fallback for tool-only responses. That fallback may be saved by Claude Code as non-model hook UI metadata, but it is excluded from resumed model and recap requests. Notices are never added to model context, and Anthropic responses are left untouched with one exception: the hidden recap request Claude Code sends when you come back to an idle session gets a final `• MemTree` / `<url>` text block, so the recap ends with the link (not added when `CCC_MEMTREE_LINK=off`). Claude Code keeps that recap as a UI-only system entry, never as conversation content, and the block is skipped when it would push the recap past Claude Code's 400-character cap, and `-p`/non-TTY output is left unchanged. Legacy marker cleanup remains for transcripts created by older `ccc` releases. The payment state can also produce a separate terminal warning at startup.
223
+ Every `ccc` session, interactive or headless (`-p` and non-TTY runs), gets a small MCP server, `memtree`, with four read-only tools (see [Search across sessions](#search-across-sessions)): `mcp__memtree__search` (`query`; optional `tree`, `"current"` for this session or omitted for all of your sessions; `mode` `text` (default, free) or `vector` (meaning, first page charged); `project`, `since`, `until`, `cursor`, `limit` (default 10, at most 50)), `mcp__memtree__read_node` (`node`, an address `<tree>#<id>` from search, or `id` with optional `tree`: summary, path from the root, children, leaf line range), `mcp__memtree__read_lines` (a leaf's `node`, or `block`, `start`, `end` with optional `tree`: exact transcript lines, at most 400 lines / 40k characters per call) (with `tail: true` instead, the newest messages after the tree that are not indexed yet) and `mcp__memtree__list` (your sessions, most recently active first; `since`, `until`, `project`, `q`, `cursor`, `limit`). Other sessions' trees are named explicitly by reference and authorized by your MemTree key. This session's tree (`tree: "current"`, or no `tree` on `read_node`/`read_lines`) is the one the current request was served from: the server asks the `ccc` proxy for `GET $ANTHROPIC_BASE_URL/memtree/current?session=<id>` (only that session's compression source page, or its stored source page on resume; `current.json?session=<id>` returns the page itself). Completed pages are cached. If the proxy temporarily serves an older prefix while a newer tree is indexing, the tools reuse that prefix during a 45-second cooldown, then check the page again. `ccc` registers it with `--mcp-config=<temp file>`, which keeps working under `--strict-mcp-config`, and pre-allows the four read-only tools; `CCC_MEMTREE_MCP=0` turns it off. The MCP process requires `CLAUDE_CODE_SESSION_ID` and checks that both the pointer and page belong to it. If Claude Code retains an MCP process with an old session ID after `/clear` or a session switch, reconnect the MCP server with the current session ID; it cannot infer a new identity from another session using the proxy. Your own choices win: if your `--mcp-config` already names a server `memtree`, `ccc` adds and pre-allows nothing (if it runs `ccc memtree-mcp`, or `ccc staging memtree-mcp`, the tools work as usual); `--allowedTools` lists are added together, so yours is kept and only the four memtree tools are pre-allowed; tools named by `--disallowedTools` (one tool, `mcp__memtree`, or `mcp__memtree__*`) are neither pre-allowed nor advertised. With `--continue`, Claude Code starts MCP servers under a new session id before it switches to the continued session, so this session's tree fails closed (`list` and searches across sessions still work); use `--resume <id>` instead. Whenever the tools are configured, compress calls carry `x-memtree-tools: search,read_node,read_lines,list` so MemTree tells the model how to use them.
160
224
 
161
- Claude Code currently displays the original assistant text instead of `MessageDisplay` replacements while verbose mode is enabled. Turn verbose mode off to see the inline MemTree line.
225
+ ### Headless / agents
162
226
 
163
- ### Memory tools
227
+ `ccc -p` works like `claude -p`, so an agent or orchestrator can drive it. Keep one Claude Code session per long-lived agent and resume it on every call, so MemTree keeps compacting and indexing one growing conversation:
164
228
 
165
- Interactive `ccc` sessions also get a small MCP server, `memtree`, with four read-only tools (see [Search across sessions](#search-across-sessions)): `mcp__memtree__search` (`query`; optional `tree`, `"current"` for this session or omitted for all of your sessions; `mode` `text` (default, free) or `vector` (meaning, first page charged); `project`, `since`, `until`, `cursor`, `limit` (default 10, at most 50)), `mcp__memtree__read_node` (`node`, an address `<tree>#<id>` from search, or `id` with optional `tree`: summary, path from the root, children, leaf line range), `mcp__memtree__read_lines` (a leaf's `node`, or `block`, `start`, `end` with optional `tree`: exact transcript lines, at most 400 lines / 40k characters per call) (with `tail: true` instead, the newest messages after the tree that are not indexed yet) and `mcp__memtree__list` (your sessions, most recently active first; `since`, `until`, `project`, `q`, `cursor`, `limit`). Other sessions' trees are named explicitly by reference and authorized by your MemTree key. This session's tree (`tree: "current"`, or no `tree` on `read_node`/`read_lines`) is the one the current request was served from: the server asks the `ccc` proxy for `GET $ANTHROPIC_BASE_URL/memtree/current?session=<id>` (only that session's compression source page, or its stored source page on resume; `current.json?session=<id>` returns the page itself). Completed pages are cached. If the proxy temporarily serves an older prefix while a newer tree is indexing, the tools reuse that prefix during a 45-second cooldown, then check the page again. `ccc` registers it with `--mcp-config=<temp file>`, which keeps working under `--strict-mcp-config`, and pre-allows the four read-only tools; `CCC_MEMTREE_MCP=0` turns it off. The MCP process requires `CLAUDE_CODE_SESSION_ID` and checks that both the pointer and page belong to it. If Claude Code retains an MCP process with an old session ID after `/clear` or a session switch, reconnect the MCP server with the current session ID; it cannot infer a new identity from another session using the proxy. Print (`-p`) and non-TTY runs get it only when their own `--mcp-config` names a server `memtree` run by `ccc memtree-mcp` (add `--allowedTools mcp__memtree__search,mcp__memtree__read_node,mcp__memtree__read_lines,mcp__memtree__list`). Whenever the tools are configured, compress calls carry `x-memtree-tools: search,read_node,read_lines,list` so MemTree tells the model how to use them.
229
+ ```bash
230
+ ccc -p --resume <session-id> --output-format json "…"
231
+ ```
232
+
233
+ Start the session with `ccc -p --session-id <uuid> "…"` (or take `session_id` from the first JSON result). Never run two `ccc` processes on one session at the same time: both would append to the same transcript. Headless runs have the [memory tools](#memory-tools) with no extra flags (`CCC_MEMTREE_MCP=0` turns them off; they can read all of the sessions your MemTree key owns, so give each user of a shared agent platform their own key). Stdout carries only Claude Code's output, so `--output-format json` and `stream-json` parse as with `claude`; `ccc`'s own lines (banner, mode, request log path) go to stderr. `--mcp-config` takes several values, so pass your own as `--mcp-config=<file>` or put the prompt before it; otherwise it swallows a prompt that follows it.
234
+
235
+ To show an agent's memory after a run, `ccc link "$sid"` prints the session's newest MemTree page URL (exit 3 when it has no tree yet). It can trail the run by one call: a `-p` run's newest tree is built as it exits.
236
+
237
+ The full guide for agent platforms (setup, output parsing, memory tools, tree links, older versions) is [docs/headless.md](docs/headless.md).
166
238
 
167
239
  ## How it works
168
240
 
@@ -173,7 +245,7 @@ Interactive `ccc` sessions also get a small MCP server, `memtree`, with four rea
173
245
 
174
246
  When you send a message, we retrieve relevant details and summaries from the prior messages in your thread. These details and summaries populate a **memory message**. Following the memory message, we append a compressed version of your recent message history. The resulting context-window is dramatically smaller, allowing Claude to process your request with much greater efficacy, lower latency, and reduced cost.
175
247
 
176
- **Compaction keeps a stable prefix.** While a conversation fits the model's budget (800k tokens for Opus 5.5), it is sent whole. When a request reaches the budget, `ccc` compresses it once, to half the budget (or your `/memtree-compact N`), and keeps those compressed bytes as the session's prefix. Every later request, human turns included, is that same prefix followed by the messages that came after it, verbatim, with no compression call (MemTree still indexes in the background). Because the prefix does not change, Anthropic reads it from the prompt cache on every turn after the one that compacted, instead of writing the whole compressed context again. `ccc` compresses again only when prefix plus newer turns reach the budget (measured from the size Anthropic reported for the previous request, plus an estimate for what was added), or when the messages the prefix stands for change (rewind, edit, fork, `/clear`). If that recompression fails, the turn is sent on the old prefix rather than the whole history. The prefix is also kept on disk, one file per session under `~/.claude-code-infinite/stable-prefixes/` (mode 600 in a private directory, at most 64 sessions and 256 MB, oldest dropped first), so the first turn after `ccc --resume` rides it instead of waiting on a fresh compression. A stored prefix belongs to the MemTree backend and key that wrote it (identified by a hash, never the key itself) and is never used with another. It is used only if the resumed history still matches what it replaced; a main-thread history that no longer matches discards it, while side requests (such as Claude Code's web-search helper) leave it alone. Only the main thread's prefix is stored, never a subagent's. The budget is the one MemTree reports for the model; until the server reports one, `ccc` uses 80% of the model's context window. `CCC_BUDGET_TOKENS=60k` overrides it for testing. Every `requests.jsonl` line carries the `pid` of the `ccc` process that wrote it, which tells apart concurrent sessions sharing the log. The same rule holds inside a tool loop, so a long single turn (a headless `-p` run, or a long agentic loop) is compacted as it grows rather than only when you next type: each tool request under the budget goes out with no compression call, the one that reaches it is compressed once and becomes the stable prefix, and later tool requests and your next message ride that prefix until it reaches the budget again. `requests.jsonl` shows the `compaction` of each main-thread human turn and of every tool turn (budget, its source, the size estimate, and the reason for a compaction: `budget`, `prefix-mismatch`, `manual` or `target-change`); a human turn sent on the stable prefix is `turnType: "followup-prefix"`, a tool turn `tool-memory` (on its route) or `tool-prefix` (on the prefix directly), and a tool turn that compacted `tool-recompressed`.
248
+ **Compaction keeps a stable prefix.** While a conversation fits the model's budget (900k tokens for Opus 5.5, where plain Claude Code would auto-compact at 967k), it is sent whole. When a request reaches the budget, `ccc` compresses it once, to half the budget (or your `/memtree-compact N`), and keeps those compressed bytes as the session's prefix. Every later request, human turns included, is that same prefix followed by the messages that came after it, verbatim, with no compression call (MemTree still indexes in the background). Because the prefix does not change, Anthropic reads it from the prompt cache on every turn after the one that compacted, instead of writing the whole compressed context again. `ccc` compresses again only when prefix plus newer turns reach the budget (measured from the size Anthropic reported for the previous request, plus an estimate for what was added), or when the messages the prefix stands for change (rewind, edit, fork, `/clear`). If that recompression fails, the turn is sent on the old prefix rather than the whole history. The prefix is also kept on disk, one file per session under `~/.claude-code-infinite/stable-prefixes/` (mode 600 in a private directory, at most 64 sessions and 256 MB, oldest dropped first), so the first turn after `ccc --resume` rides it instead of waiting on a fresh compression. A stored prefix belongs to the MemTree backend and key that wrote it (identified by a hash, never the key itself) and is never used with another. It is used only if the resumed history still matches what it replaced; a main-thread history that no longer matches discards it, while side requests (such as Claude Code's web-search helper) leave it alone. Only the main thread's prefix is stored, never a subagent's. The budget is the one MemTree reports for the model; until the server reports one, `ccc` uses 90% of the context window on Opus 5.5, Opus 5, Opus 4.8 and Fable 5 and 5.1 with a 1M window, and 80% otherwise. `CCC_BUDGET_TOKENS=60k` overrides it for testing. Every `requests.jsonl` line carries the `pid` of the `ccc` process that wrote it, which tells apart concurrent sessions sharing the log. The same rule holds inside a tool loop, so a long single turn (a headless `-p` run, or a long agentic loop) is compacted as it grows rather than only when you next type: each tool request under the budget goes out with no compression call, the one that reaches it is compressed once and becomes the stable prefix, and later tool requests and your next message ride that prefix until it reaches the budget again. `requests.jsonl` shows the `compaction` of each main-thread human turn and of every tool turn (budget, its source, the size estimate, and the reason for a compaction: `budget`, `prefix-mismatch`, `manual` or `target-change`); a human turn sent on the stable prefix is `turnType: "followup-prefix"`, a tool turn `tool-memory` (on its route) or `tool-prefix` (on the prefix directly), and a tool turn that compacted `tool-recompressed`.
177
249
 
178
250
  That compressed context stays in force for the rest of the turn: the tool loop it kicks off, and the matching Count Tokens calls, are routed through the same compressed prefix. The Count Tokens part matters — Claude Code sizes its context from those replies, so counting the uncompressed history would make it auto-compact a conversation memory had already shrunk. A mismatched or resumed conversation shape drops the route rather than grafting one session's prefix onto another.
179
251
 
@@ -258,27 +330,40 @@ For `ccc --resume <id>`, an automatic, best-effort repair can unblock a transcri
258
330
 
259
331
  ## Releasing
260
332
 
261
- Releases are staged by GitHub Actions through npm Trusted Publishing (OIDC), so no npm
262
- token, passkey or browser is needed to build and upload them, and each one is approved by a
263
- maintainer before it goes live:
264
-
265
- 1. On a clean `main`, run `./publish.sh` (or `./publish.sh minor` / `major`). It builds,
266
- checks that `dist/` is committed, runs `npm version`, and pushes the commit and the
267
- `vX.Y.Z` tag.
268
- 2. The tag push runs [`.github/workflows/publish.yml`](.github/workflows/publish.yml): `npm ci`,
269
- the test suite with `NO_COLOR=1` and with `FORCE_COLOR=1`, a check that the rebuilt
270
- `dist/` matches the commit and that the tag equals `package.json`'s version, then
271
- `npm stage publish --provenance`.
272
- 3. Approve the staged version (2FA) on
273
- [npmjs.com](https://www.npmjs.com/package/claude-code-infinite) under the **Staged
274
- Packages** tab, or with `npm stage list claude-code-infinite` and
275
- `npm stage approve <stage-id>`. Until then it is not installable.
276
-
277
- The trusted publisher on npmjs.com is bound to the workflow file name `publish.yml` with no
278
- GitHub environment, and allows only staged publishing; renaming the workflow breaks it.
279
- `./publish.sh --local` is the fallback: it publishes directly from your machine with npm web
280
- auth, then pushes the commit and tag; the workflow still tests that tag but skips staging,
281
- since the version is already published.
333
+ Releases are published by GitHub Actions through npm Trusted Publishing (OIDC): no npm
334
+ token, passkey or staging step. Each one waits for approval of the `npm` GitHub environment
335
+ (reviewer: crizCraig). That approval is a GitHub permission: anything holding a maintainer's
336
+ GitHub token with `repo` scope (including an agent using `gh`) can grant it, so keep such
337
+ tokens out of untrusted sessions.
338
+
339
+ 1. [release-please](https://github.com/googleapis/release-please) keeps a **Release x.y.z**
340
+ pull request open on `main` ([`.github/workflows/release.yml`](.github/workflows/release.yml)).
341
+ It bumps `package.json`, `package-lock.json` and `.release-please-manifest.json` and adds
342
+ a `CHANGELOG.md` entry, and it updates itself on every push to `main`.
343
+ 2. Merge it when you want to release. release-please then tags `vX.Y.Z`, creates the GitHub
344
+ release and starts [`.github/workflows/publish.yml`](.github/workflows/publish.yml) on the
345
+ tag. That checks that the tagged commit is on `main` and that the tag equals
346
+ `package.json`'s version, runs the full CI matrix (`ci.yml`), and checks that the committed
347
+ `dist/` matches a fresh build.
348
+ 3. Approve the `npm` environment (one tap in the GitHub mobile app, or **Review deployments**
349
+ on the run). The job then runs `npm publish --provenance --access public`.
350
+
351
+ Commits: release-please only opens the PR, and only lists a commit in the changelog, for
352
+ conventional prefixes: `feat:`, `fix:`, `perf:`, `refactor:`, `revert:` or `deps:` (a scope
353
+ is fine, e.g. `fix(exit): ...`). Other subjects such as `Exit: ...` or `README: ...` are
354
+ allowed and ship in the release, but are not listed. Every release is a patch bump. For a
355
+ minor or major release, or to release with no listed commit, push an empty commit:
356
+
357
+ ```bash
358
+ git commit --allow-empty -m "chore: release 1.1.0" -m "Release-As: 1.1.0"
359
+ ```
360
+
361
+ The trusted publisher on npmjs.com is bound to the workflow file `publish.yml` and the GitHub
362
+ environment `npm`; renaming either breaks publishing. `./publish.sh --local [patch|minor|major]`
363
+ is the emergency path: from a `main` that matches `origin/main`, it publishes directly from
364
+ your machine with npm web auth, then pushes the release commit (including the release-please
365
+ manifest) and the tag in one atomic push, and creates the GitHub release.
366
+ publish.yml still tests that tag but skips publishing, since the version is already on npm.
282
367
 
283
368
  ## Troubleshooting
284
369
 
@@ -17,9 +17,22 @@
17
17
  * DISABLE_AUTO_COMPACT. Suppress that ccc-inappropriate recommendation with an
18
18
  * effectively unreachable finite threshold; manual `/compact` remains available.
19
19
  *
20
+ * With auto-compaction off, Claude Code still refuses a request itself once
21
+ * its own estimate (last reported usage plus the new messages) reaches the
22
+ * window minus 23k (977k on a 1M window; 2.1.302, measured) and never sends
23
+ * it: "Prompt is too long", and every later message is refused the same way.
24
+ * MemTree compresses at a budget near the window (900k), so one large tool
25
+ * round could otherwise strand a session there before ccc sees the request.
26
+ * CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE lifts that refusal: the request reaches
27
+ * the proxy, which compresses it mid-turn or, failing that, refuses it with
28
+ * its own bounded retry/400. A value the user already exported is kept.
29
+ *
20
30
  * `CCC_AUTO_COMPACT=1` is an escape hatch: remove ccc's override and let the
21
- * user's native Claude Code setting decide whether auto-compaction is enabled.
31
+ * user's native Claude Code setting decide whether auto-compaction is enabled
32
+ * (Claude Code's own limits then apply unchanged).
22
33
  */
34
+ /** Claude Code's local refusal limit under ccc: effectively never reached. */
35
+ export declare const UNREACHABLE_BLOCKING_LIMIT = "1000000000";
23
36
  export declare function claudeChildEnv(parentEnv: NodeJS.ProcessEnv, anthropicBaseUrl: string): NodeJS.ProcessEnv;
24
37
  /**
25
38
  * Keep the proxy's MemTree budget in lockstep with Claude Code's own context
@@ -1 +1 @@
1
- {"version":3,"file":"claude-env.d.ts","sourceRoot":"","sources":["../src/claude-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,CAAC,UAAU,EAC5B,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAAC,UAAU,CAoBnB;AAOD;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,MAAM,CAAC,UAAU,GAC3B,OAAO,CAET"}
1
+ {"version":3,"file":"claude-env.d.ts","sourceRoot":"","sources":["../src/claude-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,8EAA8E;AAC9E,eAAO,MAAM,0BAA0B,eAAe,CAAC;AAEvD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,CAAC,UAAU,EAC5B,gBAAgB,EAAE,MAAM,GACvB,MAAM,CAAC,UAAU,CAuBnB;AAOD;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,SAAS,EAAE,MAAM,CAAC,UAAU,GAC3B,OAAO,CAET"}
@@ -17,9 +17,22 @@
17
17
  * DISABLE_AUTO_COMPACT. Suppress that ccc-inappropriate recommendation with an
18
18
  * effectively unreachable finite threshold; manual `/compact` remains available.
19
19
  *
20
+ * With auto-compaction off, Claude Code still refuses a request itself once
21
+ * its own estimate (last reported usage plus the new messages) reaches the
22
+ * window minus 23k (977k on a 1M window; 2.1.302, measured) and never sends
23
+ * it: "Prompt is too long", and every later message is refused the same way.
24
+ * MemTree compresses at a budget near the window (900k), so one large tool
25
+ * round could otherwise strand a session there before ccc sees the request.
26
+ * CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE lifts that refusal: the request reaches
27
+ * the proxy, which compresses it mid-turn or, failing that, refuses it with
28
+ * its own bounded retry/400. A value the user already exported is kept.
29
+ *
20
30
  * `CCC_AUTO_COMPACT=1` is an escape hatch: remove ccc's override and let the
21
- * user's native Claude Code setting decide whether auto-compaction is enabled.
31
+ * user's native Claude Code setting decide whether auto-compaction is enabled
32
+ * (Claude Code's own limits then apply unchanged).
22
33
  */
34
+ /** Claude Code's local refusal limit under ccc: effectively never reached. */
35
+ export const UNREACHABLE_BLOCKING_LIMIT = "1000000000";
23
36
  export function claudeChildEnv(parentEnv, anthropicBaseUrl) {
24
37
  const childEnv = {
25
38
  ...parentEnv,
@@ -36,6 +49,9 @@ export function claudeChildEnv(parentEnv, anthropicBaseUrl) {
36
49
  }
37
50
  else {
38
51
  childEnv.DISABLE_AUTO_COMPACT = "1";
52
+ if (!childEnv.CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE) {
53
+ childEnv.CLAUDE_CODE_BLOCKING_LIMIT_OVERRIDE = UNREACHABLE_BLOCKING_LIMIT;
54
+ }
39
55
  }
40
56
  return childEnv;
41
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"claude-env.js","sourceRoot":"","sources":["../src/claude-env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,cAAc,CAC5B,SAA4B,EAC5B,gBAAwB;IAExB,MAAM,QAAQ,GAAsB;QAClC,GAAG,SAAS;QACZ,kBAAkB,EAAE,gBAAgB;QACpC,wCAAwC,EAAE,GAAG;QAC7C,kCAAkC,EAAE,YAAY;KACjD,CAAC;IAEF,gEAAgE;IAChE,OAAO,QAAQ,CAAC,gBAAgB,CAAC;IAEjC,IAAI,SAAS,CAAC,gBAAgB,KAAK,GAAG,EAAE,CAAC;QACvC,oEAAoE;QACpE,iCAAiC;QACjC,OAAO,QAAQ,CAAC,oBAAoB,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,QAAQ,CAAC,oBAAoB,GAAG,GAAG,CAAC;IACtC,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,cAAc,CAAC,KAAyB;IAC/C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACtC,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AAC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CAAC,cAAc,CAAC,SAAS,CAAC,8BAA8B,CAAC,CAAC;AACnE,CAAC"}
@@ -5,6 +5,20 @@ export interface WrapperArgs {
5
5
  }
6
6
  /** Whether Claude's own print mode was requested before its `--` separator. */
7
7
  export declare function isPrintInvocation(args: string[]): boolean;
8
+ /** ccc's own subcommands, which start no Claude session. */
9
+ declare const SUBCOMMANDS: readonly ["fetch", "memtree-mcp", "link"];
10
+ export type CccEnvironment = "production" | "staging" | "local";
11
+ /** The environment a leading `local`/`staging` word selects (else production). */
12
+ export declare function environmentOf(args: readonly string[]): CccEnvironment;
13
+ /**
14
+ * A ccc subcommand and its arguments: the first word, or the word after
15
+ * `local`/`staging` (`ccc staging memtree-mcp` is the same server as
16
+ * `ccc memtree-mcp`; the environment is the proxy's, from its base URL).
17
+ */
18
+ export declare function subcommandArgs(args: readonly string[]): {
19
+ name: (typeof SUBCOMMANDS)[number];
20
+ args: string[];
21
+ } | undefined;
8
22
  /**
9
23
  * Consume ccc's own flags only before the conventional `--` separator. Values
10
24
  * after it are literal Claude arguments/prompts, even when they look like ccc
@@ -29,4 +43,5 @@ export declare function compactTargetFromEnv(raw: string | undefined, parseToken
29
43
  value: number | null | undefined;
30
44
  warning?: string;
31
45
  };
46
+ export {};
32
47
  //# sourceMappingURL=cli-args.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAMzD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,CAmB5D;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,SAAS,GA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E,GAAG,WAAW,CAmB5D;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC;AACnF,eAAO,MAAM,uBAAuB,EAAE,SAAS,oBAAoB,EAMlE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,oBAAoB,GAAG,SAAS,CAKlC;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,MAAM,GAAG,SAAS,EACvB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,EACjD,SAAS,EAAE,MAAM,GAChB;IAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAWxD"}
package/dist/cli-args.js CHANGED
@@ -8,6 +8,23 @@ export function isPrintInvocation(args) {
8
8
  }
9
9
  return false;
10
10
  }
11
+ /** ccc's own subcommands, which start no Claude session. */
12
+ const SUBCOMMANDS = ["fetch", "memtree-mcp", "link"];
13
+ const ENVIRONMENT_WORDS = ["local", "staging"];
14
+ /** The environment a leading `local`/`staging` word selects (else production). */
15
+ export function environmentOf(args) {
16
+ return args[0] === "local" ? "local" : args[0] === "staging" ? "staging" : "production";
17
+ }
18
+ /**
19
+ * A ccc subcommand and its arguments: the first word, or the word after
20
+ * `local`/`staging` (`ccc staging memtree-mcp` is the same server as
21
+ * `ccc memtree-mcp`; the environment is the proxy's, from its base URL).
22
+ */
23
+ export function subcommandArgs(args) {
24
+ const start = ENVIRONMENT_WORDS.includes(args[0] ?? "") ? 1 : 0;
25
+ const name = SUBCOMMANDS.find((command) => command === args[start]);
26
+ return name ? { name, args: args.slice(start + 1) } : undefined;
27
+ }
11
28
  /**
12
29
  * Consume ccc's own flags only before the conventional `--` separator. Values
13
30
  * after it are literal Claude arguments/prompts, even when they look like ccc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B,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AAC/B,CAAC;AAGD,MAAM,CAAC,MAAM,uBAAuB,GAAoC;IACtE,MAAM;IACN,SAAS;IACT,MAAM;IACN,SAAS;IACT,KAAK;CACN,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,2BAA2B,CACzC,KAAyB;IAEzB,MAAM,UAAU,GAAG,KAAK,EAAE,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC/C,OAAQ,uBAA6C,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC;QAC9E,CAAC,CAAE,UAAmC;QACtC,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAuB,EACvB,WAAiD,EACjD,SAAiB;IAEjB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;IACrD,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IACtD,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,GAAG,SAAS,EAAE,CAAC;QAC/C,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,oCAAoC,GAAG,2CAA2C,SAAS,GAAG,IAAI,IAAI;SAChH,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC"}
@@ -14,4 +14,8 @@ export interface SignalShutdownActions {
14
14
  * Dependencies are injected so this policy can be tested without process.exit.
15
15
  */
16
16
  export declare function createSignalShutdownHandler(actions: SignalShutdownActions): (signal: ShutdownSignal) => void;
17
+ /** Resolves once `text` is handed to the OS (or the write fails); never rejects. */
18
+ export declare function writeStdout(text: string, stream?: Pick<NodeJS.WriteStream, "write">): Promise<void>;
19
+ /** Waits for `pending` at most `ms`; a bound for cleanup that must not hang exit. */
20
+ export declare function settleWithin(pending: Promise<unknown>, ms: number): Promise<void>;
17
21
  //# sourceMappingURL=cli-lifecycle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-lifecycle.d.ts","sourceRoot":"","sources":["../src/cli-lifecycle.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElD,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,CAGhE;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,GAC5B,MAAM,CAGR;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,qBAAqB,GAC7B,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CASlC"}
1
+ {"version":3,"file":"cli-lifecycle.d.ts","sourceRoot":"","sources":["../src/cli-lifecycle.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,CAAC;AAElD,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,CAGhE;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,GAAG,IAAI,EACnB,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,IAAI,GAC5B,MAAM,CAGR;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,qBAAqB,GAC7B,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CASlC;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,OAAO,CAAkB,GACzD,OAAO,CAAC,IAAI,CAAC,CAQf;AAED,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQjF"}
@@ -27,4 +27,22 @@ export function createSignalShutdownHandler(actions) {
27
27
  actions.forceExit(code);
28
28
  };
29
29
  }
30
+ /** Resolves once `text` is handed to the OS (or the write fails); never rejects. */
31
+ export function writeStdout(text, stream = process.stdout) {
32
+ return new Promise((resolve) => {
33
+ try {
34
+ stream.write(text, () => resolve());
35
+ }
36
+ catch {
37
+ resolve();
38
+ }
39
+ });
40
+ }
41
+ /** Waits for `pending` at most `ms`; a bound for cleanup that must not hang exit. */
42
+ export function settleWithin(pending, ms) {
43
+ return new Promise((resolve) => {
44
+ const timer = setTimeout(resolve, ms);
45
+ pending.then(() => { clearTimeout(timer); resolve(); }, () => { clearTimeout(timer); resolve(); });
46
+ });
47
+ }
30
48
  //# sourceMappingURL=cli-lifecycle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-lifecycle.js","sourceRoot":"","sources":["../src/cli-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAA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