archeus 2.0.0__py3-none-any.whl

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 (116) hide show
  1. archeus-2.0.0.dist-info/METADATA +229 -0
  2. archeus-2.0.0.dist-info/RECORD +116 -0
  3. archeus-2.0.0.dist-info/WHEEL +5 -0
  4. archeus-2.0.0.dist-info/entry_points.txt +2 -0
  5. archeus-2.0.0.dist-info/licenses/LICENSE +21 -0
  6. archeus-2.0.0.dist-info/top_level.txt +1 -0
  7. claude_sessions/__init__.py +0 -0
  8. claude_sessions/__main__.py +48 -0
  9. claude_sessions/accounts.py +189 -0
  10. claude_sessions/agentnudge_hook.py +112 -0
  11. claude_sessions/agents.py +975 -0
  12. claude_sessions/automode.py +238 -0
  13. claude_sessions/brief.py +439 -0
  14. claude_sessions/ccsettings.py +267 -0
  15. claude_sessions/checkpoints.py +150 -0
  16. claude_sessions/claude_md.py +1257 -0
  17. claude_sessions/cli.py +116 -0
  18. claude_sessions/clientstate.py +338 -0
  19. claude_sessions/concise_hook.py +43 -0
  20. claude_sessions/config.py +1075 -0
  21. claude_sessions/connections.py +1048 -0
  22. claude_sessions/context_inject.py +167 -0
  23. claude_sessions/conventions.py +254 -0
  24. claude_sessions/ctxaudit.py +328 -0
  25. claude_sessions/denygen.py +133 -0
  26. claude_sessions/diffview.py +310 -0
  27. claude_sessions/diskgc.py +178 -0
  28. claude_sessions/events.py +220 -0
  29. claude_sessions/failover.py +582 -0
  30. claude_sessions/guard_hook.py +58 -0
  31. claude_sessions/gui.py +854 -0
  32. claude_sessions/gui_api.py +3810 -0
  33. claude_sessions/gui_html.py +73 -0
  34. claude_sessions/gui_qt.py +116 -0
  35. claude_sessions/health.py +222 -0
  36. claude_sessions/hookrules.py +31 -0
  37. claude_sessions/hooks.py +900 -0
  38. claude_sessions/jsonstore.py +83 -0
  39. claude_sessions/lessons.py +317 -0
  40. claude_sessions/logbash_hook.py +113 -0
  41. claude_sessions/loops.py +529 -0
  42. claude_sessions/main.py +946 -0
  43. claude_sessions/mcp.py +372 -0
  44. claude_sessions/memdirty_hook.py +92 -0
  45. claude_sessions/memhub.py +294 -0
  46. claude_sessions/memory.py +1629 -0
  47. claude_sessions/memrules.py +157 -0
  48. claude_sessions/migrate.py +386 -0
  49. claude_sessions/minimalcode_hook.py +43 -0
  50. claude_sessions/models.py +280 -0
  51. claude_sessions/notify.py +116 -0
  52. claude_sessions/omniroute.py +524 -0
  53. claude_sessions/outputstyles.py +288 -0
  54. claude_sessions/paths.py +132 -0
  55. claude_sessions/plan_execute.py +669 -0
  56. claude_sessions/plugins.py +276 -0
  57. claude_sessions/proc.py +278 -0
  58. claude_sessions/provision.py +313 -0
  59. claude_sessions/quota.py +345 -0
  60. claude_sessions/recall.py +548 -0
  61. claude_sessions/recall_hook.py +80 -0
  62. claude_sessions/render.py +308 -0
  63. claude_sessions/repos.py +319 -0
  64. claude_sessions/review.py +267 -0
  65. claude_sessions/search.py +100 -0
  66. claude_sessions/session_menu.py +721 -0
  67. claude_sessions/sessions.py +552 -0
  68. claude_sessions/skills.py +797 -0
  69. claude_sessions/skills_templates/changelog/SKILL.md +26 -0
  70. claude_sessions/skills_templates/code-explainer/SKILL.md +26 -0
  71. claude_sessions/skills_templates/commit-message/SKILL.md +25 -0
  72. claude_sessions/skills_templates/pr-description/SKILL.md +40 -0
  73. claude_sessions/skills_templates/refactor-planner/SKILL.md +27 -0
  74. claude_sessions/skills_templates/security-review/SKILL.md +31 -0
  75. claude_sessions/skills_templates/test-writer/SKILL.md +29 -0
  76. claude_sessions/skills_templates/token-economy/SKILL.md +29 -0
  77. claude_sessions/skillscan.py +232 -0
  78. claude_sessions/stats.py +635 -0
  79. claude_sessions/statusline.py +550 -0
  80. claude_sessions/statusline_cli.py +32 -0
  81. claude_sessions/store.py +80 -0
  82. claude_sessions/system_prompt.py +160 -0
  83. claude_sessions/term.py +198 -0
  84. claude_sessions/testfilter_filter.py +47 -0
  85. claude_sessions/testfilter_hook.py +61 -0
  86. claude_sessions/themes.py +840 -0
  87. claude_sessions/transcript.py +236 -0
  88. claude_sessions/transcripts.py +87 -0
  89. claude_sessions/ui.py +1575 -0
  90. claude_sessions/usage.py +433 -0
  91. claude_sessions/versions.py +699 -0
  92. claude_sessions/web/app.css +1966 -0
  93. claude_sessions/web/app.js +6264 -0
  94. claude_sessions/web/index.html +245 -0
  95. claude_sessions/web/instruments.js +523 -0
  96. claude_sessions/web/motion.js +711 -0
  97. claude_sessions/web/stage.js +1165 -0
  98. claude_sessions/web/vendor/LICENSE-anime.txt +9 -0
  99. claude_sessions/web/vendor/LICENSE-three.txt +21 -0
  100. claude_sessions/web/vendor/anime.esm.min.js +7 -0
  101. claude_sessions/web/vendor/postprocessing/EffectComposer.js +365 -0
  102. claude_sessions/web/vendor/postprocessing/MaskPass.js +195 -0
  103. claude_sessions/web/vendor/postprocessing/OutputPass.js +148 -0
  104. claude_sessions/web/vendor/postprocessing/Pass.js +191 -0
  105. claude_sessions/web/vendor/postprocessing/RenderPass.js +193 -0
  106. claude_sessions/web/vendor/postprocessing/ShaderPass.js +135 -0
  107. claude_sessions/web/vendor/postprocessing/UnrealBloomPass.js +524 -0
  108. claude_sessions/web/vendor/shaders/CopyShader.js +52 -0
  109. claude_sessions/web/vendor/shaders/LuminosityHighPassShader.js +68 -0
  110. claude_sessions/web/vendor/shaders/OutputShader.js +103 -0
  111. claude_sessions/web/vendor/three.core.min.js +6 -0
  112. claude_sessions/web/vendor/three.module.min.js +6 -0
  113. claude_sessions/worklog.py +133 -0
  114. claude_sessions/worklog_hook.py +91 -0
  115. claude_sessions/workspace.py +838 -0
  116. claude_sessions/worktrees.py +303 -0
