SSkilltecabyclaudinhocode
Enviar skill
← Voltar para o catálogo

context-handoff

Design e Frontend

Session continuity for Claude — pack your current session state and load it into any new conversation with full context, decisions, behavioral contracts, and work state restored. Auto-updates on commits, decisions, and every 5 turns.

1estrelas
Ver no GitHub ↗Autor: googlarzLicença: MIT

Context Handoff

Preserve full session context across Claude conversations. Pack the current session — decisions, reasoning, work state, behavioral contracts, what was ruled out and why — and load it into any new chat. The new session resumes as if the conversation never ended.

Works for you, your future self, your teammates, and parallel Claude sessions.

Commands

All commands that prompt for confirmation accept --yes / -y to skip. See the Aliases section for shorthand forms.

CommandWhat it does
/context-handoffSmart-route: resume active session or offer to create one
/context-handoff pack [--project] [--global]Create a context pack from the current session
/context-handoff load [--quiet] [--project] [--global] [--state-only] [--contracts-only]Load a context pack at the start of a new session
/context-handoff updateForce-write an update to the current session's pack
/context-handoff verifyDiff Claude's stated session understanding against what's actually in the pack file
/context-handoff statusQuick health check for the current session
/context-handoff list [query] [--all] [--limit <n>] [--tag <tag>]List packs, optionally filtered; defaults to 20 most recent
/context-handoff open <pack> [--full]View a pack's summary and first 40 lines without loading it
/context-handoff search [--project] [--global] <query>Search pack content across all packs (or project-only with --project)
/context-handoff threads [--project] [--global]All open threads across packs, sorted by priority
/context-handoff add-thread <text> [--priority high|medium|low]Add an open thread to the active pack
/context-handoff close <thread>Mark an open thread as resolved
/context-handoff notesList all notes in the active pack
/context-handoff note <text>Add a quick observation to the active pack
`/context-handoff import <fileurl>`
/context-handoff sync [--source <name>] [--since <duration>]Pull recent context from connected MCP integrations (Granola, Slack, Linear, GitHub, etc.) — optional, degrades gracefully if no MCPs connected
/context-handoff contractsView and edit active behavioral contracts
/context-handoff amend-decision <partial-what>Edit an existing decision's reasoning in the active pack
/context-handoff diff [--vs-current] [pack1] [pack2]Compare two packs, or a pack against current git state
/context-handoff merge [--dry-run] <pack1> <pack2> [output-name]Merge two packs into a combined pack
/context-handoff rename <pack> <new-name>Rename a pack and update its topic field
/context-handoff tag <pack> <tag> [--remove]Add or remove a tag on a pack
/context-handoff archive [--project] [--global] [--older-than <days>]Move old packs to archive/ subdirectory
/context-handoff delete [--dry-run] <pack>Delete a saved session by name
/context-handoff fork [--project] [--global] <pack> [<new-name>]Create a variant of an existing pack for a parallel approach
/context-handoff export <pack> [--format markdown|json] [--output <file>]Export a pack to a clean shareable format
/context-handoff profile [edit]View or edit your persistent personal profile — context that loads automatically in every session
/context-handoff setupInteractive first-time setup wizard
/context-handoff doctor [--clean]Check hook installation, dirs, active session, and skill version; --clean removes orphaned .active entries
/context-handoff versionShow the installed skill version
/context-handoff helpShow a compact in-session command reference

No-argument invocation

When /context-handoff is invoked with no subcommand, smart-route based on session state:

  1. Check ~/.claude/handoffs/.active and .claude/handoffs/.active
  2. Active pack found (updated <= 4 hours ago):

    "Resume [topic] from [X ago]? (y/n)"

    • Yes: run /context-handoff load [pack]
    • No: ask "Create a new session pack instead? (y/n)" — if yes, run /context-handoff pack
  3. No active pack (or stale):

    "No active session. Save this conversation as a context pack? (y/n)"

    • Yes: run /context-handoff pack
    • No: show /context-handoff help

This is the recommended entry point for users who don't remember command names.


First-time onboarding

When any /context-handoff command is invoked and ~/.claude/handoffs/ does not exist:

Show this exactly once before executing the command:

context-handoff remembers your sessions. Decisions made, things tried and rejected, where you left off, how you like to work — all of it restored when you come back. Type /context-handoff help to see all commands.

Then execute the original command. Never show this message again once the directory exists.

This ensures first-time users understand what they're getting without reading the README first.


/context-handoff pack [--project]

Synthesize the current conversation into a context pack file.

Scope:

  • Default: save to ~/.claude/handoffs/
  • --project: save to .claude/handoffs/ inside the current git repo. If not in a git repo: error "Not in a git repo — cannot use --project scope"

Steps:

  1. Infer the topic from the conversation (or ask the user if ambiguous)
  2. Create the target directory if it doesn't exist
  3. Stale session check: If ~/.claude/handoffs/.active (or .claude/handoffs/.active for --project) already exists and the last_updated timestamp in that pack file is 4 hours old or older, surface it before proceeding. When --project is active, check .claude/handoffs/.active first; if no cwd entry found there, fall back to ~/.claude/handoffs/.active. Use the first entry found. The same lookup order applies in step 5 when reading prior_session.

    "Previous session detected: [topic] (last updated X hours ago). Load it, discard it, or ignore and continue?"

    • Load: run /context-handoff load with that pack
    • Discard: delete .active and proceed
    • Ignore: proceed without clearing .active (user manages it)
  4. Same-topic detection: Before generating the new pack file, compute the topic slug for the new pack. Topic slug: lowercase the topic string, replace spaces and special characters with hyphens, strip leading/trailing hyphens, truncate to 40 characters. Example: 'Auth Refactor (JWT)' → 'auth-refactor-jwt'. Check whether any file matching *-<topic-slug>.md already exists in the target directory. If found, surface it before proceeding:

    "A pack for this topic already exists: 2026-05-16-vibe-safe-release.md (last updated X ago, N updates). Update it or create a new one?"

    • Update: run /context-handoff update on that pack (rewrite with current session state, increment update_count)
    • New: proceed with creating a new dated file
  5. prior_session auto-population: If .active exists and is valid (not stale), set prior_session in the new pack's frontmatter to the path of the currently active pack before writing.
  6. CLAUDE.md seeding: Before synthesizing behavioral contracts from the session: a. Check if CLAUDE.md exists in the current directory or ~/.claude/CLAUDE.md b. If found, read it and extract any behavioral instructions (style, process, constraints) c. Seed these into behavioral_contracts prefixed with [CLAUDE.md] so they're distinguishable from session-derived ones
  7. Integrity hash: After step 6 (CLAUDE.md seeding) completes, compute content_hash by normalizing the pack content (set content_hash: "") then SHA-256 hashing the UTF-8 LF-normalized bytes. Store the resulting hex digest in content_hash and write the file once. On

Como adicionar

/plugin marketplace add googlarz/context-handoff

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Comentários · Nenhum comentário

Entre para comentar. Entrar

  • Ainda não há comentários. Seja o primeiro.