Ctx Handoff

A Claude Code mod that shows context window usage

·

source at 7d29773

·

MIT licence

Turns what you teach Claude into project notes, catches its usual slips, keeps the cache warm while you're away, and picks long sessions back up

0 copies

Preview

Terminal

⎿ ctx-handoff: Panel opened above the input. Click the buttons, or press ctrl+x tab to use the keyboard. Run /handoff panel again to close it ╭─────────────────────────────────────────────────────────────────────────────────────────────╮ [-] │ ctx-handoff · Project notes and guards [ Close ] │ │ Away work enabled; next 10/19/2026, 6:40:53 PM [ Pause away work for this session ] │ │ No background usage collected for this session yet; earlier cost is not known to be zero │ │ │ │ [ Guards 0 ][ Memory 0 ][ Rules 0 ][ Last update ][ Settings ] │ │ │ │ No guards yet. Once a rule appears 3+ times you can ask the model to draft one. │ ↓ 3 more ⚠ ctx-handoff: 29 more messages until notes update

Claude Desktop

Ctx Handoff in Claude Desktop

What it does

Keeps long Claude Code sessions going: it turns what you teach Claude into per-project notes, keeps the cache warm while you're away, and can hand off to a fresh conversation.

What you see
A panel above the prompt, opened with /handoff panel
Works in
Terminal and Claude Desktop
Slash commands
/handoff, /ctx-handoff
Uses your tokens
Notes updates by Sonnet 5.5, plus idle cache refreshes
Changes files
Markdown notes in ~/.claude/projects/
Network access
None
Reviewed commit
7d29773
Preview recorded with
Claude Code 2.1.296

How it works

  1. Every so often it reads the new part of the conversation and updates the project's notes
  2. After about 50 idle minutes it sends a tiny request to keep the cache warm, up to 3 times
  3. When you /clear or reopen, the new conversation is told where the last one stopped
  4. /handoff panel opens a panel above the prompt for guards, memories, rules and settings

Good to know

  • On an API key, Bedrock or Vertex the cache lasts only 5 minutes, so run /handoff refresh off there.
  • Auto handoff is off by default. Turn on auto_handoff in the panel's Settings tab to hand off at 600k tokens.
  • A guard it drafts applies only after Claude asks you about it and you say yes.

More like this

Terminal

☀ 44k │ 5h 26% │ 7d 7% │ cache 5% [-]

Claude Desktop

Token Weather Usage in Claude Desktop

One line above the prompt: context tokens with their weather, a bar per recent prompt, your 5-hour and 7-day limits against the time elapsed, the prompt cache with its time left, the session cost with the last prompt's share in dollars and in points of the 5-hour limit, and the subagents running. Labels in English, French or Russian. After Token Weather (Anthropic, Apache-2.0) and the ideas of usage-meter (HolyGrail) and prompt-cache-control (Daniel San).

Terminal

╭─────────────────────────────────────────────────────────────────────────────────────────────╮ [-] │ ◆ context 44k of 200k · compacts at 167k 22% │ │ ████████████████████────────────────────────────────────────────────────────░░░░░░░░░░░░░░░ │ │ ■ system prompt 1.9k 1% ■ system tools 28k 14% ■ skills 2k 1% ■ messages 12k 6% │ │ ─ free space 123k ░ autocompact buffer 33k │ ╰─────────────────────────────────────────────────────────────────────────────────────────────╯

Claude Desktop

Context Bar in Claude Desktop

Your context window as a stacked bar above the prompt, a color per category, with token counts and the compaction point. /context-bar shows or hides it.

Terminal

⎿ deck: Sample plan running above the prompt, with sample routing until real ones arrive. [-] 0: deck ▾ · 5 rows /home/user/app · 12:25:44 ⇄ Model route opus = opus jev: haiku · not applied effort ▁▃·· medi = kept ✕ ✓ Orders module Done · 12/12 · 2/2 agents 100% ✕ ● Context 44k / 200k 22% ✕ ◔ Session · 5h 5h · 26% used ↻ 2:04:25 ✕ ◔ Weekly · 7d 7d · 7% used ↻ 2d 0h 57m ✕ [ Deck 1 ]

Claude Desktop

Deck in Claude Desktop

A cockpit for Claude Code: plan bars and subagent strips, context, usage limits with reset countdowns and burn rates, spend, the model route and a pet. Six bar styles, three collapsed looks. CLI and Desktop.

Terminal

⎿ flightdeck: Flightdeck opened. Focus it with ctrl+x tab; 1-6 expand cards, f/s/o open the gate rows. ╭────────────────────────────────────────────────────────────────────────────────────────────────✕─╮ │ Opus 4.8 ○ idle · ctx ▰▱▱▱▱▱ 22% · $0.25 │ │ last turn 0s · 0 agents · 0 edits · 0 errors │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ⚠ flightdeck: ctx 22%

Claude Desktop

Flightdeck in Claude Desktop

Flightdeck: a live agent dashboard for Claude Code. Main model vitals, an on-call architect, every permission check, subagent cards and swimlanes, a turn receipt and a session log, all from real session events

╭─ CONTEXT ────────────────────────────────────────────╮ │ ████▊░░░░░░░░░░░░░░░░░ 22% of 200K · GOOD │ ├─ STATS ──────────────────────────────────────────────┤ │ ↓ 44.0K ↑ 1.4K │ $0.41 │ ⏱ 10m 12s │ +128/-34 │ ├─ REPO ───────────────────────────────────────────────┤ │ ◆ Opus 4.8 · main · 16:21 │ ╰──────────────────────────────────────────────────────╯

A boxed multi-line panel with auto-sizing borders: a context section with a gradient bar and status word, a stats section (tokens, cost, duration, lines changed), and a repo section (model, git branch with file counts, clock, vim mode), in a terracotta Claude-brand palette.

app · main · Opus-4.8 · effort high · ctx 22% · 5h 26% ↻2h6m · 7d 7% ↻2d0h

One-line status bar showing your directory, git branch (with a * when dirty), model, live effort level, context-window usage, and 5-hour/7-day rate-limit usage.

Opus 4.8 [high] ~/app main 16:20:55 | ⛁ ██░░░░░░░░ 22% | 5h ●◔○○○ 26% ↻2h7m | 7d ◔○○○○○○ 7% ↻2d1h │ $0.41 ⏱ 10m

Two-line status with a block context bar and quarter-step dot meters (◔◑◕●) for the 5-hour and weekly limits (fill shows usage, color shows whether you are ahead of or behind pace), plus model, effort, git and cost. Needs no jq.

████▊░░░░░░░░░░░░░░░░░ 22% of 200K · GOOD │ ↓ 44.0K ↑ 1.4K │ $0.41 │ ⏱ 10m 12s │ +128/-34 │ ◆ Opus 4.8 · main · 16:22

One-line adaptation of @kyleledbetter's Dreambase Panel: a context bar with status word, token/cost/duration/lines-changed stats, and model + git branch + clock, all on a single line in a terracotta Claude-brand palette.