overclaude 1.0.0__tar.gz

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 (99) hide show
  1. overclaude-1.0.0/.gitignore +6 -0
  2. overclaude-1.0.0/LICENSE +21 -0
  3. overclaude-1.0.0/PKG-INFO +160 -0
  4. overclaude-1.0.0/README.md +140 -0
  5. overclaude-1.0.0/bin/swap-guard +352 -0
  6. overclaude-1.0.0/claude/ULTRACODE.md +79 -0
  7. overclaude-1.0.0/hooks/ctx-notify.sh +58 -0
  8. overclaude-1.0.0/hooks/ctx-watch.sh +79 -0
  9. overclaude-1.0.0/hooks/handoff-inject.sh +67 -0
  10. overclaude-1.0.0/install.sh +303 -0
  11. overclaude-1.0.0/pyproject.toml +73 -0
  12. overclaude-1.0.0/settings/settings-fragment.json +46 -0
  13. overclaude-1.0.0/shell/zshrc-snippet.sh +31 -0
  14. overclaude-1.0.0/skills/handoff/SKILL.md +79 -0
  15. overclaude-1.0.0/skills/swap/SKILL.md +99 -0
  16. overclaude-1.0.0/src/overclaude/__init__.py +1 -0
  17. overclaude-1.0.0/src/overclaude/cli.py +53 -0
  18. overclaude-1.0.0/statusline/statusline-command.sh +247 -0
  19. overclaude-1.0.0/uninstall.sh +166 -0
  20. overclaude-1.0.0/vendor/claude-swap/.github/ISSUE_TEMPLATE/bug_report.yml +47 -0
  21. overclaude-1.0.0/vendor/claude-swap/.github/ISSUE_TEMPLATE/config.yml +5 -0
  22. overclaude-1.0.0/vendor/claude-swap/.github/ISSUE_TEMPLATE/feature_request.yml +16 -0
  23. overclaude-1.0.0/vendor/claude-swap/.github/workflows/ci.yml +69 -0
  24. overclaude-1.0.0/vendor/claude-swap/.github/workflows/publish.yml +28 -0
  25. overclaude-1.0.0/vendor/claude-swap/.gitignore +13 -0
  26. overclaude-1.0.0/vendor/claude-swap/.python-version +1 -0
  27. overclaude-1.0.0/vendor/claude-swap/.vscode/launch.json +60 -0
  28. overclaude-1.0.0/vendor/claude-swap/LICENSE +21 -0
  29. overclaude-1.0.0/vendor/claude-swap/PKG-INFO +391 -0
  30. overclaude-1.0.0/vendor/claude-swap/README.md +360 -0
  31. overclaude-1.0.0/vendor/claude-swap/assets/tui-watch.png +0 -0
  32. overclaude-1.0.0/vendor/claude-swap/pyproject.toml +58 -0
  33. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/__init__.py +9 -0
  34. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/__main__.py +6 -0
  35. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/autoswitch.py +1232 -0
  36. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/cache.py +44 -0
  37. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/claude_locks.py +147 -0
  38. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/cli.py +1210 -0
  39. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/credentials.py +1026 -0
  40. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/exceptions.py +96 -0
  41. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/json_output.py +180 -0
  42. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/locking.py +83 -0
  43. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/logging_config.py +64 -0
  44. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/macos_keychain.py +226 -0
  45. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/mappings.py +141 -0
  46. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/menubar.py +857 -0
  47. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/migrations.py +536 -0
  48. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/models.py +211 -0
  49. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/oauth.py +666 -0
  50. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/paths.py +201 -0
  51. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/poll_policy.py +203 -0
  52. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/printer.py +205 -0
  53. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/process_detection.py +146 -0
  54. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/session.py +1066 -0
  55. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/settings.py +425 -0
  56. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/snapshot_source.py +42 -0
  57. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/switcher.py +4264 -0
  58. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/transfer.py +552 -0
  59. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/tui/__init__.py +27 -0
  60. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/tui/app.py +290 -0
  61. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/tui/autoview.py +320 -0
  62. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/tui/cswap.tcss +202 -0
  63. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/tui/dashboard.py +403 -0
  64. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/tui/data.py +194 -0
  65. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/tui/modals.py +159 -0
  66. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/tui/theme.py +67 -0
  67. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/tui/widgets.py +369 -0
  68. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/update_check.py +135 -0
  69. overclaude-1.0.0/vendor/claude-swap/src/claude_swap/usage_store.py +526 -0
  70. overclaude-1.0.0/vendor/claude-swap/tests/__init__.py +1 -0
  71. overclaude-1.0.0/vendor/claude-swap/tests/conftest.py +284 -0
  72. overclaude-1.0.0/vendor/claude-swap/tests/fixtures/sample_config.json +10 -0
  73. overclaude-1.0.0/vendor/claude-swap/tests/test_api_key_accounts.py +370 -0
  74. overclaude-1.0.0/vendor/claude-swap/tests/test_autoswitch.py +1878 -0
  75. overclaude-1.0.0/vendor/claude-swap/tests/test_cache.py +72 -0
  76. overclaude-1.0.0/vendor/claude-swap/tests/test_claude_locks.py +99 -0
  77. overclaude-1.0.0/vendor/claude-swap/tests/test_cli.py +1493 -0
  78. overclaude-1.0.0/vendor/claude-swap/tests/test_config_cli.py +269 -0
  79. overclaude-1.0.0/vendor/claude-swap/tests/test_json_output.py +590 -0
  80. overclaude-1.0.0/vendor/claude-swap/tests/test_locking.py +162 -0
  81. overclaude-1.0.0/vendor/claude-swap/tests/test_logging_config.py +59 -0
  82. overclaude-1.0.0/vendor/claude-swap/tests/test_macos_keychain.py +212 -0
  83. overclaude-1.0.0/vendor/claude-swap/tests/test_macos_keychain_contract.py +283 -0
  84. overclaude-1.0.0/vendor/claude-swap/tests/test_mappings.py +185 -0
  85. overclaude-1.0.0/vendor/claude-swap/tests/test_menubar.py +440 -0
  86. overclaude-1.0.0/vendor/claude-swap/tests/test_migrations.py +596 -0
  87. overclaude-1.0.0/vendor/claude-swap/tests/test_oauth.py +1379 -0
  88. overclaude-1.0.0/vendor/claude-swap/tests/test_paths.py +316 -0
  89. overclaude-1.0.0/vendor/claude-swap/tests/test_poll_policy.py +201 -0
  90. overclaude-1.0.0/vendor/claude-swap/tests/test_printer.py +181 -0
  91. overclaude-1.0.0/vendor/claude-swap/tests/test_process_detection.py +356 -0
  92. overclaude-1.0.0/vendor/claude-swap/tests/test_session.py +1614 -0
  93. overclaude-1.0.0/vendor/claude-swap/tests/test_settings.py +232 -0
  94. overclaude-1.0.0/vendor/claude-swap/tests/test_switcher.py +6472 -0
  95. overclaude-1.0.0/vendor/claude-swap/tests/test_transfer.py +1510 -0
  96. overclaude-1.0.0/vendor/claude-swap/tests/test_tui.py +1282 -0
  97. overclaude-1.0.0/vendor/claude-swap/tests/test_update_check.py +297 -0
  98. overclaude-1.0.0/vendor/claude-swap/tests/test_usage_store.py +505 -0
  99. overclaude-1.0.0/vendor/claude-swap/uv.lock +451 -0
