handoff-cli 0.3.1__tar.gz → 0.3.5__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.
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/.github/workflows/publish.yml +5 -0
- handoff_cli-0.3.5/CLAUDE.md +45 -0
- handoff_cli-0.3.5/Makefile +7 -0
- handoff_cli-0.3.5/PKG-INFO +217 -0
- handoff_cli-0.3.5/README.md +208 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/README.zh-CN.md +96 -82
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/backend.py +34 -17
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/commands/init.py +45 -34
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/commands/resume.py +30 -19
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/commands/run.py +26 -15
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/main.py +2 -2
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/pyproject.toml +2 -1
- handoff_cli-0.3.1/CLAUDE.md +0 -126
- handoff_cli-0.3.1/PKG-INFO +0 -7
- handoff_cli-0.3.1/README.md +0 -182
- handoff_cli-0.3.1/image-plan.md +0 -60
- handoff_cli-0.3.1/plans/archive/ds-cli-tail-go-cli-commands-go-py-magical-toucan.md +0 -159
- handoff_cli-0.3.1/plans/archive/handoff/00-overview.md +0 -53
- handoff_cli-0.3.1/plans/archive/handoff/01-rename-packaging.md +0 -78
- handoff_cli-0.3.1/plans/archive/handoff/02-multi-backend.md +0 -152
- handoff_cli-0.3.1/plans/archive/handoff/03-skills-docs-cleanup.md +0 -73
- handoff_cli-0.3.1/plans/archive/handoff/04-config-split-env.md +0 -159
- handoff_cli-0.3.1/plans/archive/readme-zh-cn-md-readme-md-screenshot-golden-church.md +0 -70
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/.gitignore +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/__init__.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/backend_types.yaml +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/commands/__init__.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/commands/env.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/commands/list.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/commands/new.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/commands/tail.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/config.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/core.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/jsonl_parser.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/jsonl_viewer.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/skills/handoff-codex/SKILL.md +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/skills/handoff-ds/SKILL.md +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/skills/handoff-ds.toml +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/skills/handoff-opus/SKILL.md +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/stream.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/tui.py +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/cli/user_config_template.yaml +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/docs/TODO.md +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5/docs}/assets/claude-code.jpg +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5/docs}/assets/codex.jpg +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5/docs}/assets/handoff-hero.jpg +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5/docs}/assets/list-tui.jpg +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5/docs}/assets/parallel.jpg +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5/docs}/assets/shell.jpg +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5/docs}/assets/tail.jpg +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/docs/cli-reference.zh-CN.md +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/docs/configuration.zh-CN.md +0 -0
- {handoff_cli-0.3.1 → handoff_cli-0.3.5}/docs/design.zh-CN.md +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## What handoff is
|
|
6
|
+
|
|
7
|
+
A CLI proxy that dispatches coding tasks to configurable AI backends — Claude (any Anthropic-compatible endpoint) and Codex (`codex exec`). Users invoke it as a Claude Code skill or Codex subagent, rarely typing `handoff` directly.
|
|
8
|
+
|
|
9
|
+
## File map
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
cli/
|
|
13
|
+
├── main.py # Entry point: parses argv[1], dispatches to cli/commands/<cmd>.py
|
|
14
|
+
├── config.py # Loads ~/.handoff/config.yaml (user config), deep-merges with backend_types.yaml (mechanism)
|
|
15
|
+
├── backend.py # Resolves backend config → CLI args + env vars for claude/codex subprocess
|
|
16
|
+
├── core.py # SQLite state (~/.handoff/runs/handoff.db), run ID allocation, legacy migration
|
|
17
|
+
├── stream.py # execute_run(): spawn backend, parse JSONL stream, write .out.txt / .result.md
|
|
18
|
+
├── tui.py # Textual TUI for `handoff list` (DataTable, detail view, auto-refresh)
|
|
19
|
+
├── jsonl_parser.py # Low-level JSONL line parser
|
|
20
|
+
├── jsonl_viewer.py # JSONL log viewer (used by TUI detail panel)
|
|
21
|
+
├── backend_types.yaml # Mechanism contract: how each backend TYPE is launched (command, PTY, flags). NOT user-overridable.
|
|
22
|
+
├── user_config_template.yaml# Template for `handoff init` → ~/.handoff/config.yaml
|
|
23
|
+
├── commands/
|
|
24
|
+
│ ├── run.py # `handoff run` — execute a prompt against a backend
|
|
25
|
+
│ ├── new.py # `handoff new` — pre-allocate run_id, print prompt file path
|
|
26
|
+
│ ├── list.py # `handoff list` / `handoff ls` — TUI or plain-text listing
|
|
27
|
+
│ ├── resume.py # `handoff resume` — reopen or continue a past conversation
|
|
28
|
+
│ ├── tail.py # `handoff tail` — live-tail a run's output stream
|
|
29
|
+
│ ├── init.py # `handoff init` — create config, symlink skill/agent files
|
|
30
|
+
│ └── env.py # `handoff env` — print config/data paths
|
|
31
|
+
└── skills/
|
|
32
|
+
├── handoff-ds/SKILL.md # Claude Code skill → deepseek backend
|
|
33
|
+
├── handoff-codex/SKILL.md# Claude Code skill → codex backend
|
|
34
|
+
├── handoff-opus/SKILL.md # Claude Code skill → opus backend
|
|
35
|
+
└── handoff-ds.toml # Codex subagent definition → deepseek backend
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## How to release
|
|
39
|
+
|
|
40
|
+
1. Bump `version` in `pyproject.toml`
|
|
41
|
+
2. Commit: `git commit -m "release: vX.Y.Z"`
|
|
42
|
+
3. Tag: `git tag vX.Y.Z`
|
|
43
|
+
4. Push: `git push && git push --tags`
|
|
44
|
+
|
|
45
|
+
Pushing a `v*` tag triggers `.github/workflows/publish.yml` → builds with `uv build`, publishes to PyPI, creates a GitHub Release.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
.PHONY: render
|
|
2
|
+
|
|
3
|
+
render: ## Preview PyPI long description rendering
|
|
4
|
+
pip install -q "readme_renderer[md]" 2>/dev/null
|
|
5
|
+
python -m readme_renderer README.md > /tmp/handoff-pypi-preview.html
|
|
6
|
+
@echo "✅ /tmp/handoff-pypi-preview.html ($(shell wc -c < /tmp/handoff-pypi-preview.html | tr -d ' ') bytes)"
|
|
7
|
+
open /tmp/handoff-pypi-preview.html
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: handoff-cli
|
|
3
|
+
Version: 0.3.5
|
|
4
|
+
Summary: Multi coding-agent task dispatcher — a CLI proxy for claude that sends coding tasks to configurable AI backends
|
|
5
|
+
Requires-Python: >=3.9
|
|
6
|
+
Requires-Dist: pyyaml<7,>=6
|
|
7
|
+
Requires-Dist: textual<3,>=2
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
<div align="center">
|
|
11
|
+
<img src="https://raw.githubusercontent.com/dazuiba/handoff/main/docs/assets/handoff-hero.jpg" width="100%" alt="hero">
|
|
12
|
+
|
|
13
|
+
# With **Handoff**, your coding agents can finally work together.
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
| You're in | Hand off to | Why |
|
|
17
|
+
| :-- | :-- | :-- |
|
|
18
|
+
| Claude Code / Codex | **DeepSeek** | It does the simple work fast and cheap; save the expensive quota for decisions |
|
|
19
|
+
| DeepSeek | **Codex / Opus** | Borrow a brain for hard problems, bring the answer back to your session |
|
|
20
|
+
|
|
21
|
+
No tool-switching, no lost context.
|
|
22
|
+
|
|
23
|
+
**English** · [简体中文](README.zh-CN.md)
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
## Why handoff
|
|
28
|
+
|
|
29
|
+
If you use more than one coding agent, these will sound familiar:
|
|
30
|
+
|
|
31
|
+
- 💸 **"Claude / Codex: the $20 plan never lasts. The $100 plan costs too much."**<br>
|
|
32
|
+
— Just say: *"Give this task to `/handoff-ds`."* DeepSeek does the work fast and cheap. Save your expensive quota for decisions.
|
|
33
|
+
- 🤔 **"DeepSeek is stuck. I want a second opinion from Codex."**<br>
|
|
34
|
+
— Just say: *"Ask `/handoff-codex` what it thinks."* No new terminal. No re-explaining. The answer comes back to your current session.
|
|
35
|
+
- 🔁 **"`/handoff-ds` finished that task. Now I have a follow-up task for it."**<br>
|
|
36
|
+
— Just say: *"Resume the last `/handoff-ds` session, then do X."* It just sends one more message in the old conversation — all the old context is still there.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
**The math is simple:** DeepSeek V4 is as capable as Sonnet, and on [OpenCode Go](https://opencode.ai/go?ref=D5926WCTD8) the same money buys **18× the work**:
|
|
40
|
+
|
|
41
|
+
| Option | Relative cost for the same work |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| Claude Sonnet (subscription) | 1× (baseline) |
|
|
44
|
+
| DeepSeek official API | **1/3** |
|
|
45
|
+
| [OpenCode Go](https://opencode.ai/go?ref=D5926WCTD8) (includes DeepSeek V4) | **1/18** |
|
|
46
|
+
|
|
47
|
+
So: **only pay for the SOTA model** (Opus / GPT-5.5) — use it to plan and review. Everything else goes to DeepSeek. With handoff, **$20 Claude Code (plan + dispatch) + $5 OpenCode Go (execution) ≈ the work of a $200 Claude Code Max.**
|
|
48
|
+
|
|
49
|
+
## Quick start
|
|
50
|
+
|
|
51
|
+
> **Before you start:** handoff works inside Claude Code (CLI or desktop app) or Codex. You need at least one of them installed and logged in.
|
|
52
|
+
|
|
53
|
+
### 1. Install
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
uv tool install handoff-cli
|
|
57
|
+
handoff init # creates the config, links skill / agent files
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Upgrade with `uv tool upgrade handoff-cli`.
|
|
61
|
+
|
|
62
|
+
### 2. Set your token
|
|
63
|
+
|
|
64
|
+
The `opus` and `codex` backends reuse your existing Claude Code / Codex logins — zero config. **Only DeepSeek needs a token.**
|
|
65
|
+
|
|
66
|
+
For DeepSeek, we recommend the [OpenCode Go plan](https://opencode.ai/go?ref=D5926WCTD8) (lowest cost, includes DeepSeek V4). Once you have a key, edit `~/.handoff/config.yaml` and change just the `ANTHROPIC_AUTH_TOKEN` line:
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
# ~/.handoff/config.yaml — handoff init generates this for you
|
|
70
|
+
backends:
|
|
71
|
+
deepseek: # ← first = default
|
|
72
|
+
type: claude
|
|
73
|
+
model: deepseek-v4-flash
|
|
74
|
+
pro_model: "deepseek-v4-pro[1m]"
|
|
75
|
+
env:
|
|
76
|
+
ANTHROPIC_BASE_URL: https://api.deepseek.com/anthropic
|
|
77
|
+
ANTHROPIC_AUTH_TOKEN: "sk-..." # ← change this. Local proxy setup: https://github.com/iTzFaisal/oc-cc-proxy
|
|
78
|
+
ANTHROPIC_MODEL: "{model}"
|
|
79
|
+
|
|
80
|
+
opus: # local claude login — zero config
|
|
81
|
+
type: claude
|
|
82
|
+
...
|
|
83
|
+
codex: # local codex login — zero config
|
|
84
|
+
type: codex
|
|
85
|
+
...
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 3. Dispatch your first task
|
|
89
|
+
|
|
90
|
+
Go back to Claude Code and say:
|
|
91
|
+
|
|
92
|
+
> Make a plan, then hand it to `/handoff-ds`.
|
|
93
|
+
|
|
94
|
+
The task runs in the background; your session is never blocked. When it finishes, the agent reads the result and reports back.
|
|
95
|
+
|
|
96
|
+
### 4. Who you can hand work off to
|
|
97
|
+
|
|
98
|
+
| What you say | From | Hands off to | Best for |
|
|
99
|
+
| --- | --- | --- | --- |
|
|
100
|
+
| `/handoff-ds` | Claude Code | DeepSeek V4 | Execution work: writing code, running tests, refactors, bulk edits |
|
|
101
|
+
| `handoff-ds` (subagent) | Codex | DeepSeek V4 | Same as above — use this when you're inside Codex |
|
|
102
|
+
| `/handoff-codex` | Claude Code | Codex (GPT-5.5) | Heavy reasoning, second opinions, hard bugs |
|
|
103
|
+
| `/handoff-opus` | Claude Code | Claude Opus | Decisions that deserve the top model |
|
|
104
|
+
|
|
105
|
+
> Codex has no slash commands — from Codex you invoke the subagent of the same name instead: say "have `handoff-ds` execute the task above."
|
|
106
|
+
|
|
107
|
+
### 5. Watch progress / browse history
|
|
108
|
+
|
|
109
|
+
Inside Claude Code, expand the background shell and you'll see live progress right there — it renders in the shell view and uses none of your main session's context. To browse history or follow a task on its own, use `handoff list` and `handoff tail` (see the FAQ below).
|
|
110
|
+
|
|
111
|
+
## FAQ
|
|
112
|
+
|
|
113
|
+
<details>
|
|
114
|
+
<summary><b>How do I browse the task list or watch a task's progress?</b></summary>
|
|
115
|
+
|
|
116
|
+
<br>
|
|
117
|
+
|
|
118
|
+
Dispatching and resuming are the AI's job (`handoff run` / `handoff resume` under the hood). These two commands are for you — browse the list, watch the progress:
|
|
119
|
+
|
|
120
|
+
<table>
|
|
121
|
+
<tr>
|
|
122
|
+
<td width="50%" valign="top">
|
|
123
|
+
|
|
124
|
+
**`handoff list` / `handoff ls`** — interactive TUI over your full task history. See the full prompt, live status, and final result; press `G` on a row to reload that conversation and keep chatting.
|
|
125
|
+
|
|
126
|
+
</td>
|
|
127
|
+
<td width="50%" valign="top">
|
|
128
|
+
|
|
129
|
+
**`handoff tail <run-id>`** — follow a task's output stream live, like looking over its shoulder.
|
|
130
|
+
|
|
131
|
+
</td>
|
|
132
|
+
</tr>
|
|
133
|
+
<tr>
|
|
134
|
+
<td valign="top">
|
|
135
|
+
|
|
136
|
+
<!-- docs/assets/list-tui.jpg — ~480px wide — TUI list + detail view, highlight G/C shortcuts -->
|
|
137
|
+
<img src="https://raw.githubusercontent.com/dazuiba/handoff/main/docs/assets/list-tui.jpg" width="100%" alt="handoff list interactive TUI">
|
|
138
|
+
|
|
139
|
+
</td>
|
|
140
|
+
<td valign="top">
|
|
141
|
+
|
|
142
|
+
<!-- docs/assets/tail.jpg — ~480px wide — handoff tail live stream -->
|
|
143
|
+
<img src="https://raw.githubusercontent.com/dazuiba/handoff/main/docs/assets/tail.jpg" width="100%" alt="handoff tail live follow">
|
|
144
|
+
|
|
145
|
+
</td>
|
|
146
|
+
</tr>
|
|
147
|
+
</table>
|
|
148
|
+
|
|
149
|
+
</details>
|
|
150
|
+
|
|
151
|
+
<details>
|
|
152
|
+
<summary><b>Can I dispatch several tasks at once?</b></summary>
|
|
153
|
+
|
|
154
|
+
<br>
|
|
155
|
+
|
|
156
|
+
Yes. Have your agent send off several tasks in one message. Each runs on its own and reports back on its own — they never get in each other's way.
|
|
157
|
+
|
|
158
|
+
<!-- docs/assets/parallel.jpg — ~621px wide — 2–3 background tasks from one message, each with its own RESULT= path -->
|
|
159
|
+
<img src="https://raw.githubusercontent.com/dazuiba/handoff/main/docs/assets/parallel.jpg" width="621" alt="Parallel dispatch">
|
|
160
|
+
|
|
161
|
+
</details>
|
|
162
|
+
|
|
163
|
+
<details>
|
|
164
|
+
<summary><b>No uv / installing from source?</b></summary>
|
|
165
|
+
|
|
166
|
+
<br>
|
|
167
|
+
|
|
168
|
+
`pipx install handoff-cli` or `pip install handoff-cli` work just as well. From source:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
git clone https://github.com/dazuiba/handoff && cd handoff
|
|
172
|
+
uv tool install -e .
|
|
173
|
+
handoff init
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
</details>
|
|
177
|
+
|
|
178
|
+
<details>
|
|
179
|
+
<summary><b>How do I add a custom backend / what goes in the env block?</b></summary>
|
|
180
|
+
|
|
181
|
+
<br>
|
|
182
|
+
|
|
183
|
+
Add one more entry under `backends` — any Anthropic-compatible endpoint works:
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
backends:
|
|
187
|
+
kimi:
|
|
188
|
+
type: claude
|
|
189
|
+
model: kimi-k3
|
|
190
|
+
env:
|
|
191
|
+
ANTHROPIC_BASE_URL: https://api.moonshot.cn/anthropic
|
|
192
|
+
ANTHROPIC_AUTH_TOKEN: "${MOONSHOT_API_KEY}"
|
|
193
|
+
ANTHROPIC_MODEL: "{model}"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The env block is entirely yours — every key=value you set is exported before the CLI launches. `{model}` substitutes the resolved model name, `${ENV_VAR}` expands from your shell. Run `handoff env` to see where everything lives. Full details: **[configuration docs (Chinese) →](docs/configuration.zh-CN.md)**.
|
|
197
|
+
|
|
198
|
+
</details>
|
|
199
|
+
|
|
200
|
+
<details>
|
|
201
|
+
<summary><b>How does it actually work?</b></summary>
|
|
202
|
+
|
|
203
|
+
<br>
|
|
204
|
+
|
|
205
|
+
1. Your agent hands the whole task to handoff, which runs it **in the background** — your session never blocks.
|
|
206
|
+
2. handoff launches the matching CLI (`claude -p` / `codex exec`) in an isolated context and streams the full output to disk.
|
|
207
|
+
3. The main session receives exactly one line: `RESULT=<path-to-result-file>`. Progress goes to the background shell view — **never** into your main context.
|
|
208
|
+
4. On completion the agent gets notified, reads the result file, and reports back to you.
|
|
209
|
+
5. The `RESULT=` path is also a stable handle for the conversation: every follow-up round resumes the same session.
|
|
210
|
+
|
|
211
|
+
</details>
|
|
212
|
+
|
|
213
|
+
**More docs**
|
|
214
|
+
|
|
215
|
+
- **[CLI reference (Chinese) →](docs/cli-reference.zh-CN.md)** — full usage of `run` / `resume` / `list` / `tail` / `env` / `init`, run-id encoding, on-disk file layout.
|
|
216
|
+
- **[Configuration (Chinese) →](docs/configuration.zh-CN.md)** — mechanism vs data layers, env block, `${ENV}` interpolation, include, custom backends.
|
|
217
|
+
- **[Design notes (Chinese) →](docs/design.zh-CN.md)** — why Claude Code uses background shells while Codex uses a subagent; the RESULT= protocol.
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/dazuiba/handoff/main/docs/assets/handoff-hero.jpg" width="100%" alt="hero">
|
|
3
|
+
|
|
4
|
+
# With **Handoff**, your coding agents can finally work together.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
| You're in | Hand off to | Why |
|
|
8
|
+
| :-- | :-- | :-- |
|
|
9
|
+
| Claude Code / Codex | **DeepSeek** | It does the simple work fast and cheap; save the expensive quota for decisions |
|
|
10
|
+
| DeepSeek | **Codex / Opus** | Borrow a brain for hard problems, bring the answer back to your session |
|
|
11
|
+
|
|
12
|
+
No tool-switching, no lost context.
|
|
13
|
+
|
|
14
|
+
**English** · [简体中文](README.zh-CN.md)
|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
## Why handoff
|
|
19
|
+
|
|
20
|
+
If you use more than one coding agent, these will sound familiar:
|
|
21
|
+
|
|
22
|
+
- 💸 **"Claude / Codex: the $20 plan never lasts. The $100 plan costs too much."**<br>
|
|
23
|
+
— Just say: *"Give this task to `/handoff-ds`."* DeepSeek does the work fast and cheap. Save your expensive quota for decisions.
|
|
24
|
+
- 🤔 **"DeepSeek is stuck. I want a second opinion from Codex."**<br>
|
|
25
|
+
— Just say: *"Ask `/handoff-codex` what it thinks."* No new terminal. No re-explaining. The answer comes back to your current session.
|
|
26
|
+
- 🔁 **"`/handoff-ds` finished that task. Now I have a follow-up task for it."**<br>
|
|
27
|
+
— Just say: *"Resume the last `/handoff-ds` session, then do X."* It just sends one more message in the old conversation — all the old context is still there.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
**The math is simple:** DeepSeek V4 is as capable as Sonnet, and on [OpenCode Go](https://opencode.ai/go?ref=D5926WCTD8) the same money buys **18× the work**:
|
|
31
|
+
|
|
32
|
+
| Option | Relative cost for the same work |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Claude Sonnet (subscription) | 1× (baseline) |
|
|
35
|
+
| DeepSeek official API | **1/3** |
|
|
36
|
+
| [OpenCode Go](https://opencode.ai/go?ref=D5926WCTD8) (includes DeepSeek V4) | **1/18** |
|
|
37
|
+
|
|
38
|
+
So: **only pay for the SOTA model** (Opus / GPT-5.5) — use it to plan and review. Everything else goes to DeepSeek. With handoff, **$20 Claude Code (plan + dispatch) + $5 OpenCode Go (execution) ≈ the work of a $200 Claude Code Max.**
|
|
39
|
+
|
|
40
|
+
## Quick start
|
|
41
|
+
|
|
42
|
+
> **Before you start:** handoff works inside Claude Code (CLI or desktop app) or Codex. You need at least one of them installed and logged in.
|
|
43
|
+
|
|
44
|
+
### 1. Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
uv tool install handoff-cli
|
|
48
|
+
handoff init # creates the config, links skill / agent files
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Upgrade with `uv tool upgrade handoff-cli`.
|
|
52
|
+
|
|
53
|
+
### 2. Set your token
|
|
54
|
+
|
|
55
|
+
The `opus` and `codex` backends reuse your existing Claude Code / Codex logins — zero config. **Only DeepSeek needs a token.**
|
|
56
|
+
|
|
57
|
+
For DeepSeek, we recommend the [OpenCode Go plan](https://opencode.ai/go?ref=D5926WCTD8) (lowest cost, includes DeepSeek V4). Once you have a key, edit `~/.handoff/config.yaml` and change just the `ANTHROPIC_AUTH_TOKEN` line:
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
# ~/.handoff/config.yaml — handoff init generates this for you
|
|
61
|
+
backends:
|
|
62
|
+
deepseek: # ← first = default
|
|
63
|
+
type: claude
|
|
64
|
+
model: deepseek-v4-flash
|
|
65
|
+
pro_model: "deepseek-v4-pro[1m]"
|
|
66
|
+
env:
|
|
67
|
+
ANTHROPIC_BASE_URL: https://api.deepseek.com/anthropic
|
|
68
|
+
ANTHROPIC_AUTH_TOKEN: "sk-..." # ← change this. Local proxy setup: https://github.com/iTzFaisal/oc-cc-proxy
|
|
69
|
+
ANTHROPIC_MODEL: "{model}"
|
|
70
|
+
|
|
71
|
+
opus: # local claude login — zero config
|
|
72
|
+
type: claude
|
|
73
|
+
...
|
|
74
|
+
codex: # local codex login — zero config
|
|
75
|
+
type: codex
|
|
76
|
+
...
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 3. Dispatch your first task
|
|
80
|
+
|
|
81
|
+
Go back to Claude Code and say:
|
|
82
|
+
|
|
83
|
+
> Make a plan, then hand it to `/handoff-ds`.
|
|
84
|
+
|
|
85
|
+
The task runs in the background; your session is never blocked. When it finishes, the agent reads the result and reports back.
|
|
86
|
+
|
|
87
|
+
### 4. Who you can hand work off to
|
|
88
|
+
|
|
89
|
+
| What you say | From | Hands off to | Best for |
|
|
90
|
+
| --- | --- | --- | --- |
|
|
91
|
+
| `/handoff-ds` | Claude Code | DeepSeek V4 | Execution work: writing code, running tests, refactors, bulk edits |
|
|
92
|
+
| `handoff-ds` (subagent) | Codex | DeepSeek V4 | Same as above — use this when you're inside Codex |
|
|
93
|
+
| `/handoff-codex` | Claude Code | Codex (GPT-5.5) | Heavy reasoning, second opinions, hard bugs |
|
|
94
|
+
| `/handoff-opus` | Claude Code | Claude Opus | Decisions that deserve the top model |
|
|
95
|
+
|
|
96
|
+
> Codex has no slash commands — from Codex you invoke the subagent of the same name instead: say "have `handoff-ds` execute the task above."
|
|
97
|
+
|
|
98
|
+
### 5. Watch progress / browse history
|
|
99
|
+
|
|
100
|
+
Inside Claude Code, expand the background shell and you'll see live progress right there — it renders in the shell view and uses none of your main session's context. To browse history or follow a task on its own, use `handoff list` and `handoff tail` (see the FAQ below).
|
|
101
|
+
|
|
102
|
+
## FAQ
|
|
103
|
+
|
|
104
|
+
<details>
|
|
105
|
+
<summary><b>How do I browse the task list or watch a task's progress?</b></summary>
|
|
106
|
+
|
|
107
|
+
<br>
|
|
108
|
+
|
|
109
|
+
Dispatching and resuming are the AI's job (`handoff run` / `handoff resume` under the hood). These two commands are for you — browse the list, watch the progress:
|
|
110
|
+
|
|
111
|
+
<table>
|
|
112
|
+
<tr>
|
|
113
|
+
<td width="50%" valign="top">
|
|
114
|
+
|
|
115
|
+
**`handoff list` / `handoff ls`** — interactive TUI over your full task history. See the full prompt, live status, and final result; press `G` on a row to reload that conversation and keep chatting.
|
|
116
|
+
|
|
117
|
+
</td>
|
|
118
|
+
<td width="50%" valign="top">
|
|
119
|
+
|
|
120
|
+
**`handoff tail <run-id>`** — follow a task's output stream live, like looking over its shoulder.
|
|
121
|
+
|
|
122
|
+
</td>
|
|
123
|
+
</tr>
|
|
124
|
+
<tr>
|
|
125
|
+
<td valign="top">
|
|
126
|
+
|
|
127
|
+
<!-- docs/assets/list-tui.jpg — ~480px wide — TUI list + detail view, highlight G/C shortcuts -->
|
|
128
|
+
<img src="https://raw.githubusercontent.com/dazuiba/handoff/main/docs/assets/list-tui.jpg" width="100%" alt="handoff list interactive TUI">
|
|
129
|
+
|
|
130
|
+
</td>
|
|
131
|
+
<td valign="top">
|
|
132
|
+
|
|
133
|
+
<!-- docs/assets/tail.jpg — ~480px wide — handoff tail live stream -->
|
|
134
|
+
<img src="https://raw.githubusercontent.com/dazuiba/handoff/main/docs/assets/tail.jpg" width="100%" alt="handoff tail live follow">
|
|
135
|
+
|
|
136
|
+
</td>
|
|
137
|
+
</tr>
|
|
138
|
+
</table>
|
|
139
|
+
|
|
140
|
+
</details>
|
|
141
|
+
|
|
142
|
+
<details>
|
|
143
|
+
<summary><b>Can I dispatch several tasks at once?</b></summary>
|
|
144
|
+
|
|
145
|
+
<br>
|
|
146
|
+
|
|
147
|
+
Yes. Have your agent send off several tasks in one message. Each runs on its own and reports back on its own — they never get in each other's way.
|
|
148
|
+
|
|
149
|
+
<!-- docs/assets/parallel.jpg — ~621px wide — 2–3 background tasks from one message, each with its own RESULT= path -->
|
|
150
|
+
<img src="https://raw.githubusercontent.com/dazuiba/handoff/main/docs/assets/parallel.jpg" width="621" alt="Parallel dispatch">
|
|
151
|
+
|
|
152
|
+
</details>
|
|
153
|
+
|
|
154
|
+
<details>
|
|
155
|
+
<summary><b>No uv / installing from source?</b></summary>
|
|
156
|
+
|
|
157
|
+
<br>
|
|
158
|
+
|
|
159
|
+
`pipx install handoff-cli` or `pip install handoff-cli` work just as well. From source:
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
git clone https://github.com/dazuiba/handoff && cd handoff
|
|
163
|
+
uv tool install -e .
|
|
164
|
+
handoff init
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
</details>
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary><b>How do I add a custom backend / what goes in the env block?</b></summary>
|
|
171
|
+
|
|
172
|
+
<br>
|
|
173
|
+
|
|
174
|
+
Add one more entry under `backends` — any Anthropic-compatible endpoint works:
|
|
175
|
+
|
|
176
|
+
```yaml
|
|
177
|
+
backends:
|
|
178
|
+
kimi:
|
|
179
|
+
type: claude
|
|
180
|
+
model: kimi-k3
|
|
181
|
+
env:
|
|
182
|
+
ANTHROPIC_BASE_URL: https://api.moonshot.cn/anthropic
|
|
183
|
+
ANTHROPIC_AUTH_TOKEN: "${MOONSHOT_API_KEY}"
|
|
184
|
+
ANTHROPIC_MODEL: "{model}"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The env block is entirely yours — every key=value you set is exported before the CLI launches. `{model}` substitutes the resolved model name, `${ENV_VAR}` expands from your shell. Run `handoff env` to see where everything lives. Full details: **[configuration docs (Chinese) →](docs/configuration.zh-CN.md)**.
|
|
188
|
+
|
|
189
|
+
</details>
|
|
190
|
+
|
|
191
|
+
<details>
|
|
192
|
+
<summary><b>How does it actually work?</b></summary>
|
|
193
|
+
|
|
194
|
+
<br>
|
|
195
|
+
|
|
196
|
+
1. Your agent hands the whole task to handoff, which runs it **in the background** — your session never blocks.
|
|
197
|
+
2. handoff launches the matching CLI (`claude -p` / `codex exec`) in an isolated context and streams the full output to disk.
|
|
198
|
+
3. The main session receives exactly one line: `RESULT=<path-to-result-file>`. Progress goes to the background shell view — **never** into your main context.
|
|
199
|
+
4. On completion the agent gets notified, reads the result file, and reports back to you.
|
|
200
|
+
5. The `RESULT=` path is also a stable handle for the conversation: every follow-up round resumes the same session.
|
|
201
|
+
|
|
202
|
+
</details>
|
|
203
|
+
|
|
204
|
+
**More docs**
|
|
205
|
+
|
|
206
|
+
- **[CLI reference (Chinese) →](docs/cli-reference.zh-CN.md)** — full usage of `run` / `resume` / `list` / `tail` / `env` / `init`, run-id encoding, on-disk file layout.
|
|
207
|
+
- **[Configuration (Chinese) →](docs/configuration.zh-CN.md)** — mechanism vs data layers, env block, `${ENV}` interpolation, include, custom backends.
|
|
208
|
+
- **[Design notes (Chinese) →](docs/design.zh-CN.md)** — why Claude Code uses background shells while Codex uses a subagent; the RESULT= protocol.
|