anchorleg

Open source · MIT or Apache-2.0

Your agent hit 92%. The task kept going.

anchorleg runs your Claude Code and Codex tasks in the background and watches every account's 5-hour and weekly limits. When one runs low, it pauses at a clean step, writes a handoff, and carries on with the same task on another of your accounts, or on another CLI. It never spends usage credits unless you allow it.

curl -fsSL https://raw.githubusercontent.com/snehal96/anchorleg/main/install.sh | bash

macOS and Linux. Also as a .deb, prebuilt binaries or cargo install; Homebrew is coming soon. Install details

anchorleg · run #12 · ~/code/app5-hour window
claude-pro
92%
codex-plus
12%
  1. › fix the failing auth tests
  2. anchorleg: running on claude-pro
  3. ⏺ Bash(cargo test auth) · 9 of 14 pass
  4. anchorleg: claude-pro paused at a clean point (quota at 92%)
  5. anchorleg: handoff written to .handoff/TASK.md, checkpoint refs/anchorleg/run-12/1
  6. anchorleg: switching claude-pro → codex-plus (fresh start from the handoff)
  7. ⏺ All 14 auth tests pass.

See it run

Claude runs low at 92%. Codex finishes the task.

Who it's for

Hit your limit without paying for extra usage

One Claude subscription, a big extra-usage bill

Add a ChatGPT plan next to it. When Claude runs low, anchorleg continues the task on Codex from a handoff instead of on metered credits, and it never spends credits unless you allow it. anchorleg usage shows what each account costs you.

Several accounts already

Work and personal, Claude and ChatGPT: anchorleg watches every account's limits and moves the task to whichever has room, with its context.

How it works

What happens when an account runs low

anchorleg starts the official CLI (claude or codex) for you and reads its event stream. Inside Claude Code, a small mod reports exact usage and knows where it is safe to stop; Codex reports its quota after every model call.

  1. Watch

    Every account's 5-hour and weekly windows, from the CLI's own rate-limit events and the mod's exact percentages.

  2. Pause at 90%

    Before the next model request, never mid-edit. Tool results so far are already saved in the session.

  3. Hand off

    .handoff/TASK.md with the goal, steps, files touched and last message, plus a local git checkpoint of the working tree.

  4. Continue

    The next account gets the session and project memory and resumes it. A large context starts fresh from the handoff instead.

Features

One place for every session

A session manager in your terminal

anchorleg ui lists every session with its live conversation, takes new tasks and replies, and shows each account's quota. Keyboard first, mouse works too.

┌ Sessions ──────────┐┌ #12 · claude-home · running ─────────────┐
│ + New session      ││> fix the failing auth tests              │
│ ● #12 claude-home  ││⏺ Bash(cargo test auth)                    │
│ ✓ #11 claude-work  ││· anchorleg: claude-work paused (92%)          │
├ Agents ────────────┤│⏺ All 14 auth tests pass.                  │
│ 1 claude-work ████ ││                                           │
│ 2 claude-home █░░░ │├ Reply to #12 (Enter to send) ─────────────┤
└────────────────────┘└───────────────────────────────────────────┘

You approve what the agent may do

A background run can't show Claude's permission dialog, so anchorleg asks you instead. The session waits until you answer: 1 yes, 2 yes for this session, 3 no.

───────────────────────────────────────────────
Allow Write(src/auth/session.rs)?
Claude requested permissions to write to src/auth/session.rs
 1 Yes    2 Yes, for this session    3 No

Plan, goal, review

--plan: approve a plan before anything changes. --goal "cargo test passes": keep going, turn after turn, until it holds, even across accounts. anchorleg review 12 --cli codex --fix: another account or CLI reviews a session's changes and sends the findings back.

Nobody watching? --mode auto lets the CLI's own reviewer approve instead of you. accounts set work --stop-at 0.4 moves off an account at 40%.

Same model and effort on every account

One setting per provider, shared by all its accounts, so a task keeps the same strength when it moves. Type /model opus or /effort high in the message box. Your own slash commands and skills pass straight through.

Scriptable

Every command has --json output and stable exit codes, so another program (your own task delegator, a CI job) can run anchorleg as a subprocess.

ExitOutcome
0done
75every account blocked (with --no-wait)
78no account configured
130stopped by you

Ground rules

Built to use your subscriptions the way they're meant to be used

anchorleg switches between accounts you own by relaunching the official CLI. That's all.

Status

Early, and working with two CLIs today

Real switches between Claude accounts are verified; Codex is verified on real accounts (runs, follow-ups, live quota, approvals, the 90% pause). Antigravity support is under development. The rest is covered by tests that replay captured CLI output.

Claude Codesupported
Codexsupported
Antigravity (agy)in progress
Kimi, Cursorplanned
Desktop appplanned
macOS, Linuxreleased
Homebrewin progress

Get started

Five minutes, if your accounts are already logged in

# 1. install (have claude or codex signed in)
curl -fsSL https://raw.githubusercontent.com/snehal96/anchorleg/main/install.sh | bash

# 2. add your accounts: import shell aliases like
#    alias claude-work='CLAUDE_CONFIG_DIR=~/.claude-work claude'
anchorleg accounts import-aliases --yes

# 3. one model and effort for every Claude account
anchorleg settings claude --model sonnet --effort high

# 4. open the session manager, press n, describe the task
anchorleg ui