@use-aistack/cli 0.22.0 → 0.23.0

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.
package/README.md CHANGED
@@ -29,9 +29,9 @@ After a manual sync, the CLI offers auto-sync with three choices: Enable, Maybe
29
29
 
30
30
  #### Multiple Claude Code accounts
31
31
 
32
- Sync combines the local histories of your Claude Code profiles into one Claude Code reading. It discovers `~/.claude*` folders, `claude*` folders under `XDG_CONFIG_HOME` (default `~/.config`), nested `profiles/` and `accounts/` folders, and Claude Swap session profiles under `~/.claude-swap-backup` or `$XDG_DATA_HOME/claude-swap` (default `~/.local/share/claude-swap`). A profile contributes only its `projects/` transcripts. Discovery does not open credentials, and the published aggregates do not include account names.
32
+ Sync combines the local histories of your Claude Code profiles into one Claude Code reading. It discovers `~/.claude*` folders, `claude*` folders under `XDG_CONFIG_HOME` (default `~/.config`), nested `profiles/` and `accounts/` folders, Claude Swap session profiles under `~/.claude-swap-backup` or `$XDG_DATA_HOME/claude-swap` (default `~/.local/share/claude-swap`), cc-switch accounts under `~/.cc-switch/claude-accounts/*/config`, and CCS accounts. CCS keeps each account in `instances/<name>` and shared transcripts in `shared/context-groups/<group>` inside its own folder: `$CCS_DIR`, else `$CCS_HOME/.ccs`, else `~/.ccs`. A profile contributes only its `projects/` transcripts. Discovery does not open credentials, and the published aggregates do not include account names.
33
33
 
34
- `CLAUDE_CONFIG_DIR` can add custom locations as a comma-separated list. The default and discovered profiles still count when this variable is set, so running sync from an account-specific shell keeps the other accounts included. Linked transcript roots and copied records with the same Claude record UUID are counted once. A profile discovery error marks the reading as partial so previously published evidence is retained.
34
+ `CLAUDE_CONFIG_DIR` can add custom locations as a comma-separated list. The default and discovered profiles still count when this variable is set, so running sync from an account-specific shell keeps the other accounts included. A folder from `CLAUDE_CONFIG_DIR`, `CCS_DIR` or `CCS_HOME` that the names above do not reach, such as a shell alias that sets `CLAUDE_CONFIG_DIR=~/work/claude`, is remembered in `~/.config/aistack/harness-homes.json` the first time a sync sees it. Later syncs and auto-sync hooks from any shell read it too. The file stays on this machine. Linked transcript roots and copied records with the same Claude record UUID are counted once. A profile discovery error marks the reading as partial so previously published evidence is retained.
35
35
 
36
36
  #### Multiple accounts in other harnesses
37
37
 
@@ -73,6 +73,12 @@ The list is stored in `~/.config/aistack/harness-homes.json`. A folder found thr
73
73
 
74
74
  Each folder keeps its own account lookup and cache. A chat that appears in two folders, for example after you copied a folder, counts once, from the copy with the most messages. A folder that can't be read marks the Cursor reading as partial, so previously published evidence is retained. Folder paths stay on this machine.
75
75
 
76
+ #### Several accounts of one harness
77
+
78
+ When a harness keeps more than one account folder on this machine (two Claude Code profiles, a second Codex home, a second Cursor data folder), sync also records how each day's usage splits across those accounts: sessions, tokens by type, and tokens per model for each account. Each account is a random ID created on this machine and kept in `~/.config/aistack/accounts.json`. Folder paths, account names and emails stay on this machine. The split is stored for the stack owner, and no page shows it. A harness with one account sends no split. Antigravity keeps every signed-in account in one shared folder, so it always counts as one account.
79
+
80
+ A session copied into two account folders counts once, under the account whose copy holds its earliest record. When the copies are identical, the folder read first keeps it. A response copied into two folders counts under the copy the harness already keeps when it removes duplicates: Claude Code keeps the first copy read unless a later copy carries more tokens, Codex, Grok Build and Cursor keep the fullest copy of the whole session, and pi and opencode keep the first copy of each message.
81
+
76
82
  #### A sync that looks stuck
77
83
 
78
84
  The scan runs on this machine and can take a few minutes when a harness keeps a large history. Cursor is the usual case: its global `state.vscdb` grows past a gigabyte, and the session listing walks all of it before the first result. Every harness is checked at the same time and gets its own row with a progress bar, so one slow harness shows as one slow row while the others finish. To see each step as it starts, with its duration, run with `--verbose`:
@@ -107,7 +113,7 @@ npx @use-aistack/cli@latest sync --auto off # revoke
107
113
  npx @use-aistack/cli@latest sync --auto status # each folder's hook
108
114
  ```
109
115
 
110
- **Every account gets its own hook.** If you run several accounts of one harness, each account keeps its own folder, and `on` writes the hook into every one of them. A session in any account then triggers the sync. The folders are the same ones a sync reads: every Claude Code profile (`~/.claude*`, `CLAUDE_CONFIG_DIR`, and profiles folders), every Codex home (`~/.codex*` and `CODEX_HOME`), and every Grok Build home (`~/.grok*` and `GROK_HOME`). The interactive sync adds the hook to an account folder that appears later. `off` removes the hook from every folder this machine wrote it into, including a folder that only an environment variable in another shell names. The CLI records those folders in `~/.config/aistack/settings.json`, which stays on this machine.
116
+ **Every account gets its own hook.** If you run several accounts of one harness, each account keeps its own folder, and `on` writes the hook into every one of them. A session in any account then triggers the sync. The folders are the same ones a sync reads: every Claude Code profile (`~/.claude*`, `CLAUDE_CONFIG_DIR`, remembered folders, profiles folders, and CCS and cc-switch accounts), every Codex home (`~/.codex*` and `CODEX_HOME`), and every Grok Build home (`~/.grok*` and `GROK_HOME`). The interactive sync adds the hook to an account folder that appears later. `off` removes the hook from every folder this machine wrote it into, including a folder that only an environment variable in another shell names. The CLI records those folders in `~/.config/aistack/settings.json`, which stays on this machine.
111
117
 
112
118
  The hook text is identical in every folder and across CLI versions. Codex pins each hook by its file and its exact text, so **every newly hooked Codex home needs a one-time approval**: open Codex with that account and run `/hooks`. The CLI names each home that still needs it when it writes the hook, and the interactive sync repeats the reminder until Codex trusts it.
113
119