workcrew 0.1.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.
workcrew/width.py ADDED
@@ -0,0 +1,30 @@
1
+ """Display columns of text as tmux draws it.
2
+
3
+ Measured with the cursor's own column on tmux 3.2a, 3.6 and 3.8. It agrees with 3.2a. On 3.6
4
+ and 3.8 some emoji are drawn otherwise and this does not follow them: one carrying a variation
5
+ selector, such as U+2764 U+FE0F or U+26A0 U+FE0F, is two columns where this counts one; a
6
+ sequence joined by U+200D, such as U+1F469 U+200D U+1F4BB, is two where this counts four; and
7
+ on 3.8 an emoji with a skin tone modifier, such as U+1F44B U+1F3FD, is two where this counts
8
+ four. Where they differ, the command line's cursor and the width it fits a line to are out by
9
+ that much, and a Backspace can split a joined sequence. The widths are not tabled per version.
10
+ """
11
+
12
+ from __future__ import annotations
13
+
14
+ import unicodedata
15
+
16
+
17
+ def cols(s: str) -> int:
18
+ """Wide and fullwidth 2; non-spacing, enclosing and format marks 0, except the soft hyphen,
19
+ which tmux draws one column wide; everything else 1. Spacing marks are 1 even when they
20
+ have a combining class."""
21
+ return sum(
22
+ 1
23
+ if c == "\u00ad"
24
+ else 0
25
+ if unicodedata.category(c) in ("Mn", "Me", "Cf")
26
+ else 2
27
+ if unicodedata.east_asian_width(c) in ("W", "F")
28
+ else 1
29
+ for c in s
30
+ )
@@ -0,0 +1,173 @@
1
+ Metadata-Version: 2.5
2
+ Name: workcrew
3
+ Version: 0.1.0
4
+ Summary: One command starts a crew of coding agents that pick work off a shared board.
5
+ Project-URL: Homepage, https://github.com/xls-nv/workcrew
6
+ Project-URL: Changelog, https://github.com/xls-nv/workcrew/blob/main/CHANGELOG.md
7
+ Project-URL: Issues, https://github.com/xls-nv/workcrew/issues
8
+ Author: workcrew authors
9
+ License-Expression: MIT
10
+ License-File: LICENSE
11
+ Keywords: agents,claude-code,cli,tmux
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python :: 3 :: Only
17
+ Classifier: Topic :: Software Development
18
+ Requires-Python: >=3.11
19
+ Description-Content-Type: text/markdown
20
+
21
+ <p align="center">
22
+ <picture>
23
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/xls-nv/workcrew/main/docs/assets/workcrew-cursor-dark.svg">
24
+ <img src="https://raw.githubusercontent.com/xls-nv/workcrew/main/docs/assets/workcrew-cursor-light.svg" alt="workcrew" width="96">
25
+ </picture>
26
+ </p>
27
+ <h1 align="center">workcrew</h1>
28
+ <p align="center"><b>Run a team of Claude Code sessions in tmux: a leader splits your goal into tasks on a board, and workers take them.</b><br>
29
+ For developers who use Claude Code and want more than one session on the same project. Each member is your own Claude Code with your login: your user settings, CLAUDE.md, output style, hooks and permissions apply to every member, as to any session you start. Nothing is wrapped or proxied.</p>
30
+ <p align="center"><img src="https://raw.githubusercontent.com/xls-nv/workcrew/main/docs/assets/workcrew-team.png" alt="A workcrew team in tmux: three workers, the leader, the live board with who holds which task, and the command box" width="860"></p>
31
+
32
+ ## Install
33
+
34
+ ```sh
35
+ uv tool install workcrew # or: pipx install workcrew
36
+ ```
37
+
38
+ Needs tmux 3.2a or newer, Claude Code 2.1.225 or newer, Python 3.11 or newer, and Linux or macOS. workcrew currently supports Claude Code; other harnesses are coming soon. Uninstalling leaves each team's state and the members' transcripts where they are.
39
+
40
+ To upgrade, stop each team with `workcrew -r NAME exit`, reinstall with `--force` (`uv tool install --force workcrew`), and bring each back with `workcrew -r NAME`. Members call `workcrew` from their hooks, and during the install it is missing for a few seconds.
41
+
42
+ ## Start in 60 seconds
43
+
44
+ ```sh
45
+ cd ~/src/myrepo
46
+ workcrew # a team named myrepo starts here: a leader and 3 workers; you are attached
47
+ ```
48
+
49
+ 1. **Give the leader a goal.** Click the leader's pane (on the right) and type, as you would in `claude`. For example: `Make the test suite pass. Split the work into tasks for the workers.`
50
+ 2. **Watch.** Workers take tasks and report them. Press `C-]` and type `board` to see who holds what; any key closes it. To keep the board on screen, press `C-b :` and type `split-window workcrew board --loop` (`C-b C-b :` inside your own tmux). A member waiting for your answer is marked `WAITING` on its border once Claude Code reports it, six seconds after a permission prompt appears, and your terminal's bell rings once: click its pane to answer.
51
+ 3. **Add a worker.** Press `C-]`, type `add`. The leader is told.
52
+ 4. **Message everyone.** Press `C-]`, type `send all rebase on main before you report`. The rest of the line is the message.
53
+ 5. **Leave and come back.** Press `C-b d` (`C-b C-b d` inside your own tmux) to leave: the team keeps working. To stop it, press `C-]` and type `exit`; a pane of your own, such as the board, stays open and keeps you attached: press `q` in the board, or `C-b d`. Either way, `workcrew -r myrepo` from any folder brings you back to the same sessions with their history.
54
+ 6. **A second team in the same folder.** In a shell outside the team, in `~/src/myrepo`, run `workcrew --name docs --workers 2`. A team named `docs` starts there beside `myrepo`, with its own leader, workers and board, and you are attached to it.
55
+
56
+ In a folder Claude Code has not trusted yet, only the leader starts. Answer the trust question in its pane, and the workers start.
57
+
58
+ ## What to know
59
+
60
+ - **A team has a name.** The first team in a folder is named after the folder, such as `myrepo`; start another there with `workcrew --name docs`. No two teams on your machine share a name, and a name cannot be a command word. Teams in one folder share its files, as any sessions opened there do. A team's state is kept outside the folder, in `~/.local/state/workcrew/`, or `$XDG_STATE_HOME/workcrew/` when that is set.
61
+ - **The leader plans; workers do.** The leader puts tasks on the board, or gives one straight to a worker, and reviews what workers report. Each worker holds at most one task.
62
+ - **The board belongs to the team.** Members change it; you only look at it. To change the work, tell the leader.
63
+ - **Arrange the panes as you like.** Every member is in one window, however small its pane. workcrew lays its grid out when a team first starts, once more at the first attach to fit your terminal, and on `layout left|right|middle`. What you resize, swap or move with tmux is kept while the team runs, and comes back as you left it at the next start with the same members. A member you break out stays in its own window, also across a restart, until `layout`.
64
+ - **The borders name the panes.** Each member's name is on its border; `(you)` and `(board)` mark your own panes. The pane that takes your keys has ► before its name, and its name reversed.
65
+ - **Inside a team you never name it; outside you always do.**
66
+ - Inside: press `C-]` and type the command, such as `board`. The word `workcrew` may be left out there or kept, as in `workcrew add`, so a line the tool prints can be typed as it is. It acts on the team you are in. Esc closes the prompt.
67
+ - Outside, in any shell, in any folder: type `workcrew -r NAME` and the command, such as `workcrew -r myrepo board`. With a command after the name, it acts on that team, running or stopped, and never starts a new team.
68
+ - Members type the whole line in their own shell, such as `workcrew board`. It acts on their own team, and they cannot name another.
69
+ The key is `C-]` (Ctrl+]), with no terminal setting, on a Mac too. Inside the team it takes Claude Code's own Ctrl+] (open artifact). Where `]` needs AltGr, use the outside form from any shell.
70
+ - **One account, N + 1 sessions.** The leader and every worker share your Claude account's limits.
71
+ - **Members start with the shell's environment.** They see the environment of the shell that started the team's server, less the variables a Claude Code session sets for its own children, and each has its own `TMPDIR`, under `~/.cache/workcrew/` (`$XDG_CACHE_HOME/workcrew/` when that is set), which `exit --forget` removes. A variable changed later reaches them once that server starts again: `workcrew -r NAME exit` with none of your own panes left open in the team, then `workcrew -r NAME`.
72
+ - **Attach from a shell with a UTF-8 locale.** Attached from a shell under `LC_ALL=C`, tmux shows every non-ASCII character in the panes as `_`.
73
+ - **Claude Code's own flags go after `--`.** `workcrew -- --permission-mode auto` gives every member that mode, where your account allows it.
74
+ - **More than one screen.** From a second terminal, or from another computer logged in to this one, `workcrew -r NAME` attaches another screen to the same team. `C-b d` (`C-b C-b d` inside your own tmux) leaves one screen and keeps the team running; `exit` stops the team for every screen.
75
+ - **Nothing is lost on exit.** `exit`, a crash, `kill -9` or a reboot: `workcrew -r NAME` resumes every member's own session.
76
+
77
+ ## Commands
78
+
79
+ Three lines start, bring back or list teams. Type them in a shell outside any team:
80
+
81
+ ```
82
+ workcrew [--workers N] [--no-cap] [-- CLAUDE FLAGS] start this folder's team, or bring it back (default 3 workers)
83
+ workcrew --name NAME [--workers N] [--no-cap] [-- …] start another team in this folder, named NAME, and attach
84
+ workcrew -r NAME [-- CLAUDE FLAGS] bring back the team NAME from any folder, and attach; without a terminal, it does all but attach and exits 0
85
+ workcrew -r pick a team to open; without a terminal, list them: name, folder and key
86
+ ```
87
+
88
+ `-r` never starts a new team. In a folder that holds several teams, the bare `workcrew` starts nothing: it lists them, with the line to bring each back.
89
+
90
+ Every other command acts on one team. Where you are decides how you say which:
91
+
92
+ | Where you are | What you type | Example |
93
+ |---|---|---|
94
+ | Inside a team | `C-]`, then the command; it acts on this team | `board` |
95
+ | Anywhere else, in any shell | `workcrew -r NAME`, then the command | `workcrew -r myrepo board` |
96
+
97
+ - Outside a team, a command without `-r NAME` is refused. The refusal names the teams in that folder and gives the line to type.
98
+ - Inside a team you can still reach another one: `C-]`, then `-r docs` and any command, such as `-r docs board`. A name you give always wins over the team you are in. `-r docs` alone, to attach, is typed in a shell outside any team.
99
+
100
+ ```
101
+ board [--loop [SEC]] the board: who holds what, what waits for review, what is ready
102
+ add [N] add N workers (default 1)
103
+ remove MEMBER… remove workers; a task one was doing goes back to Ready
104
+ send all|workers|TO MESSAGE… write to members: leader, a worker's name, a pattern (w*), workers (every worker, not the leader) or all
105
+ layout left|right|middle lay the default grid out again, the leader on the left, the right, or between the workers
106
+ rename NEW rename the team (one word); its old name no longer reaches it
107
+ rename MEMBER NEW rename a worker (two words)
108
+ exit [--forget] stop every member, on every screen; workcrew -r NAME brings the same sessions back. --forget also sets the team's state aside, removes the members' TMPDIRs and frees its name
109
+ resume [MEMBER…] start members that exited, or just those named
110
+ resume MEMBER… -- FLAGS set those members' --model and --effort, and restart them; -- alone clears them
111
+ link … messages with another person's team
112
+ ```
113
+
114
+ Each of these is typed as shown inside a team, or after `workcrew -r NAME` outside: `workcrew -r myrepo add 2`. Run `workcrew --help` for the list, and `board --help` or `link --help` for those two. Exit codes: `0` done, `1` refused or failed, `2` wrong usage or a state workcrew will not touch.
115
+
116
+ **Claude Code flags** go after `--`; everything after it is the line's *tail*. The tail is stored and given to every member at every start; a new tail applies to members started from now. From a shell outside any team (not at `C-]`), `workcrew -r NAME -- FLAGS` stores the new tail, replacing the old one, and attaches; members already running get it at their next start (`workcrew -r NAME exit`, then `workcrew -r NAME`).
117
+
118
+ One member can have its own model and effort: `resume w1 -- --model sonnet --effort high` restarts w1 in the same session, with its task, and keeps them at every later start, over the team's flags, even ones set later; `resume w1 --` clears them. You or the leader set a worker's; only you set the leader's. An effort set in `CLAUDE_CODE_EFFORT_LEVEL` wins over `--effort`, because Claude Code reads it first, so `--effort` is refused while the team's environment sets it.
119
+
120
+ ```sh
121
+ workcrew -- --model opus --effort high # this folder's team: every member on opus
122
+ workcrew -r docs -- --model opus # the team docs, from any folder
123
+ ```
124
+
125
+ workcrew refuses flags it manages itself (`--resume`, `--session-id`, `--name`, `--continue`, `--worktree`) and flags that make no sense for a team member (`-p`, `--bare`, `--restricted` …). It also refuses a prompt as the first word after `--`. A prompt placed after other flags is not caught: it would be sent to every member at every start. Give goals in the leader's pane instead.
126
+
127
+ ## What members are told
128
+
129
+ Each member starts with a short note. The leader's note covers the board, how to add workers, and a few working principles. A worker's note says: take a task, do it, report it, and end your turn when nothing is Ready. It also says that the leader directs its work, that work is not taken or handed out by message, and that git branches are the leader's.
130
+
131
+ workcrew tells members what they need to act on.
132
+
133
+ - **The leader** hears when a task is reported; when a worker leaves, exits, or comes back holding a task; when a worker holding a task stops a second time, or stops while a background command of its own runs; when a worker holding no task, with tasks in Ready, has its turn fail or stops a second time; and when you add a worker to a running team. At a start it hears what is on the board, if anything is there or a member is down.
134
+ - **Idle workers** with no task hear of Ready's tasks, one worker for each task. When one of those exits, is removed or is given another task, the next is told.
135
+ - **A worker** hears when it is given a task, when its task is sent back, its new name when it is renamed, and, at every start while it holds a task, that task's text.
136
+
137
+ **Your `send` is typed into the member's pane**, so it is your own voice and a slash command works (`send w1 /compact`). `/model` and `/effort` typed this way also change your own saved Claude Code default; to change the team's model, use flags after `--`. A member with a draft, an open prompt or a pane too small to read is skipped and named. A slash command that opens a picker leaves it open in each pane it was sent to, and `send` names those panes. One gap: `send` looks at the pane and then presses Enter, so a permission prompt that a busy member opens in the few milliseconds between the two takes that Enter as its answer; send to a busy member only what you would let it approve. A member's `send` to another member is a teammate's note: Claude Code shows it as a message from another session, and it cannot answer a permission prompt.
138
+
139
+ ## Linking two teams
140
+
141
+ Inside your team, at `C-]`:
142
+
143
+ ```
144
+ link add bob github:bob-gh git@host:shared/relay.git bob-1a2b3c4d # trust Bob's SSH keys for his team bob-1a2b3c4d
145
+ link send bob Which format does fmt_duration print? # to Bob's leader; bob/w2 for a worker
146
+ link # your team's key and address, and the log's path
147
+ ```
148
+
149
+ From a shell, put `workcrew -r NAME` before each: `workcrew -r myrepo link`. Bob runs `link` in his team and sends you his team's key, `bob-1a2b3c4d`; `link add` prints his keys' fingerprints for you to compare with him. Bob does the same with your keys and your team's key. A team forgotten with `exit --forget` and started again has a new key, so each linked team adds it again. Messages are signed with your SSH key and carried by a git repository you both can push to. Each member's Claude Code asks you before it runs `workcrew link send`. The receiving member gets a one-line notice and reads the message with `workcrew link read`, marked as data from another team. A refused message reaches nobody and shows only in the log. Anyone who can push to a relay can make polling it slower without limit, and can stop delivery through it: choose a relay whose writers you trust. Anyone who can read the relay can read the messages: they are signed, not encrypted.
150
+
151
+ ## Inside your own tmux
152
+
153
+ Run `workcrew` from inside tmux and the team opens in a new window of your session. It runs on its own private tmux server, so it never changes your server or your `~/.tmux.conf`. Use `C-b C-b` for the team's tmux keys and `C-b l` to go back to your window. For Shift+Enter, copying (from tmux 3.4) and notifications to work in the nested team, add these lines to your own `~/.tmux.conf` (workcrew never edits it). `escape-time 10` is there because tmux before 3.5 holds a lone Esc for half a second before passing it on.
154
+
155
+ ```
156
+ set -s escape-time 10
157
+ set -s extended-keys on
158
+ set -g focus-events on
159
+ set -gq allow-passthrough on # tmux 3.3 or newer; -q keeps older ones quiet
160
+ ```
161
+
162
+ On tmux 3.4 or newer, also add `set -s set-clipboard on`. Below 3.4, a copy in the team stays in tmux's paste buffers and does not reach your system clipboard, since tmux there can crash when it sets the clipboard.
163
+
164
+ ## Security
165
+
166
+ Every member runs as you, with your full rights. A member in a permissive mode can do anything you can, including stopping the team. The leader and worker roles prevent mistakes, not attacks. A member's `workcrew link send` asks you however the member wraps it (`sh -c`, `env`, `timeout`), but not when it is written into a script that is then run, or built as a string at run time. Any program running as you can message members; Claude Code marks such messages as coming from another session; they cannot approve a prompt or widen a member's permissions. workcrew keeps its state in a private directory, never reads team settings from your project, sends no keys to a member at its start, and never answers Claude Code's trust or permission prompts on purpose (the one gap is under `send` above). Use a team on an untrusted repository only with the care you would take running `claude` there.
167
+
168
+ ## What workcrew does not do
169
+
170
+ - It does not give workers separate copies of the repository. Workers share the folder. The leader should split work so that tasks touch different files.
171
+ - It types into a pane only your own `send`, and only into an empty input box; it sends no keys at a member's start and never answers a prompt on purpose. Notices and members' messages go through Claude Code's own inbox.
172
+ - It does not run on Windows.
173
+ - It does not move a team between machines. A team's state stays on the machine that made it.
@@ -0,0 +1,23 @@
1
+ workcrew/__init__.py,sha256=JUBNWxj9VSR7quJlPWGqVL1F0xO3rv4sjJByEnNhA3w,84
2
+ workcrew/__main__.py,sha256=_zwoiJ_sHiz4Ae0-PSCKslhCa-kkB0V-x81SfOMLm38,145
3
+ workcrew/board.py,sha256=eDLjmLYkPZNyDhMeIW44l_aIBkurkKVI0cI5O44LNPA,21095
4
+ workcrew/cli.py,sha256=XmNTuewGstxxVdokEOwKoC8BhDN_WHm7CyNXFZbIkHA,101431
5
+ workcrew/link.py,sha256=CGb6_BWbU0lHT5a9PhUBbvnqvTyM6OahGPYr5N6xO8o,41451
6
+ workcrew/picker.py,sha256=KnCrzJpdrOqQkIzh6PfYr8zC_4uSvVKzu7mFrY4Dw7E,4129
7
+ workcrew/place.py,sha256=HydZLiylsvvTxE0-oIj0C2l7qvABvsRt8SNaMTaveSA,3316
8
+ workcrew/prompt.py,sha256=xQQNFLrLwCkQNaN7YyNHHC-LDdpwbOxCPjhCrys3t80,14071
9
+ workcrew/reconcile.py,sha256=-Km9qxD8wW9bE2vrsLXyuoEgKZ9Lr8wVbLQWx-c22pE,17765
10
+ workcrew/send.py,sha256=gxfKDc2fZEHelrtOFaJ2k8pprFIsRYDljyoMDoiPNf4,10597
11
+ workcrew/state.py,sha256=g6JKbNddBXpGjn2PfmGa81IDwJrTojTXlYbXfeFIEOo,18289
12
+ workcrew/tmux.py,sha256=ULl7VEtN-iINbVxhchhl3neE_G5grpTaqBfXt4CpW4U,47429
13
+ workcrew/width.py,sha256=IFYNONcnQnZ3fjmnETU0tu5hqc9-zcXV1RhPPNAmw4s,1241
14
+ workcrew/harness/__init__.py,sha256=5-1BpxaYUCO_sH0a2RSNCfD8XnR954yJIhASZsSiqFE,1988
15
+ workcrew/harness/claude.py,sha256=fvLwgkENxJlQvux7DX5_xAJWd4_8oZBvdTmJwW0nlWc,22354
16
+ workcrew/harness/claude_screen.py,sha256=4snFDygIdnxLQYVu9fCTSKjKwFGOoTnw7ngabwqD-GQ,4038
17
+ workcrew/notes/leader.md,sha256=KPhOKRysyIYw1OSMotHOPTPhzNrAoBShc0iBvP7gUow,3690
18
+ workcrew/notes/worker.md,sha256=berW0TPWgnBYCqNab5z-4lpTFLQ2aRbFVZs_IizQ0oo,758
19
+ workcrew-0.1.0.dist-info/METADATA,sha256=6tyn4xdo7chdQ-vDuWPJQqLOcQ28KrxULMlMJiOcnEM,17807
20
+ workcrew-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
21
+ workcrew-0.1.0.dist-info/entry_points.txt,sha256=Al-UrieeAfrWjBKHlWHTAhQVio1hq045-SOmYkHZ_W4,52
22
+ workcrew-0.1.0.dist-info/licenses/LICENSE,sha256=brtzxxBUCpNYUWk3qetivYw90UVrQER7jUZ9MBWrbpY,1077
23
+ workcrew-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ workcrew = workcrew.__main__:main
@@ -0,0 +1,18 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The workcrew authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6
+ associated documentation files (the "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial
12
+ portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15
+ LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18
+ USE OR OTHER DEALINGS IN THE SOFTWARE.