@@ -0,0 +1,229 @@
1
+ Metadata-Version: 2.4
2
+ Name: archeus
3
+ Version: 2.0.0
4
+ Summary: The workspace layer for Claude Code - persistent project memory, an interactive architecture graph, MCP awareness, and per-project launch control in a fast terminal UI
5
+ Author: Babar Muhammad Anas
6
+ License: MIT
7
+ Project-URL: Homepage, https://claudectl.space
8
+ Project-URL: Documentation, https://docs.claudectl.space/
9
+ Project-URL: Repository, https://github.com/babarmuhammad/archeus
10
+ Project-URL: Source, https://github.com/babarmuhammad/archeus
11
+ Project-URL: Issues, https://github.com/babarmuhammad/archeus/issues
12
+ Project-URL: Changelog, https://claudectl.space/changelog
13
+ Keywords: claude,claude-code,tui,session-manager,windows,ai-agents,context-management,developer-tools,mcp,terminal-ui,workspace,session-history
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Console
16
+ Classifier: Environment :: Win32 (MS Windows)
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Operating System :: MacOS
21
+ Classifier: Operating System :: POSIX :: Linux
22
+ Classifier: Programming Language :: Python :: 3
23
+ Classifier: Topic :: Software Development
24
+ Classifier: Topic :: Utilities
25
+ Requires-Python: >=3.10
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest; extra == "dev"
30
+ Provides-Extra: gui
31
+ Requires-Dist: PyQt6; extra == "gui"
32
+ Requires-Dist: PyQt6-WebEngine; extra == "gui"
33
+ Dynamic: license-file
34
+
35
+ <h1 align="center">archeus</h1>
36
+
37
+ <p align="center">
38
+ <sub><i>Formerly <code>claudectl</code>. Everything migrates on first run —
39
+ settings, memory graphs and per-project state. Nothing is deleted.</i></sub>
40
+ </p>
41
+
42
+ <p align="center">
43
+ <b>The workspace layer for Claude Code.</b><br>
44
+ Your projects stop being a stream of chats and start being workspaces —
45
+ with memory, history, and per-project launch control.
46
+ </p>
47
+
48
+ <p align="center">
49
+ <img alt="Python" src="https://img.shields.io/badge/python-3.10%2B-blue">
50
+ <img alt="Platform" src="https://img.shields.io/badge/platform-Windows%20%C2%B7%20macOS%20%C2%B7%20Linux-0078D6">
51
+ <img alt="Dependencies" src="https://img.shields.io/badge/runtime%20deps-zero%20(stdlib)-brightgreen">
52
+ <img alt="Tests" src="https://img.shields.io/badge/tests-1493-brightgreen">
53
+ <img alt="License" src="https://img.shields.io/badge/license-MIT-green">
54
+ <img alt="Claude Code" src="https://img.shields.io/badge/for-Claude%20Code-8A5CF6">
55
+ </p>
56
+
57
+ <p align="center">
58
+ <b>🌐 <a href="https://claudectl.space">claudectl.space</a>
59
+ &nbsp;·&nbsp;
60
+ 📖 Full documentation → <a href="https://docs.claudectl.space/">docs.claudectl.space</a></b><br>
61
+ <sub>Everything below is the short version. Every feature, key binding and file is
62
+ documented in detail on the docs site.</sub><br>
63
+ <sub>
64
+ <a href="https://pypi.org/project/archeus/">PyPI</a> ·
65
+ <a href="https://claudectl.space/blog">Blog</a> ·
66
+ <a href="https://claudectl.space/faq">FAQ</a> ·
67
+ <a href="https://www.linkedin.com/in/muhammad-anas-babar-819647240">LinkedIn</a> ·
68
+ <a href="https://dev.to/muhammad_anasbabar_31256">dev.to</a>
69
+ </sub>
70
+ </p>
71
+
72
+ <p align="center">
73
+ <sub><i>Not the Rust <code>archeus</code>. Two independent projects share this name;
74
+ this one is the Python workspace layer for Claude Code.</i></sub>
75
+ </p>
76
+
77
+ <p align="center">
78
+ <img alt="archeus dashboard" src="https://raw.githubusercontent.com/babarmuhammad/archeus/main/docs/img/gui-dashboard.png" width="900">
79
+ </p>
80
+
81
+ ---
82
+
83
+ ## What problem does this solve?
84
+
85
+ Claude Code is excellent inside a session and forgetful between them. Every new
86
+ session starts from nothing, your old sessions are hard to find, and the only
87
+ way to give the agent context is a `CLAUDE.md` that grows until it costs more
88
+ than it's worth.
89
+
90
+ **archeus sits in front of Claude Code and fixes that.** Pick a project, see
91
+ every session you've ever had in it, and launch with the model, effort,
92
+ permissions and context you meant. Underneath, it maintains a semantic memory
93
+ of the codebase and injects only the part relevant to what you just asked.
94
+
95
+ It is a terminal UI and a desktop GUI over the same engine — use whichever you
96
+ prefer, they do the same things.
97
+
98
+ ## Quickstart
99
+
100
+ ```bash
101
+ pipx install archeus # or: pip install archeus
102
+ archeus
103
+ ```
104
+
105
+ There is nothing to build and no dependencies to install. To run it from a
106
+ checkout instead:
107
+
108
+ ```bash
109
+ git clone https://github.com/babarmuhammad/archeus.git
110
+ cd archeus
111
+ python claude-sessions.py # terminal UI
112
+ python claude-sessions.py --gui # desktop GUI
113
+ ```
114
+
115
+ Requires **Python 3.10+** and the
116
+ [Claude Code CLI](https://docs.anthropic.com/claude-code) (auto-detected on
117
+ PATH or at `~/.local/bin/`). No API key — it uses the Claude Code auth you
118
+ already have. No third-party packages.
119
+
120
+ It also ships as a Claude Code plugin, if you'd rather stay inside the session:
121
+
122
+ ```
123
+ /plugin marketplace add babarmuhammad/archeus
124
+ /plugin install archeus@archeus
125
+ ```
126
+
127
+ → [Full install guide](https://docs.claudectl.space/installation/)
128
+
129
+ ## What it looks like
130
+
131
+ <table>
132
+ <tr>
133
+ <td width="50%"><img alt="Session browser" src="https://raw.githubusercontent.com/babarmuhammad/archeus/main/docs/img/gui-sessions.png"><br>
134
+ <sub><b>Every session, every project.</b> Search, tag, fork, resume, archive,
135
+ export — across multiple Claude accounts at once.</sub></td>
136
+ <td width="50%"><img alt="Project memory" src="https://raw.githubusercontent.com/babarmuhammad/archeus/main/docs/img/gui-memory.png"><br>
137
+ <sub><b>Memory Claude built about your code.</b> Entities, relations and
138
+ lessons, with the token cost of every block shown before you spend it.</sub></td>
139
+ </tr>
140
+ <tr>
141
+ <td><img alt="Usage" src="https://raw.githubusercontent.com/babarmuhammad/archeus/main/docs/img/gui-usage.png"><br>
142
+ <sub><b>Where the tokens went.</b> Per day, per project, per account, per
143
+ model — read from your own transcripts, not an API.</sub></td>
144
+ <td><img alt="Claude Code's own state" src="https://raw.githubusercontent.com/babarmuhammad/archeus/main/docs/img/gui-claude-code.png"><br>
145
+ <sub><b>Claude Code itself, made visible.</b> Which skills and plugins you
146
+ actually use, what is on disk, and a typed editor for every account's
147
+ settings.</sub></td>
148
+ </tr>
149
+ </table>
150
+
151
+ The terminal UI is the same tool, keyboard-first:
152
+
153
+ <p align="center">
154
+ <img alt="archeus TUI — project picker" src="https://raw.githubusercontent.com/babarmuhammad/archeus/main/docs/img/tui-main.png" width="49%">
155
+ <img alt="archeus TUI — sessions" src="https://raw.githubusercontent.com/babarmuhammad/archeus/main/docs/img/tui-sessions.png" width="49%">
156
+ </p>
157
+
158
+ <p align="center">
159
+ <img alt="Architecture graph" src="https://raw.githubusercontent.com/babarmuhammad/archeus/main/docs/graph-real.gif" width="820">
160
+ <br><sub><b>The architecture graph</b> — every module and its dependencies,
161
+ expandable down to single files (Python · C/C++ · C# · JS/TS).</sub>
162
+ </p>
163
+
164
+ <sub>Also: 32 palettes, 8 skins and 4 themed worlds — a skin changes the shape of the app,
165
+ not just its colours.
166
+ <a href="https://docs.claudectl.space/desktop/">See them →</a></sub>
167
+
168
+ ---
169
+
170
+ ## Why archeus
171
+
172
+ - 🧠 **Intelligent memory, not a memory dump** — task-scoped, token-budgeted injection at the launcher: a micro-index always on (≤250 tok), per-module detail loaded only when Claude touches those files, and an optional per-prompt hook that injects just the subgraph relevant to what you asked.
173
+ - 📚 **It learns from every session** — durable lessons (fixes, decisions, preferences) distilled from transcripts, human-reviewed, injected when relevant, decayed when stale.
174
+ - 🕸️ **See your architecture** — an animated, expandable dependency graph that opens at the project level and drills down to single files.
175
+ - 🩺 **Auto-solves common Claude Code pain** — pre-launch health checks, context-loss insurance after `/compact`, permission-fatigue killer, token-burn advisor, daily usage tracking.
176
+ - 🤖 **Adaptive agents** — the right subagents suggested (or auto-applied) per project from local signals.
177
+ - 📦 **Workspace, not chats** — browse, search, tag, fork, resume and archive every Claude Code session across every project and account.
178
+ - ⚡ **Zero runtime dependencies** — pure Python standard library; uses your existing Claude Code auth.
179
+
180
+ ### How archeus saves tokens
181
+
182
+ Without archeus, a big project either starves the agent (no context) or floods it (a huge CLAUDE.md loaded every message). archeus spends the *minimum* tokens for the *maximum* relevant context:
183
+
184
+ - **Flat always-on cost** — the CLAUDE.md block is a ≤250-token index, not a full dump; it does **not** grow as the codebase grows.
185
+ - **On-demand detail** — per-module knowledge lives in path-scoped `.claude/rules/`, so nothing is paid for until it's relevant.
186
+ - **Task-scoped injection** — the optional prompt hook injects only the subgraph your prompt actually needs (budgeted, default ≤600 tok).
187
+ - **No stale weight** — superseded facts are invalidated, dead entities evicted.
188
+ - **Cheaper model for the grunt work** — Plan→Execute runs the expensive model once for the plan and a cheap (or free) one for execution.
189
+
190
+ → [How the token economy works](https://docs.claudectl.space/usage/)
191
+
192
+ ---
193
+
194
+ ## Documentation
195
+
196
+ The full manual lives at **[docs.claudectl.space](https://docs.claudectl.space/)**.
197
+
198
+ | | |
199
+ |---|---|
200
+ | [Getting started](https://docs.claudectl.space/getting-started/) | what it is, the three surfaces, where to go next |
201
+ | [Installation](https://docs.claudectl.space/installation/) | pipx, pip, checkout, plugin, GUI window, Windows shortcuts |
202
+ | [Quickstart](https://docs.claudectl.space/quickstart/) | install to first session in five minutes |
203
+ | [Command line](https://docs.claudectl.space/cli/) | every command, for scripts and hooks |
204
+ | [Terminal UI](https://docs.claudectl.space/tui/) | every screen and every key binding |
205
+ | [Desktop app](https://docs.claudectl.space/desktop/) | the same workspace as a local app, plus the theme system |
206
+ | [Configuration](https://docs.claudectl.space/configuration/) | every file archeus reads and writes, and where |
207
+ | [Project memory](https://docs.claudectl.space/memory/) | the three injection surfaces, lessons, recall |
208
+ | [Architecture graph](https://docs.claudectl.space/architecture/) | the interactive dependency view |
209
+ | [Usage & cost](https://docs.claudectl.space/usage/) | measuring and cutting the per-turn cost |
210
+ | [API reference](https://docs.claudectl.space/api/) | the local HTTP API the GUI is built on |
211
+ | [Troubleshooting](https://docs.claudectl.space/troubleshooting/) | when something does not work |
212
+
213
+ Product pages — [Features](https://claudectl.space/features/) ·
214
+ [Compare](https://docs.claudectl.space/compare/) · [FAQ](https://claudectl.space/faq/) ·
215
+ [Download](https://claudectl.space/download/) ·
216
+ [Changelog](https://claudectl.space/changelog/) — are on
217
+ [claudectl.space](https://claudectl.space/).
218
+
219
+ ## Credits
220
+
221
+ archeus is built on ideas from the wider Claude Code ecosystem — cognee and Aider's
222
+ repo-map behind the memory graph, Anthropic's `code-review` plugin behind `archeus review`,
223
+ claude-mem behind recent-work memory, OmniRoute behind free execution, and VoltAgent's
224
+ subagent catalog behind the agent library. Every one is credited, with links, on the
225
+ [Credits page](https://docs.claudectl.space/credits/).
226
+
227
+ ## License
228
+
229
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,116 @@
1
+ archeus-2.0.0.dist-info/licenses/LICENSE,sha256=P5gGKXV-HVPaKA8BauGajvyjN2G0OAQXFML23jfMtOE,1076
2
+ claude_sessions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ claude_sessions/__main__.py,sha256=3HjJSqAcPg6EKJYdn5UnB4e5qv_A1lAEYyZh8k2B_Pc,2152
4
+ claude_sessions/accounts.py,sha256=SDAjAnEZou-WurmJwdAcGJqnx2PUoPysgiFdH0TpAn8,7104
5
+ claude_sessions/agentnudge_hook.py,sha256=bBXvTD_eUHIqwzKLPGNwWzCsqj1mY4m6QnrvSLMRIew,4178
6
+ claude_sessions/agents.py,sha256=IbdHvyo4-SBb3KJoceZ7u-BOnSZosFRm1NeP1zuYwg8,39118
7
+ claude_sessions/automode.py,sha256=le5f25lH30-qUuwEpu1o_PlQ1gj0rJ-o67Kjat5wMkE,9243
8
+ claude_sessions/brief.py,sha256=PMxRbO8rMDMyK9T0NzGCtWkPvTpNGN-WTuQ074g-vp4,18060
9
+ claude_sessions/ccsettings.py,sha256=anp_pYDf16rsLTOvnkRpAwQpK-On_K52ZCG0qR56PjQ,12494
10
+ claude_sessions/checkpoints.py,sha256=0l7yBRXUQMHQ0GGklYGDJhAKjZ7_q9WUdDywqrOoXVM,5497
11
+ claude_sessions/claude_md.py,sha256=NVr-Da7ZQ85AC2yRRg8WmcBHTFS5MIYbUNgzGQPbPcM,54475
12
+ claude_sessions/cli.py,sha256=oG7cnf1jPTxjPPZ7KYdGOQ7wzQuXPApLWrZZCBfi4GA,4879
13
+ claude_sessions/clientstate.py,sha256=yFzC0tesdqEzxg-RXhWq1zN9wGxWF4xsX_A5dVUkjmE,14083
14
+ claude_sessions/concise_hook.py,sha256=slAkdlYGy-UpfkJCR6mpz_Kojdlftwh90o_HwQx8NrI,1381
15
+ claude_sessions/config.py,sha256=Alt6tBU8wgk3w4ucPjSzI2d_UoY_Yy-jD-CafdEqqbE,52195
16
+ claude_sessions/connections.py,sha256=R-ZW0cNdKeNsR13VYA8e6CMdbmsGzt50vMuENMJObE0,54114
17
+ claude_sessions/context_inject.py,sha256=71JrMbs1b1Jo5M-sqKP4BfIXFc7XCcZib-FIn-fXWEk,6499
18
+ claude_sessions/conventions.py,sha256=ZVXFHmHA-U_tGFHyO1cguk_3-13YvQbazEHsuLogd14,10232
19
+ claude_sessions/ctxaudit.py,sha256=USx6iKjnwDvPKEF43_suJBXDJX9beEm141tCwlKIKGU,14449
20
+ claude_sessions/denygen.py,sha256=r7O0n_Bquh6lUAVUk-hbPoll_4_n-VRRkNEKt9dd1oQ,4972
21
+ claude_sessions/diffview.py,sha256=Q9p8gSm9JaR5awAP6dkt1Eq7gum9MLc9S59O8KPdTY0,11800
22
+ claude_sessions/diskgc.py,sha256=MGTO1rhkUXlK0y8R96tELgTwq06h88_DRGIMfa5PqbU,6149
23
+ claude_sessions/events.py,sha256=55QEi0eVJbNRMBGrAlr7AsAiwhXtc3fHaZY9py44R38,8959
24
+ claude_sessions/failover.py,sha256=g2H4cpe8BKcBLPhYqUk6A5c81jlLgACYEfYHw4mJRuI,22713
25
+ claude_sessions/guard_hook.py,sha256=OV7pxufh30fQP43aLdwlt45BAP5jCSM3nnqnQmgTnWw,1875
26
+ claude_sessions/gui.py,sha256=vo5Z88PSXCV4RuugS-m2q-zkiCB655zBaDvsZJOuwlA,39384
27
+ claude_sessions/gui_api.py,sha256=jrVbzUMkuY7RKUDj1zB7SEsL5VRVch-EpUk7Q-4B-2k,167848
28
+ claude_sessions/gui_html.py,sha256=hSM4p83tRs6QEZ9RBzOtSYrrknFg9WU3UVs9NteNxOE,2712
29
+ claude_sessions/gui_qt.py,sha256=k7v99Yg43jZy_bO9GDC_88fHT2-k2zH_61Nh9rkPfl8,5269
30
+ claude_sessions/health.py,sha256=sOZiZz3IQDBUmbfQWSoNpUANG8AtiaPJQJwkDMDkRRY,8887
31
+ claude_sessions/hookrules.py,sha256=GlTPyTrO4iIbQHRDeA81SJYUivv7QhW_8lUNOtZzaT4,1725
32
+ claude_sessions/hooks.py,sha256=V40qsPT8FuJXVAdvXwnRy4P5ogtlzmrH9_sYRCKngG0,39564
33
+ claude_sessions/jsonstore.py,sha256=0YaD2rib_jTT6l6lzyyAm_Qzkoakyeprg2KyqIW0c9k,2679
34
+ claude_sessions/lessons.py,sha256=gh8bLjIObVN02V9zd4kpevELgYUTm4tBcv7VOAVbXFE,13540
35
+ claude_sessions/logbash_hook.py,sha256=Iwyk3Lil152GVSl6G9v2ko8DAODcYetmgVE8tJqgnBw,4200
36
+ claude_sessions/loops.py,sha256=PqJhXvR2Pu0bP4xyzp7SsA_FP6JKJwrMfEJQBgAwX6w,21610
37
+ claude_sessions/main.py,sha256=_c4pML6Zszm8nELiAS0ms6sghLMZ3Lu3lt6LCdsogZg,45583
38
+ claude_sessions/mcp.py,sha256=LwwIQA2qLeLlj0zCTRGJw4Zm7R2PmET8eVWxrh0EXn8,14096
39
+ claude_sessions/memdirty_hook.py,sha256=aGLECSyT_qL4VNMiPJgCg2R8rwwK0KFFKrSRnutve_c,3418
40
+ claude_sessions/memhub.py,sha256=XI4fhuzyxQjwd_Xxs1fvWdEwGbudUAtSwLoxtkUR7WM,13867
41
+ claude_sessions/memory.py,sha256=7-WW7-G_QigazpK1IbPsamw_tmU6W3q2ckWNuq4qlAQ,72224
42
+ claude_sessions/memrules.py,sha256=JRX7YmYB4qQn-6teXe1wli7zm4DdkZ6VNlbgkz-hsWc,6730
43
+ claude_sessions/migrate.py,sha256=Nrdvv7tVLJ68WQ-ugQaev22Lp4TZh0feC00Eu-tDo4Y,15925
44
+ claude_sessions/minimalcode_hook.py,sha256=xPZFqH6aE8ZX1ei7a4EmoVkwugQcQhN-NBkbYMhHivw,1391
45
+ claude_sessions/models.py,sha256=XlY9J46yI2iEQ-bxh2WvDx1xdOyLPNUygcQtXYcv8CM,10784
46
+ claude_sessions/notify.py,sha256=VC_9axyY539Frlhv4AR-P7FOPnrQlzXF2RZKom5Mai0,4520
47
+ claude_sessions/omniroute.py,sha256=qlVlpgsnOf7WrMHNT2TWtJAFS_riZVvRYfAi0_FS8VM,22963
48
+ claude_sessions/outputstyles.py,sha256=1xm3kkbv5OfCi-e27_9QBE9rLU2fDIeNWwgwQGPzyaA,11883
49
+ claude_sessions/paths.py,sha256=azuUdjGCsmgXWf-CsmtQGqIVtJhlBRJGsQYNvJhTYac,5565
50
+ claude_sessions/plan_execute.py,sha256=AZEB6RXUIL4-JzSfjbtaNWQ-svYQ7XgrfjYdcbdxqzw,28473
51
+ claude_sessions/plugins.py,sha256=x0TXQqHwL5RBiX5ZLWXy6OT2ms-f03F4tDX2MZ1JMWI,11877
52
+ claude_sessions/proc.py,sha256=YPgquzpYLWL4Lm0uid-AnY98eWD_7cumWXU2_rXFvk8,10733
53
+ claude_sessions/provision.py,sha256=86llO0vRIL6CrngH55XlYHp1yklRindYLbRVmvJX3sM,12690
54
+ claude_sessions/quota.py,sha256=G19rq2tG1Y0pc8wjeQDq2nsbGUxHbTzQbTbBqnsU7Q0,12880
55
+ claude_sessions/recall.py,sha256=xh320oseTdapM5exgEHkXKvurFZ0l12fT1vJutcnvKg,23560
56
+ claude_sessions/recall_hook.py,sha256=ktGejdOLlK3P9d91Wqjv1EJb-usXMotnlyuDAjO10sw,2801
57
+ claude_sessions/render.py,sha256=nWt80F_L5ZlHNnvmXau6YyCS9BIwK2B1vTTk1uR6XGY,9329
58
+ claude_sessions/repos.py,sha256=gqlnqCdxeJIcWKvUeIGRCcRGTaqsqM6mDKDILLPupUk,11506
59
+ claude_sessions/review.py,sha256=rqOWgdoHip8RecKGrBZbH1NramXRXg3gGrUKeQu_GsI,11231
60
+ claude_sessions/search.py,sha256=rWU2M-aEWlvWg5xRqWVErQ0U49mjHQWanA7xOMfxMB4,4232
61
+ claude_sessions/session_menu.py,sha256=wO9LhJQUEIUyjURIHg8N-5VbvebNODeGBPJczm3eg_U,35014
62
+ claude_sessions/sessions.py,sha256=VNMjWQ567AJq97uhPqw5oLNFky_X5ydjiLqlXpBpZak,20780
63
+ claude_sessions/skills.py,sha256=UZQTL4vbFryWSRwcCD2ieCgwbPavXLo_deqjVFbHHDk,34456
64
+ claude_sessions/skillscan.py,sha256=Mwh1q1JV21T98_0XqNT-Wc13H0LePplVK1bfovudBV8,10527
65
+ claude_sessions/stats.py,sha256=G2nguuzD-lAfE9YCvKmEcaB4E-JEmpziq5-cfBDJ6LQ,27235
66
+ claude_sessions/statusline.py,sha256=TVwP2bXmVlW939reyKOVcyauHG5IetG0J7WbNHuIEAM,21769
67
+ claude_sessions/statusline_cli.py,sha256=G8MY2a8p_FAi1CiTEY9S6dUe8rcM7BOSFYdRrG4OHhE,1197
68
+ claude_sessions/store.py,sha256=8Eq42SNcrybVllNYtlM5QSbL1pns2VTOYkJx5iX84Dg,3387
69
+ claude_sessions/system_prompt.py,sha256=sln9wZ5tiQkblqLonNgWMMwW7ALqBpaug38YvVoiCC8,6534
70
+ claude_sessions/term.py,sha256=7Wjar2LlbCNErHeKHGGea0LPuiDH4ADWfI54PMXPWC4,6090
71
+ claude_sessions/testfilter_filter.py,sha256=IKLe2uH2RnP6kBkLAm0i1rI3dWeXcuez3r93TroXMCg,1828
72
+ claude_sessions/testfilter_hook.py,sha256=3d4OLI4Wnx-o9ugx2vjhUH00u_vCh8cTPqC5KnalDwQ,2186
73
+ claude_sessions/themes.py,sha256=sHEVqP42Z9UXRUu61OghS_fC4QJj5PxedgLQL31kD7s,44908
74
+ claude_sessions/transcript.py,sha256=vDTd9LCJYlM-1TRkC6XOqNKJO2e4J_zy4Pihqa4-qnM,9231
75
+ claude_sessions/transcripts.py,sha256=-rjYajaTueUFb3mTwMVvd1G7GODYBhUmq7-WPtRl00E,3053
76
+ claude_sessions/ui.py,sha256=VaPxhJ7dOwri9YMPC0def7Gh7wRDfwJBS9gdgNIQ_R4,68339
77
+ claude_sessions/usage.py,sha256=MP4VdwKzu4uh_D0e4p9_i85ahv33JpOAen5G4HTco90,15439
78
+ claude_sessions/versions.py,sha256=kNDxA50FoL7TbeEDLF0ct2talDv22-mFjbw0xeh30ys,29391
79
+ claude_sessions/worklog.py,sha256=ni7PD4Oz_sP2uJDi_0iXhsFcOiTV53mq44VphSzpmVw,5177
80
+ claude_sessions/worklog_hook.py,sha256=CsFZToLuvOpv3yNUXuMB1waLxLxEjOrG7EtfI0FNgrQ,2916
81
+ claude_sessions/workspace.py,sha256=IF8PMCo8aJFlGd-nhZwHT3z6XAx8ZXL9nkITXnE6ltU,37023
82
+ claude_sessions/worktrees.py,sha256=X96M-Ryt6mIzCFbf665xmqTLBWWxPkCTDrWY6Sg5eXI,12007
83
+ claude_sessions/skills_templates/changelog/SKILL.md,sha256=-9IVczR5mXM8Avl7jHUqicK-Q9dcz5ZzGmysVbSfwck,1180
84
+ claude_sessions/skills_templates/code-explainer/SKILL.md,sha256=xD2MKQVmKoFnu__0q31nTelxbqNhzJ1TwhUbU03kJbU,1214
85
+ claude_sessions/skills_templates/commit-message/SKILL.md,sha256=IZt0TB3A7CwOag14mChIFTpcxdwKP7BuuitTU19_eqs,1163
86
+ claude_sessions/skills_templates/pr-description/SKILL.md,sha256=ZcBrp3Mo8MezjWY-_Clj-yGd08O6Sz2PYWb8eaQeUgw,1146
87
+ claude_sessions/skills_templates/refactor-planner/SKILL.md,sha256=KY0b96B2CmlQJI_mhGQKKrEqdbtnUnnH9jxHtmX8boc,1218
88
+ claude_sessions/skills_templates/security-review/SKILL.md,sha256=KWqkzsG9DdKGAdTVUhUPxNxzJw6TxgBYHYZed49b6CE,1436
89
+ claude_sessions/skills_templates/test-writer/SKILL.md,sha256=jwislBldaHcUrlMkYc6iQUqmRAa8x4_IvlBQBd3-Qg4,1328
90
+ claude_sessions/skills_templates/token-economy/SKILL.md,sha256=4GWP4fl_aaYhves0uV-CL6fv2AJq--eoG-6-h8ylrms,1205
91
+ claude_sessions/web/app.css,sha256=ppgbA9QXZRWzDeoQhj2yAmq74D2c_zLUh8imDYvh14Y,117690
92
+ claude_sessions/web/app.js,sha256=GHgzdUY6k1n39ecOGM8jYU0EM86zGdlU8GHwhKfaPKU,396069
93
+ claude_sessions/web/index.html,sha256=yF_A0_S1BY0fiEUYylZs99PZpxMhwLDpOXrin3QcYq8,11177
94
+ claude_sessions/web/instruments.js,sha256=4Yhmo_nX6R_2HRp2H2pNKHScx10V823vqAN2Fzw3l0k,23609
95
+ claude_sessions/web/motion.js,sha256=XJppb4AQJNjcux1w6COytGde2zaKSRa0lG1kHd9pgIc,35218
96
+ claude_sessions/web/stage.js,sha256=QbptL0Ea-I8wWlh5JIWoTOLiwU7_2q5_PXYz01TfY3w,53359
97
+ claude_sessions/web/vendor/LICENSE-anime.txt,sha256=Pz6DWplSz8KmyoNvuVsyV8mB8k-j71EkkFWssJkxiXs,1075
98
+ claude_sessions/web/vendor/LICENSE-three.txt,sha256=izeOvmDi_lABWMsKxxy16LfZKVPCq8xjoOuQSZZTtbw,1081
99
+ claude_sessions/web/vendor/anime.esm.min.js,sha256=oZAVoaktUgJaL7ZwO21n6t0cwq6viAdw6W4Ez2qge-E,118678
100
+ claude_sessions/web/vendor/three.core.min.js,sha256=BbJgkzjHbNZdr3TzrFFbyaUEXhs7M-3AfYyb1VJQ-pA,385386
101
+ claude_sessions/web/vendor/three.module.min.js,sha256=hrzuJItk9EvPwjwzGudGGQYZV9WcqwQBcdy2-1kAvrY,365552
102
+ claude_sessions/web/vendor/postprocessing/EffectComposer.js,sha256=TgeaWIYVLX5Smlmu9kTpaKtNMsajPOAWs2vymy6sJvc,8501
103
+ claude_sessions/web/vendor/postprocessing/MaskPass.js,sha256=fNCO7p1db1V4vq3b3L6cOE9oc4EK8n8iq32zzusSeqM,4694
104
+ claude_sessions/web/vendor/postprocessing/OutputPass.js,sha256=AuSiYa803nEzgYXp6H8Mvly6kRVgjZhDY-EmnewdInI,4184
105
+ claude_sessions/web/vendor/postprocessing/Pass.js,sha256=REtAnCNerZhok8Ry5yDaG3eaVphcfRCyeceUS1K9YcU,4218
106
+ claude_sessions/web/vendor/postprocessing/RenderPass.js,sha256=gX9sPNzQ_UFRXREjWeoFMlaO77WqvTszkDlX68obimo,4280
107
+ claude_sessions/web/vendor/postprocessing/ShaderPass.js,sha256=4lAKWROya79RSM6q5kTG7c_wahiwFJTuN7-FY1PSq50,3228
108
+ claude_sessions/web/vendor/postprocessing/UnrealBloomPass.js,sha256=EVi7AvZGeImroZwaeIuRBwVNf2pVhJi14hUttYc7uFk,14921
109
+ claude_sessions/web/vendor/shaders/CopyShader.js,sha256=ozBX1ayRxDMEwYasDogW5iuy7UcdOgD_MBjf1cA4lxg,729
110
+ claude_sessions/web/vendor/shaders/LuminosityHighPassShader.js,sha256=UET3gLbmz4Y5R_ZMNv4VhxMvf745WtqGPNHl8DiNzx4,1291
111
+ claude_sessions/web/vendor/shaders/OutputShader.js,sha256=NTR593qNfiYp1JzKyfwvXb_dpUQuCt-GewA3ei_LDLI,1876
112
+ archeus-2.0.0.dist-info/METADATA,sha256=P7fyC7lAeE7ACodmdeI0ujqVB5q3mxTkJAtLrLTiq_w,11420
113
+ archeus-2.0.0.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
114
+ archeus-2.0.0.dist-info/entry_points.txt,sha256=gD65FRzrXmImWiNpK3XQc9MvimvIMTaq_CEXUw6FPtY,52
115
+ archeus-2.0.0.dist-info/top_level.txt,sha256=9ECVrRplsWVa8pw7BSnjDuS8XFe8_B4T35vqdkpqtLs,16
116
+ archeus-2.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ archeus = claude_sessions.cli:run
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Babar Muhammad Anas
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 @@
1
+ claude_sessions
File without changes
@@ -0,0 +1,48 @@
1
+ """`python -m claude_sessions [...]` — same dispatch as claude-sessions.py.
2
+
3
+ Exists so the detached background memory worker (memory.spawn_background_worker)
4
+ can re-invoke archeus without depending on the repo-root launcher script.
5
+
6
+ The statusline is dispatched HERE, before `main` is imported: `main` pulls the
7
+ whole TUI stack plus `usage`, which drags in urllib/ssl/http.client for an OAuth
8
+ poll the statusline must never make — 48ms of import on a path that runs on
9
+ every conversation turn.
10
+ """
11
+ import sys
12
+
13
+ if len(sys.argv) >= 2 and sys.argv[1] == 'statusline':
14
+ from .statusline import main
15
+ raise SystemExit(main(sys.argv[2:]))
16
+
17
+ # `--help` before `main`, for the same reason and one of its own: the first
18
+ # thing a new install types must not pay for the TUI stack, and must not be
19
+ # breakable by anything in it. `cli` imports the standard library only.
20
+ if len(sys.argv) >= 2 and sys.argv[1] in ('--help', '-h', 'help'):
21
+ from .cli import print_help
22
+ print_help()
23
+ raise SystemExit(0)
24
+ if len(sys.argv) >= 2 and sys.argv[1] in ('--version', '-V'):
25
+ from .cli import print_version
26
+ print_version()
27
+ raise SystemExit(0)
28
+
29
+ # A scheduled background loop, run by Task Scheduler or cron every N minutes.
30
+ # HERE, above `main`, for the same reason as the statusline: this fires
31
+ # unattended forever, so it must not import the TUI stack to run one headless
32
+ # `claude -p`. `loops` reaches config/proc and nothing else.
33
+ if len(sys.argv) >= 3 and sys.argv[1] == '--loop-run':
34
+ from .loops import run_once
35
+ _cfg = sys.argv[sys.argv.index('--cfgdir') + 1] if '--cfgdir' in sys.argv else None
36
+ raise SystemExit(run_once(sys.argv[2], _cfg))
37
+
38
+ # The deferred self-upgrade worker (versions.update_self spawns it). Dispatched
39
+ # HERE for a second reason on top of the statusline's: pip is about to replace
40
+ # every file in this package, so the worker must hold no lazy import of one.
41
+ # `proc` imports os/subprocess/sys/time and nothing from archeus.
42
+ if len(sys.argv) >= 4 and sys.argv[1] == '--self-update':
43
+ from .proc import wait_and_run
44
+ raise SystemExit(wait_and_run(sys.argv[2], sys.argv[3:]))
45
+
46
+ from .main import run
47
+
48
+ run()
@@ -0,0 +1,189 @@
1
+ """Multi-account manager — make running two (or more) Claude accounts easy.
2
+
3
+ Claude Code picks the account from its config dir (CLAUDE_CONFIG_DIR). Each
4
+ account = its own dir with its own login. archeus stores named accounts, lets
5
+ you switch the active one, and — the point — **launch a second account in a new
6
+ terminal with one key** so both run at the same time.
7
+ """
8
+
9
+ import os
10
+ import subprocess
11
+
12
+ from . import config as _c
13
+ from .ui import menu, text_input, flash, confirm, _cls, pause, pager
14
+ from . import render
15
+
16
+
17
+ def _default_dir():
18
+ return os.path.join(_c._USERPROFILE, '.claude')
19
+
20
+
21
+ def _accounts(s):
22
+ """[(name, dir, is_active)] — always includes the built-in default account."""
23
+ active = s.get('claude_config_dir', '') or ''
24
+ out = [('default', '', not active)] # '' dir = ~/.claude
25
+ for a in s.get('accounts', []):
26
+ if isinstance(a, dict) and a.get('dir'):
27
+ out.append((a.get('name', a['dir']), a['dir'],
28
+ os.path.expanduser(a['dir']) == os.path.expanduser(active)))
29
+ return out
30
+
31
+
32
+ def _resolved(d):
33
+ return os.path.expanduser(os.path.expandvars(d)) if d else _default_dir()
34
+
35
+
36
+ def accounts_menu():
37
+ from .config import load_settings, save_settings
38
+ while True:
39
+ s = load_settings()
40
+ accts = _accounts(s)
41
+ items = []
42
+ for name, d, active in accts:
43
+ dot = f"{_c.C_OK}●{_c.C_RESET}" if active else '○'
44
+ loc = d or '~/.claude'
45
+ tag = f" {_c.C_OK}(active){_c.C_RESET}" if active else ''
46
+ items.append((f"{dot} {name} {_c.C_DIM}{render.trunc(loc, 40)}{_c.C_RESET}{tag}",
47
+ f'acct:{name}'))
48
+ items += [(f"{'─' * _c.W}", None),
49
+ ('+ Add account', '__add__'),
50
+ ('⇄ Sync accounts (level every account up)', '__sync__'),
51
+ ('Back', 'back')]
52
+ sel = menu(items, "CLAUDE ACCOUNTS")
53
+ if not sel or sel == 'back':
54
+ return
55
+ if sel == '__add__':
56
+ _add_account(s)
57
+ elif sel == '__sync__':
58
+ _sync_accounts()
59
+ elif sel.startswith('acct:'):
60
+ _account_actions(s, sel[5:])
61
+
62
+
63
+ def _sync_accounts():
64
+ """Show the per-account diff, then copy the missing items in.
65
+
66
+ The diff is shown BEFORE anything is written: what reaches four more
67
+ accounts here is hooks and plugins, which run code every turn.
68
+ """
69
+ from . import provision
70
+ d = provision.diff()
71
+ lines = provision.report(d)
72
+ if d['clean']:
73
+ pager(('ARCHEUS', 'ACCOUNTS', 'SYNC'), lines, hint='ESC back')
74
+ return
75
+ key = pager(('ARCHEUS', 'ACCOUNTS', 'SYNC'), lines,
76
+ hint='a apply to every account', extra_keys=('a',))
77
+ if key != 'a':
78
+ return
79
+ if not confirm('Copy the missing items into every account?', danger=True):
80
+ return
81
+
82
+ def review(name, marketplace):
83
+ from . import plugins
84
+ return plugins.review_plugin(name, marketplace)
85
+
86
+ done = provision.apply(d, review=review)
87
+ out = [' %s %-12s %-12s %s' % ('OK ' if ok else 'ERR', acct, kind, detail)
88
+ for acct, kind, detail, ok in done] or [' Nothing to do.']
89
+ pager(('ARCHEUS', 'ACCOUNTS', 'SYNC'), out, hint='ESC back')
90
+
91
+
92
+ def _add_account(s):
93
+ from .config import save_settings
94
+ name = text_input("Account name (e.g. work, personal):")
95
+ if not name:
96
+ return
97
+ default_dir = os.path.join(_c._USERPROFILE, f'.claude-{name}')
98
+ d = text_input("Config dir for this account:", default=default_dir)
99
+ if not d:
100
+ return
101
+ rd = _resolved(d)
102
+ try:
103
+ os.makedirs(rd, exist_ok=True)
104
+ except Exception as e:
105
+ flash(f"Could not create dir: {e}", ok=False, secs=2)
106
+ return
107
+ accts = [a for a in s.get('accounts', []) if a.get('name') != name]
108
+ accts.append({'name': name, 'dir': d})
109
+ s['accounts'] = accts
110
+ save_settings(s)
111
+ if confirm(f"Log in to '{name}' now? (opens claude for /login)"):
112
+ _login(d)
113
+ else:
114
+ flash(f"Account '{name}' added — log in later from its row", secs=1.6)
115
+
116
+
117
+ def _account_actions(s, name):
118
+ from .config import save_settings
119
+ d = '' if name == 'default' else next(
120
+ (a['dir'] for a in s.get('accounts', []) if a.get('name') == name), '')
121
+ acts = [('Switch active account (this archeus)', 'switch'),
122
+ ('Open in NEW terminal (run in parallel)', 'parallel'),
123
+ ('Log in / re-login here', 'login')]
124
+ if name != 'default':
125
+ acts.append(('Rename', 'rename'))
126
+ acts.append(('Remove from list', 'remove'))
127
+ acts.append(('Cancel', 'cancel'))
128
+ act = menu(acts, f"ACCOUNT / {name}")
129
+ if act == 'switch':
130
+ s['claude_config_dir'] = d
131
+ save_settings(s)
132
+ flash(f"Active account → {name}. Restart archeus to fully apply.", secs=2)
133
+ elif act == 'parallel':
134
+ _open_terminal(d, name)
135
+ elif act == 'login':
136
+ _login(d)
137
+ elif act == 'rename':
138
+ new = text_input("New account name:", default=name)
139
+ if new and new != name:
140
+ if any(a.get('name') == new for a in s.get('accounts', [])) or new == 'default':
141
+ flash(f"Name '{new}' already in use", ok=False, secs=1.8)
142
+ else:
143
+ for a in s.get('accounts', []):
144
+ if a.get('name') == name:
145
+ a['name'] = new
146
+ save_settings(s)
147
+ flash(f"Renamed '{name}' → '{new}' (config dir unchanged)", secs=1.8)
148
+ elif act == 'remove':
149
+ s['accounts'] = [a for a in s.get('accounts', []) if a.get('name') != name]
150
+ if os.path.expanduser(s.get('claude_config_dir', '')) == os.path.expanduser(d):
151
+ s['claude_config_dir'] = ''
152
+ save_settings(s)
153
+ flash(f"Removed '{name}' (its config dir on disk is untouched)", secs=1.8)
154
+
155
+
156
+ #: alias — the implementation moved to config.py so the GUI can install a
157
+ #: plugin into one account without importing the TUI (accounts.py imports ui).
158
+ def _env_for(d):
159
+ return _c.account_env(_resolved(d)) # '' means the DEFAULT account, not the active one
160
+
161
+
162
+ def _login(d):
163
+ exe = _c.get_claude_exe()
164
+ if not exe:
165
+ flash("claude.exe not found", ok=False, secs=1.6)
166
+ return
167
+ _cls()
168
+ print(f"\n Opening claude under {_resolved(d)}")
169
+ print(f" Use /login to sign in, then exit to return.\n")
170
+ try:
171
+ subprocess.call([exe], env=_env_for(d))
172
+ except Exception as e:
173
+ print(f"\n Failed: {e}")
174
+ pause("\n Press Enter…")
175
+
176
+
177
+ def _open_terminal(d, name):
178
+ """Launch claude for this account in a NEW terminal window so it runs
179
+ alongside the current one (the easy 'two accounts at once')."""
180
+ exe = _c.get_claude_exe()
181
+ if not exe:
182
+ flash("claude.exe not found", ok=False, secs=1.6)
183
+ return
184
+ from . import proc
185
+ _p, err = proc.spawn_terminal([exe], env=_env_for(d), title=f'claude [{name}]')
186
+ if err:
187
+ flash(f"Could not open terminal: {err}", ok=False, secs=2)
188
+ else:
189
+ flash(f"Opened a new terminal running claude as '{name}'", secs=1.8)