ClaudeCodeMod

All shelves / Marketplaces

STRML/cc-clear-handoff

STRML/cc-clear-handoff · 0 stars · 1 plugin

Marketplace

Install

In Claude Code
/plugin marketplace add STRML/cc-clear-handoff

Run inside Claude Code, then install plugins from it. Check the repo's README before you run it.

Open the repo

Plugins 1

After adding the marketplace, install one with /plugin install <name>@cc-clear-handoff-dev.

  1. 1cc-clear-handoffA focused, un-loseable alternative to /compact: /clear-handoff saves a curated handoff and auto-loads it into the next session after /clear/plugin install cc-clear-handoff@cc-clear-handoff-devv0.2.1

Files

README.md

cc-clear-handoff

A focused, un-loseable alternative to /compact for Claude Code.

/compact summarizes your whole transcript lossily and unfocused. /clear-handoff instead writes a curated handoff — only what the next session actually needs — saves it to a file, and auto-loads it into the next session after you /clear. Nothing to copy, nothing to lose.

Why

The usual "context is getting long" options both hurt:

  • /compact keeps everything, badly. It re-summarizes the entire transcript, drops the details that mattered, and you can't steer what survives.
  • Manual handoff docs are focused but fragile. You write one, run /clear, and then have to remember to paste it back — and remember where you saved it.

/clear-handoff fixes both: you (well, the model) hand-pick the state that matters, and a one-shot SessionStart hook injects it automatically the moment you start the next session in that directory. Then it deletes itself, so it fires exactly once.

How it works

/clear-handoff                         next session (after /clear)
─────────────                          ─────────────────────────────
1. gather live state (read-only):      SessionStart hook fires:
   TaskList, git branch/HEAD/status      • realpath(cwd) → find matching sentinel
2. write curated handoff to             • inject handoff into context + banner
   $(pwd)/.tmp/<work-slug>-<timestamp>.md • delete sentinel (single-use)
3. arm a sentinel keyed to the cwd     → you're resumed, automatically
   under ~/.claude/tmp/pending-handoffs
4. print a 2-line fallback prompt

The command is a prompt injection, so it runs at any moment — even while subagents are still working — and it never stops or blocks on them. It records what each subagent was doing and where its output lands, since old Task IDs don't survive a /clear.

Design details worth knowing

  • cwd-scoped + single-use. The sentinel is keyed to the working directory, so a handoff armed in project A never fires in project B. It's consumed once, then deleted.
  • realpath both sides. The sentinel is armed under the physical cwd; the SessionStart payload usually carries the logical/symlinked path. Both are realpath'd before matching, so it works under /tmp → /private/tmp, iCloud/OneDrive, and symlinked repos.
  • Only clear / startup. compact and resume keep the existing context — consuming the handoff there would be redundant and would steal the one-shot from the real post-/clear session.
  • 24h TTL. If you arm a handoff and never /clear, it expires instead of injecting stale "resuming X" context into some unrelated session days later.

Install

Add the marketplace and install the plugin:

/plugin marketplace add STRML/cc-clear-handoff
/plugin install cc-clear-handoff

Requires python3 (preinstalled on macOS and most Linux).

Usage

When context is getting long, instead of /compact:

/clear-handoff

Optionally focus the handoff for the next session:

/clear-handoff finish the CR loop on PR 42

Then run /clear. The handoff loads automatically. (If it ever doesn't, the command also prints a one-line fallback you can paste: Resume from <path>.)

Files

cc-clear-handoff/
├── commands/clear-handoff.md      the /clear-handoff command
├── hooks/clear-handoff-load.py    SessionStart auto-loader (one-shot, cwd-scoped)
└── hooks/hooks.json               registers the hook

License

MIT © Samuel Reed

Facts

Kind
Marketplace
Repo
STRML/cc-clear-handoff
Group
Uncategorized
Stars
0
Marketplace name
cc-clear-handoff-dev
Owner
Samuel Reed
License
MIT
Language
Python
Created
2026-07-08
Last push
2026-10-05
Topics
claude, claude-code, claude-code-plugin, compact, developer-tools, handoff
Plugins
1

More on this shelf

  1. 1obra/superpowersobra/superpowersAn agentic skills framework & software development methodology that works.297.9k
  2. 2affaan-m/everything-claude-codeaffaan-m/ECCThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.277.5k
  3. 3anthropics/skillsanthropics/skillsPublic repository for Agent Skills180.6k
  4. 4f/prompts.chatf/prompts.chatf.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.172.7k
  5. 5anthropics/claude-codeanthropics/claude-codeClaude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.150.3k
  6. 6nextlevelbuilder/ui-ux-pro-max-skillnextlevelbuilder/ui-ux-pro-max-skillAn AI skill that provides design intelligence for building professional UI/UX across multiple platforms.135k