@@ -0,0 +1,6 @@
1
+ dist/
2
+ build/
3
+ *.egg-info/
4
+ __pycache__/
5
+ *.pyc
6
+ .venv/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 arthur-bump-pm
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: overclaude
3
+ Version: 1.0.0
4
+ Summary: Claude Code, overclocked — multi-account hot-swap, context-threshold handoff, instrumented statusline, and model routing for multi-agent workflows
5
+ Project-URL: Homepage, https://github.com/arthur-bump-pm/overclaude
6
+ Project-URL: Repository, https://github.com/arthur-bump-pm/overclaude
7
+ Project-URL: Issues, https://github.com/arthur-bump-pm/overclaude/issues
8
+ Author: arthur-bump-pm
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: claude,claude-code,cli,dotfiles
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: MacOS
17
+ Classifier: Programming Language :: Python :: 3
18
+ Requires-Python: >=3.9
19
+ Description-Content-Type: text/markdown
20
+
21
+ # overclaude
22
+
23
+ **Claude Code, overclocked.** A portable kit that turns a stock Claude Code install into a multi-account, context-aware, model-routed setup: hot-swap between Claude accounts without leaving your session, hand off to a fresh session before context fills up, watch every usage meter in the statusline, and route multi-agent workflow subagents to the right model tier automatically.
24
+
25
+ Clone it, run the installer, register your accounts — same setup on any Mac.
26
+
27
+ ```
28
+ Fable 5 (high) | myproject (master*) | 3 sessions | 👤 work [1/2]
29
+ ctx [████░░░░░░] 42% | 5h [███████░░░] 71% | week [██░░░░░░░░] 18% | Fable [███████░░░] 73%
30
+ ```
31
+
32
+ ## Features
33
+
34
+ ### `/swap` — hot account switching
35
+ Switch which Claude account serves your sessions **without restarting anything**. Every live Claude Code session on the machine (CLI, VS Code, background) adopts the new credential within ~30 seconds, mid-conversation, full context preserved. Hit a rate limit on one account? `/swap work` and keep typing.
36
+
37
+ - `/swap` — dashboard: accounts, aliases, token health, per-account 5h/7d/scoped usage, live-session table
38
+ - `/swap <target>` — hot-swap (guarded: refuses if another session is mid-task, unless you `force`)
39
+ - `/swap <target> handoff` — switch accounts AND continue in a fresh session with packaged context
40
+ - `/swap <target> restart` — rare escape hatch for model-entitlement mismatches or wedged auth
41
+ - `/swap add` — guided registration of a new account
42
+
43
+ A busy-session preflight protects you from yanking credentials out from under an active session. Sessions too old to report status are judged by transcript activity instead of being assumed busy.
44
+
45
+ ### `/handoff` — context-threshold session handoff
46
+ When a session's context crosses **60% / 75% / 85%**, Claude offers a handoff: it packages goals, state, decisions, files touched, and next steps into a structured document, then a fresh session auto-loads it via a SessionStart hook. You lose the token bloat, not the thread. Works same-account (`/handoff`) or combined with an account switch (`/swap <target> handoff`). Also: `/handoff status`, `/handoff cancel`.
47
+
48
+ ### Instrumented statusline
49
+ Two lines, everything you actually check: model + effort, folder (git branch, dirty marker), live session count, active account `[slot/total]`, then four 10-char meters — **context window, 5-hour limit, weekly limit, and your model-scoped (Fable) bucket** — green/yellow/red at 50/80%. The statusline is also the data spine: it publishes each session's context % to a relay file the threshold hooks read.
50
+
51
+ ### `ULTRACODE.md` — model routing for multi-agent workflows
52
+ A policy document loaded into every session that teaches the orchestrator to route workflow subagents by task: haiku/sonnet for bulk scouting and finding, opus for verification and judging, the top tier reserved for final synthesis and tie-breaks. Core rule: *spend the scarce model only where judgment is the bottleneck, never where volume is.* Includes a routing table, hard floors that never get downgraded, escalation rules, and a pre-dispatch lint.
53
+
54
+ ## Requirements
55
+
56
+ - macOS (scripts use BSD `stat -f`, `shasum`), zsh
57
+ - `jq`, `git`, `pipx`
58
+ - [Claude Code](https://claude.com/claude-code) — tested on 2.1.212; the session-registry `status` field needs ~2.1.211+
59
+ - Claude subscription accounts (Max-style) — the rate-limit meters read subscription usage buckets
60
+
61
+ The credential-switching engine, **cswap**, ships with the kit as a full source tree (`vendor/claude-swap/`, v0.21.0) and is installed automatically by `install.sh` via pipx or uv — no separate install step. See [Credits](#credits).
62
+
63
+ ## Install
64
+
65
+ ### One-liner (pipx or uv)
66
+
67
+ ```bash
68
+ pipx install overclaude && overclaude install
69
+ # or
70
+ uv tool install overclaude && overclaude install
71
+ ```
72
+
73
+ The package carries the full kit (including the bundled cswap), so this is everything. The `overclaude` command stays around for later: `overclaude install` (refresh after an upgrade), `overclaude uninstall`, `overclaude path`, `overclaude version`. Upgrade with `pipx upgrade overclaude` / `uv tool upgrade overclaude`.
74
+
75
+ To track the latest unreleased main instead: `pipx install git+https://github.com/arthur-bump-pm/overclaude.git`.
76
+
77
+ ### From a clone
78
+
79
+ ```bash
80
+ git clone https://github.com/arthur-bump-pm/overclaude.git
81
+ cd overclaude
82
+ ./install.sh
83
+ ```
84
+
85
+ Use the clone if you want to hack on the kit — `sync.sh` (live-setup → repo → push) only works from a git clone.
86
+
87
+ The installer is **idempotent and conservative**: every modified file gets a timestamped backup, your existing `settings.json` content (other hooks, permissions) is preserved by a jq merge, an existing statusLine is never overwritten (you get instructions instead), and re-running is a no-op.
88
+
89
+ The installer also sets up cswap from the bundled copy if it isn't on the machine yet (needs `pipx`; Python dependencies are resolved from PyPI).
90
+
91
+ ### Or just ask Claude
92
+
93
+ If Claude Code is already running on the machine, paste this and let it do the work:
94
+
95
+ > Clone https://github.com/arthur-bump-pm/overclaude, read its README, run ./install.sh, and fix anything the preflight complains about (jq, pipx, PATH). Then tell me what post-install steps I need to do myself.
96
+
97
+ Claude will run the installer, resolve missing dependencies, and hand you back the two things only you can do: registering accounts (`cswap add` needs you to `/login` as each account) and restarting sessions. After a restart, `/swap add` gives you a guided flow for registering additional accounts from inside Claude Code.
98
+
99
+ Post-install:
100
+
101
+ 1. Register accounts: `cswap add` (repeat per account), then alias them: `cswap alias 1 work`, `cswap alias 2 personal`
102
+ 2. Open a new shell (or `source ~/.zshrc`)
103
+ 3. Start a **new** Claude Code session — hooks and statusline load at session start
104
+ 4. Verify: `swap-guard whoami` prints your session JSON; the statusline shows `👤 <alias> [n/N]` and four meters
105
+
106
+ ## Components
107
+
108
+ | File | Installs to | What it does |
109
+ |---|---|---|
110
+ | `bin/swap-guard` | `~/.local/bin/` | State/guard engine: `whoami`, live-session table, busy-preflight for swaps, per-directory handoff state, relay status |
111
+ | `skills/swap/SKILL.md` | `~/.claude/skills/swap/` | The `/swap` skill: dashboard, guarded hot-swap, handoff/restart modes, account registration |
112
+ | `skills/handoff/SKILL.md` | `~/.claude/skills/handoff/` | The `/handoff` skill: context packaging, relaunch flags, status/cancel |
113
+ | `hooks/handoff-inject.sh` | `~/.claude/hooks/` | SessionStart: auto-loads a pending handoff package into the new session (10-min TTL, per-directory) |
114
+ | `hooks/ctx-watch.sh` | `~/.claude/hooks/` | UserPromptSubmit: fires the 60/75/85% handoff offers, with re-arm hysteresis |
115
+ | `hooks/ctx-notify.sh` | `~/.claude/hooks/` | Stop: threshold banner notifications |
116
+ | `statusline/statusline-command.sh` | `~/.claude/statusline-command.sh` | Renders the statusline; publishes the context relay the hooks depend on |
117
+ | `claude/ULTRACODE.md` | `~/.claude/` + import in `CLAUDE.md` | Model/effort routing policy for multi-agent workflows |
118
+ | `settings/settings-fragment.json` | merged into `~/.claude/settings.json` | 3 hook groups, statusLine block, 2 permission allows |
119
+ | `shell/zshrc-snippet.sh` | appended to `~/.zshrc` (markers) | `claude()` wrapper honoring handoff/restart relaunch flags, `swap` alias, PATH guard |
120
+ | `vendor/claude-swap/` | pipx/uv-installed if `cswap` absent | The bundled credential-switching engine, full source (see [Credits](#credits)) |
121
+
122
+ ## Behaviors & caveats — read these
123
+
124
+ - **A swap flips ALL live Claude Code sessions on the machine** within ~30s. It's the shared keychain credential, not per-terminal.
125
+ - **Hooks load at session start.** Sessions already running at install time won't offer handoffs until restarted; a plain hot-swap works everywhere immediately.
126
+ - **The kit's statusline is a hard dependency for the handoff offers** — it publishes the context relay that `ctx-watch`/`ctx-notify` read. If the installer skipped it because you already had a statusLine, either switch (`.statusLine.command` → `bash ~/.claude/statusline-command.sh`) or merge the relay block into your own script; otherwise threshold prompts silently never fire.
127
+ - The **Fable/scoped meter reads cswap's cache**, refreshed whenever cswap runs (any `/swap` dashboard, switch, or `cswap list`) — it can lag between invocations. The 5h/week meters describe the account that served the last response, so they lag ~1 turn right after a swap; the 👤 segment is always current.
128
+ - Statusless legacy clients (older VS Code extension builds) are judged busy/idle by **transcript mtime** (2-min window) during swap preflight.
129
+ - **claude.ai connectors (Gmail/Drive/…) are per-account server-side** — they don't follow a swap.
130
+ - Context thresholds re-arm if usage drops 10 points below the fired threshold; Claude Code's auto-compact (~92%) remains the backstop.
131
+ - The `swap` shell alias (`cswap switch`) works from any terminal even when sessions are hard rate-limited — the panic path when a session can't complete its own `/swap` turn.
132
+
133
+ ## Keeping the repo in sync with your live setup
134
+
135
+ Improve your live setup (statusline tweaks, skill edits, ULTRACODE changes), then:
136
+
137
+ ```bash
138
+ ./sync.sh # live files -> repo, scrub-check, show diff, commit, push
139
+ ./sync.sh --dry-run # just show what would change
140
+ ```
141
+
142
+ `sync.sh` copies the live files back into the repo layout, extracts your current zshrc block, **aborts if the diff contains personal data** (usernames, emails, `/Users/...` paths), and only then commits and pushes. On other machines: `git pull && ./install.sh` (no-ops everything unchanged).
143
+
144
+ `settings/settings-fragment.json` is curated by hand — if you add hooks or permissions the kit should ship, edit the fragment directly.
145
+
146
+ ## Uninstall
147
+
148
+ ```bash
149
+ ./uninstall.sh
150
+ ```
151
+
152
+ Removes installed files, deletes the zshrc block, removes the `@ULTRACODE.md` import, and strips exactly the kit's entries from `settings.json` (your other settings survive; everything edited is backed up first). Runtime state in `~/.claude-swap-backup/` (cswap credentials/cache, handoff archives) is deliberately left — delete it manually for a clean slate. cswap itself, if the installer set it up, is removed with `pipx uninstall claude-swap`.
153
+
154
+ ## Credits
155
+
156
+ The account-switching engine bundled in `vendor/claude-swap/` is **[claude-swap](https://github.com/realiti4/claude-swap)** by [Onur Cetinkol](https://github.com/realiti4) (MIT license) — the complete, unmodified v0.21.0 source as published to [PyPI](https://pypi.org/project/claude-swap/). overclaude's swap/handoff layer, statusline, hooks, and routing policy are built around it — cswap does the hard, careful work of credential storage, keychain switching, OAuth refresh, and usage polling. Go star it.
157
+
158
+ ## License
159
+
160
+ MIT — see [LICENSE](LICENSE). The vendored claude-swap package retains its own MIT license and copyright (Onur Cetinkol).
@@ -0,0 +1,140 @@
1
+ # overclaude
2
+
3
+ **Claude Code, overclocked.** A portable kit that turns a stock Claude Code install into a multi-account, context-aware, model-routed setup: hot-swap between Claude accounts without leaving your session, hand off to a fresh session before context fills up, watch every usage meter in the statusline, and route multi-agent workflow subagents to the right model tier automatically.
4
+
5
+ Clone it, run the installer, register your accounts — same setup on any Mac.
6
+
7
+ ```
8
+ Fable 5 (high) | myproject (master*) | 3 sessions | 👤 work [1/2]
9
+ ctx [████░░░░░░] 42% | 5h [███████░░░] 71% | week [██░░░░░░░░] 18% | Fable [███████░░░] 73%
10
+ ```
11
+
12
+ ## Features
13
+
14
+ ### `/swap` — hot account switching
15
+ Switch which Claude account serves your sessions **without restarting anything**. Every live Claude Code session on the machine (CLI, VS Code, background) adopts the new credential within ~30 seconds, mid-conversation, full context preserved. Hit a rate limit on one account? `/swap work` and keep typing.
16
+
17
+ - `/swap` — dashboard: accounts, aliases, token health, per-account 5h/7d/scoped usage, live-session table
18
+ - `/swap <target>` — hot-swap (guarded: refuses if another session is mid-task, unless you `force`)
19
+ - `/swap <target> handoff` — switch accounts AND continue in a fresh session with packaged context
20
+ - `/swap <target> restart` — rare escape hatch for model-entitlement mismatches or wedged auth
21
+ - `/swap add` — guided registration of a new account
22
+
23
+ A busy-session preflight protects you from yanking credentials out from under an active session. Sessions too old to report status are judged by transcript activity instead of being assumed busy.
24
+
25
+ ### `/handoff` — context-threshold session handoff
26
+ When a session's context crosses **60% / 75% / 85%**, Claude offers a handoff: it packages goals, state, decisions, files touched, and next steps into a structured document, then a fresh session auto-loads it via a SessionStart hook. You lose the token bloat, not the thread. Works same-account (`/handoff`) or combined with an account switch (`/swap <target> handoff`). Also: `/handoff status`, `/handoff cancel`.
27
+
28
+ ### Instrumented statusline
29
+ Two lines, everything you actually check: model + effort, folder (git branch, dirty marker), live session count, active account `[slot/total]`, then four 10-char meters — **context window, 5-hour limit, weekly limit, and your model-scoped (Fable) bucket** — green/yellow/red at 50/80%. The statusline is also the data spine: it publishes each session's context % to a relay file the threshold hooks read.
30
+
31
+ ### `ULTRACODE.md` — model routing for multi-agent workflows
32
+ A policy document loaded into every session that teaches the orchestrator to route workflow subagents by task: haiku/sonnet for bulk scouting and finding, opus for verification and judging, the top tier reserved for final synthesis and tie-breaks. Core rule: *spend the scarce model only where judgment is the bottleneck, never where volume is.* Includes a routing table, hard floors that never get downgraded, escalation rules, and a pre-dispatch lint.
33
+
34
+ ## Requirements
35
+
36
+ - macOS (scripts use BSD `stat -f`, `shasum`), zsh
37
+ - `jq`, `git`, `pipx`
38
+ - [Claude Code](https://claude.com/claude-code) — tested on 2.1.212; the session-registry `status` field needs ~2.1.211+
39
+ - Claude subscription accounts (Max-style) — the rate-limit meters read subscription usage buckets
40
+
41
+ The credential-switching engine, **cswap**, ships with the kit as a full source tree (`vendor/claude-swap/`, v0.21.0) and is installed automatically by `install.sh` via pipx or uv — no separate install step. See [Credits](#credits).
42
+
43
+ ## Install
44
+
45
+ ### One-liner (pipx or uv)
46
+
47
+ ```bash
48
+ pipx install overclaude && overclaude install
49
+ # or
50
+ uv tool install overclaude && overclaude install
51
+ ```
52
+
53
+ The package carries the full kit (including the bundled cswap), so this is everything. The `overclaude` command stays around for later: `overclaude install` (refresh after an upgrade), `overclaude uninstall`, `overclaude path`, `overclaude version`. Upgrade with `pipx upgrade overclaude` / `uv tool upgrade overclaude`.
54
+
55
+ To track the latest unreleased main instead: `pipx install git+https://github.com/arthur-bump-pm/overclaude.git`.
56
+
57
+ ### From a clone
58
+
59
+ ```bash
60
+ git clone https://github.com/arthur-bump-pm/overclaude.git
61
+ cd overclaude
62
+ ./install.sh
63
+ ```
64
+
65
+ Use the clone if you want to hack on the kit — `sync.sh` (live-setup → repo → push) only works from a git clone.
66
+
67
+ The installer is **idempotent and conservative**: every modified file gets a timestamped backup, your existing `settings.json` content (other hooks, permissions) is preserved by a jq merge, an existing statusLine is never overwritten (you get instructions instead), and re-running is a no-op.
68
+
69
+ The installer also sets up cswap from the bundled copy if it isn't on the machine yet (needs `pipx`; Python dependencies are resolved from PyPI).
70
+
71
+ ### Or just ask Claude
72
+
73
+ If Claude Code is already running on the machine, paste this and let it do the work:
74
+
75
+ > Clone https://github.com/arthur-bump-pm/overclaude, read its README, run ./install.sh, and fix anything the preflight complains about (jq, pipx, PATH). Then tell me what post-install steps I need to do myself.
76
+
77
+ Claude will run the installer, resolve missing dependencies, and hand you back the two things only you can do: registering accounts (`cswap add` needs you to `/login` as each account) and restarting sessions. After a restart, `/swap add` gives you a guided flow for registering additional accounts from inside Claude Code.
78
+
79
+ Post-install:
80
+
81
+ 1. Register accounts: `cswap add` (repeat per account), then alias them: `cswap alias 1 work`, `cswap alias 2 personal`
82
+ 2. Open a new shell (or `source ~/.zshrc`)
83
+ 3. Start a **new** Claude Code session — hooks and statusline load at session start
84
+ 4. Verify: `swap-guard whoami` prints your session JSON; the statusline shows `👤 <alias> [n/N]` and four meters
85
+
86
+ ## Components
87
+
88
+ | File | Installs to | What it does |
89
+ |---|---|---|
90
+ | `bin/swap-guard` | `~/.local/bin/` | State/guard engine: `whoami`, live-session table, busy-preflight for swaps, per-directory handoff state, relay status |
91
+ | `skills/swap/SKILL.md` | `~/.claude/skills/swap/` | The `/swap` skill: dashboard, guarded hot-swap, handoff/restart modes, account registration |
92
+ | `skills/handoff/SKILL.md` | `~/.claude/skills/handoff/` | The `/handoff` skill: context packaging, relaunch flags, status/cancel |
93
+ | `hooks/handoff-inject.sh` | `~/.claude/hooks/` | SessionStart: auto-loads a pending handoff package into the new session (10-min TTL, per-directory) |
94
+ | `hooks/ctx-watch.sh` | `~/.claude/hooks/` | UserPromptSubmit: fires the 60/75/85% handoff offers, with re-arm hysteresis |
95
+ | `hooks/ctx-notify.sh` | `~/.claude/hooks/` | Stop: threshold banner notifications |
96
+ | `statusline/statusline-command.sh` | `~/.claude/statusline-command.sh` | Renders the statusline; publishes the context relay the hooks depend on |
97
+ | `claude/ULTRACODE.md` | `~/.claude/` + import in `CLAUDE.md` | Model/effort routing policy for multi-agent workflows |
98
+ | `settings/settings-fragment.json` | merged into `~/.claude/settings.json` | 3 hook groups, statusLine block, 2 permission allows |
99
+ | `shell/zshrc-snippet.sh` | appended to `~/.zshrc` (markers) | `claude()` wrapper honoring handoff/restart relaunch flags, `swap` alias, PATH guard |
100
+ | `vendor/claude-swap/` | pipx/uv-installed if `cswap` absent | The bundled credential-switching engine, full source (see [Credits](#credits)) |
101
+
102
+ ## Behaviors & caveats — read these
103
+
104
+ - **A swap flips ALL live Claude Code sessions on the machine** within ~30s. It's the shared keychain credential, not per-terminal.
105
+ - **Hooks load at session start.** Sessions already running at install time won't offer handoffs until restarted; a plain hot-swap works everywhere immediately.
106
+ - **The kit's statusline is a hard dependency for the handoff offers** — it publishes the context relay that `ctx-watch`/`ctx-notify` read. If the installer skipped it because you already had a statusLine, either switch (`.statusLine.command` → `bash ~/.claude/statusline-command.sh`) or merge the relay block into your own script; otherwise threshold prompts silently never fire.
107
+ - The **Fable/scoped meter reads cswap's cache**, refreshed whenever cswap runs (any `/swap` dashboard, switch, or `cswap list`) — it can lag between invocations. The 5h/week meters describe the account that served the last response, so they lag ~1 turn right after a swap; the 👤 segment is always current.
108
+ - Statusless legacy clients (older VS Code extension builds) are judged busy/idle by **transcript mtime** (2-min window) during swap preflight.
109
+ - **claude.ai connectors (Gmail/Drive/…) are per-account server-side** — they don't follow a swap.
110
+ - Context thresholds re-arm if usage drops 10 points below the fired threshold; Claude Code's auto-compact (~92%) remains the backstop.
111
+ - The `swap` shell alias (`cswap switch`) works from any terminal even when sessions are hard rate-limited — the panic path when a session can't complete its own `/swap` turn.
112
+
113
+ ## Keeping the repo in sync with your live setup
114
+
115
+ Improve your live setup (statusline tweaks, skill edits, ULTRACODE changes), then:
116
+
117
+ ```bash
118
+ ./sync.sh # live files -> repo, scrub-check, show diff, commit, push
119
+ ./sync.sh --dry-run # just show what would change
120
+ ```
121
+
122
+ `sync.sh` copies the live files back into the repo layout, extracts your current zshrc block, **aborts if the diff contains personal data** (usernames, emails, `/Users/...` paths), and only then commits and pushes. On other machines: `git pull && ./install.sh` (no-ops everything unchanged).
123
+
124
+ `settings/settings-fragment.json` is curated by hand — if you add hooks or permissions the kit should ship, edit the fragment directly.
125
+
126
+ ## Uninstall
127
+
128
+ ```bash
129
+ ./uninstall.sh
130
+ ```
131
+
132
+ Removes installed files, deletes the zshrc block, removes the `@ULTRACODE.md` import, and strips exactly the kit's entries from `settings.json` (your other settings survive; everything edited is backed up first). Runtime state in `~/.claude-swap-backup/` (cswap credentials/cache, handoff archives) is deliberately left — delete it manually for a clean slate. cswap itself, if the installer set it up, is removed with `pipx uninstall claude-swap`.
133
+
134
+ ## Credits
135
+
136
+ The account-switching engine bundled in `vendor/claude-swap/` is **[claude-swap](https://github.com/realiti4/claude-swap)** by [Onur Cetinkol](https://github.com/realiti4) (MIT license) — the complete, unmodified v0.21.0 source as published to [PyPI](https://pypi.org/project/claude-swap/). overclaude's swap/handoff layer, statusline, hooks, and routing policy are built around it — cswap does the hard, careful work of credential storage, keychain switching, OAuth refresh, and usage polling. Go star it.
137
+
138
+ ## License
139
+
140
+ MIT — see [LICENSE](LICENSE). The vendored claude-swap package retains its own MIT license and copyright (Onur Cetinkol).