-
Clone the repo:
git clone https://github.com/asystemoffields/CC-Collab.git cd CC-Collab -
Requirements: Python 3.12+ (stdlib only, no pip dependencies needed).
-
Run tests:
python -m pytest test_collab.py -v
-
Try it locally:
python launcher.py /path/to/any/project
| File | Purpose |
|---|---|
collab.py |
Core CLI tool -- all collaboration commands |
inject.py |
Cross-platform terminal injection backends |
launcher.py |
Launches N Claude Code instances with role config |
test_collab.py |
Test suite |
pyproject.toml |
Package metadata and entry points |
- Zero external dependencies. Everything uses Python 3.12+ stdlib. Do not add pip packages.
- Single-file preference. Keep
collab.pyas the main tool. Only split into separate modules (likeinject.py) when the code is large and logically independent. - Type hints are welcome but not required. Don't add them retroactively to unchanged code.
- No docstring/comment churn. Only add comments where logic isn't self-evident. Don't rewrite existing docstrings for style.
- OS-level file locking for all state access -- never read-modify-write without
FileLock.
- Fork and branch from
main. - Run the test suite before and after your changes:
python -m pytest test_collab.py -v
- Test cross-platform if touching
inject.pyorlauncher.py. The injection backends are:- Windows: Win32
AttachConsole+WriteConsoleInputW - Linux/macOS:
tmux send-keysorscreen -X stuff
- Windows: Win32
- Keep the CLI stable. Existing command syntax must not break. New commands and flags are fine; changing existing ones requires a deprecation path.
- Keep PRs focused -- one feature or fix per PR.
- Title should be concise (under 70 chars). Use the body for details.
- Include a test plan or describe how you verified the change.
- If adding a new command, add it to the
build_parser()function and update the README command reference. - If adding a new
--jsonoutput path, return structured data via_emit_json().
- State is file-based JSON in
state/. Each collection (nodes,tasks,messages, etc.) is a separate.jsonfile with its own OS-level lock. - Signal files (
_signal_<node>) are the push notification mechanism -- write a reason line, the target reads and clears on nextpending/poll. - Terminal injection is abstracted in
inject.pywith a backend pattern (InjectionBackendABC). Adding a new backend (e.g., iTerm2, Kitty) means subclassing and adding to_BACKENDS. - The launcher generates platform-specific scripts (
.baton Windows,.shon Unix) and opens them in appropriate terminals.