I built Baton with Claude Code: a shared task board my Claude Code accounts use to hand work to each other at usage and context limits
What I built. I run two Claude Code accounts on one large project. Whenever one hit its 5-hour limit or filled its context mid-task, I had to ask it for a handover document, switch accounts and paste it in, and details got lost. Baton is a small task board the sessions use themselves:
- Each session claims its own task, so both accounts work in parallel and never on the same thing.
- When an account reaches 85% of its 5-hour limit (or 90% weekly), its session hands the task over with a note (done, next step, files, branch) and the other account picks it up.
- A Claude Code hook tracks each session's context window. At 70%, the session saves a summary to the board and gives me a two-line prompt. The new session runs board resume and continues from that summary instead of compacting.
- A page (works on a phone) shows both accounts' limits, each session's context and the task queue. I can add tasks, standing rules or a message to one account from it.
How Claude Code helped build it. I built the whole thing in Claude Code sessions in the desktop app, over a couple of days:
- I described the problem and my setup. Claude Code checked what was feasible first (for example, that desktop sessions can read plan usage through the app's usage tool, but cloud sessions can't), then proposed the design: a board the sessions call themselves, with locked task claims.
- It wrote the board (Python, standard library only), the MCP server for desktop sessions, the hosted API on Vercel with Upstash Redis, and the context hook.
- It tested as it went, with two fake accounts talking to the board over the real protocol, and the real hook running against a fake transcript. That caught real bugs before I hit them: a shell function that sent invalid JSON, duplicate session rows, and claims racing each other.
- When I used it and something was off, I told it what I saw and it fixed the cause. The limits shown were 8 hours stale because it was reading a file the desktop app rarely updates, so it switched to a live source. The task lists were too long on my phone, so it changed them to tabs.
- For the public version, it removed my personal paths and IDs, scanned for secrets, wrote the setup script and README, and made the animation in this post with Remotion.
My part was the requirements, using it on my real project every day, and deciding what to change.
Free to try. It's MIT licensed. To see the page with demo data, no accounts needed:
git clone pgamerx/coshift
cd coshift && python3 scripts/demo.py
The full setup runs on Vercel's and Upstash's free tiers. The README has the steps.
Repo: pgamerx/coshift
Feedback welcome, especially from anyone who handles limits or context differently.
8 comments
Baton: a shared task board your Claude Code sessions use to split work, hand over at usage limits, and restart at 70% context
Coshift (formerly called Baton)
Open-sourced the setup I use to run two Claude Code accounts on one repo in parallel.
How it works
- Sessions talk to a small board over HTTPS (cloud sessions) or MCP (desktop): claim_task, add_note, release_task, save_context, resume. Claims are locked, so two sessions can't take the same task even at the same moment.
- Each account gets its own token, so the board knows who is calling. Each session's restart prompt is the same two lines for every account.
- A PostToolUse hook reads the session transcript's latest token usage and reports context %. At the stop line it tells Claude, through additionalContext, to take no new work, save a summary and stop.
- A Mac can push live 5-hour and weekly usage for every account every minute. Cloud sessions can't read their own plan usage.
- Messages and standing guidance from the page reach sessions on their next board call (and through the hook).
Stack: Python standard library only, hosted on Vercel (Python function) with Upstash Redis, both free tiers. 50+ tests, including the real hook against a fake transcript.
Try the UI: git clone https://github.com/pgamerx/coshift && cd coshift && python3 scripts/demo.py
Repo: pgamerx/coshift
Feedback welcome, especially on the hook. Claude Code's transcript format isn't a public interface, so I'd like to hear if it breaks for anyone.
2 points · 7 comments
Mentions
I built Baton with Claude Code: a shared task board my Claude Code accounts use to hand work to each other at usage and context limits What I built. I run two Claude Code accounts on one large project. Whenever one hit its 5-hour limit or filled its context mid-task, I had to ask it for a handover document, switch accounts and paste it in, and details got lost. Baton is a small task board the sessions use themselves: - Each session claims its own task, so both accounts work in parallel and never on the same thing. - When an account reaches 85% of its 5-hour limit (or 90% weekly), its session hands the task over with a note (done, next step, files, branch) and the other account picks it up. - A Claude Code hook tracks each session's context window. At 70%, the session saves a summary to the board and gives me a two-line prompt. The new session runs board resume and continues from that summary instead of compacting. - A page (works on a phone) shows both accounts' limits, each session's context and the task queue. I can add tasks, standing rules or a message to one account from it. How Claude Code helped build it. I built the whole thing in Claude Code sessions in the desktop app, over a couple of days: - I described the problem and my setup. Claude Code checked what was feasible first (for example, that desktop sessions can read plan usage through the app's usage tool, but cloud sessions can't), then proposed the design: a board the sessions call themselves, with locked task claims. - It wrote the board (Python, standard library only), the MCP server for desktop sessions, the hosted API on Vercel with Upstash Redis, and the context hook. - It tested as it went, with two fake accounts talking to the board over the real protocol, and the real hook running against a fake transcript. That caught real bugs before I hit them: a shell function that sent invalid JSON, duplicate session rows, and claims racing each other. - When I used it and something was off, I told it what I saw and it fixed the cause. The limits shown were 8 hours stale because it was reading a file the desktop app rarely updates, so it switched to a live source. The task lists were too long on my phone, so it changed them to tabs. - For the public version, it removed my personal paths and IDs, scanned for secrets, wrote the setup script and README, and made the animation in this post with Remotion. My part was the requirements, using it on my real project every day, and deciding what to change. Free to try. It's MIT licensed. To see the page with demo data, no accounts needed: git clone pgamerx/coshift cd coshift && python3 scripts/demo.py The full setup runs on Vercel's and Upstash's free tiers. The README has the steps. Repo: pgamerx/coshift Feedback welcome, especially from anyone who handles limits or context differently.
Baton: a shared task board your Claude Code sessions use to split work, hand over at usage limits, and restart at 70% context Coshift (formerly called Baton) Open-sourced the setup I use to run two Claude Code accounts on one repo in parallel. How it works - Sessions talk to a small board over HTTPS (cloud sessions) or MCP (desktop): claim_task, add_note, release_task, save_context, resume. Claims are locked, so two sessions can't take the same task even at the same moment. - Each account gets its own token, so the board knows who is calling. Each session's restart prompt is the same two lines for every account. - A PostToolUse hook reads the session transcript's latest token usage and reports context %. At the stop line it tells Claude, through additionalContext, to take no new work, save a summary and stop. - A Mac can push live 5-hour and weekly usage for every account every minute. Cloud sessions can't read their own plan usage. - Messages and standing guidance from the page reach sessions on their next board call (and through the hook). Stack: Python standard library only, hosted on Vercel (Python function) with Upstash Redis, both free tiers. 50+ tests, including the real hook against a fake transcript. Try the UI: git clone https://github.com/pgamerx/coshift && cd coshift && python3 scripts/demo.py Repo: pgamerx/coshift Feedback welcome, especially on the hook. Claude Code's transcript format isn't a public interface, so I'd like to hear if it breaks for anyone.