Akash001uts/claude-mods/tree/main/plugins/context-handoff
context-handoff
긴 세션을 깔끔하게 넘깁니다. context 임계값에서 Claude가 문서를 업데이트하고 인계 기록을 작성한 뒤 지침과 함께 세션을 압축하고, 킥오프 프롬프트로 계속합니다. 실시간 context 표시와 /wrap-up 스킬을 제공합니다
이 mod 소개
context-handoff
세션이 길어지면 Claude는 진행 상황을 추적하기 어려워지고, 자동 압축이 실제로 필요한 부분을 항상 보존하지도 않습니다. 이 mod는 작업을 제대로 넘깁니다. 하나의 context 창에 들어가지 않는 긴 작업, 예를 들어 전체 과제, 며칠에 걸친 프로젝트 또는 대규모 리팩터링에 적합합니다. 이 기능이 없으면 압축할 때마다 “여기까지 진행했다”는 메모를 직접 작성해야 했습니다.
작동 방식
context 창이 임계값(기본값 50%)에 도달하면:
- Claude에 마무리를 요청합니다. 프로젝트에 이미 있는 문서를 업데이트하고 인계 파일(
.claude/handoff.md)을 작성하며 압축 지침과 킥오프 프롬프트를 초안으로 만듭니다. - mod가 그 지침으로
/compact를 실행해 중요한 내용을 요약에 남깁니다. - 압축이 끝나면 킥오프 프롬프트를 보내고 Claude가 인계 파일에서 작업을 이어 갑니다.
Claude가 context가 얼마나 찼는지도 볼 수 있습니다. 각 프롬프트에는 예를 들어
Context window: 34% used (68.0k of 200.0k) 같은 숨은 줄이 추가되고, 창이 차오를 때 자연스러운 작업 종료 지점에서 마무리를 제안하도록 Claude에 알립니다(한 번만, 실제로 작업이 끝났을 때만). 세션 끝에 직접 /context-handoff:wrap-up을 실행하면 다음에 해당 프로젝트의 세션을 열 때 킥오프 프롬프트가 입력란에서 기다립니다.
명령과 설정
- 상태 줄에
Handoff at 50%가 표시되어 준비된 상태임을 알 수 있으며, 인계 중에는 현재 단계도 표시됩니다. /handoff는 context 수준과 관계없이 즉시 인계를 시작합니다./handoff 60(또는/handoff at 60%)로 자동 인계가 시작되는 시점을 바꿀 수 있습니다. 5%에서 95% 사이의 값을 사용할 수 있으며 플러그인 설정에 저장되어 세션 사이에도 유지됩니다./handoff off와/handoff on은 현재 세션의 자동 인계를 일시 중지하거나 다시 시작합니다./handoff status는 현재 표시와 설정을 보여 주고,/handoff resume는 저장된 킥오프 프롬프트를 입력란에 다시 넣습니다./config에서mode를 바꿀 수 있습니다.auto(기본값)는 모든 작업을 자동으로 수행하고,ask는 인계 프롬프트를 입력란에 넣어 직접 보내게 하며,off는 Claude에 표시만 전달합니다.handoffPath로 인계 파일의 위치를 바꿀 수 있습니다.- 주 대화에서만 인계가 이루어지고 턴이 정상적으로 끝난 뒤에만 실행됩니다. 턴을 중단하면 취소되며 Claude Code 자체의 자동 압축은 킥오프 프롬프트를 실행하지 않습니다.
실행 및 저장 내용
- Claude Code에서 세션의 context 사용량(사용 비율, 사용한 token, 창 크기)을 읽습니다. Claude Code 외부로 아무것도 보내지 않습니다.
- 제출하는 프롬프트. 인계가 시작되면 마무리 프롬프트를 제출합니다. 현재 context 비율과 창 크기, 인계 파일 경로, 위 단계만 포함하고 다른 내용은 포함하지 않습니다. 압축 후에는 Claude가 작성한 킥오프 프롬프트를 제출합니다.
ask모드에서는 입력란에만 넣고 보낼지는 사용자가 결정합니다. 세션 시작 시 저장된 킥오프 프롬프트를 입력란에 넣을 수도 있습니다(보내지는 않음). - 프롬프트 변경. 보내는 각 프롬프트에 예를 들어
[context-handoff] Context window: 34% used (68.0k of 200.0k); handoff at 50%.같은 context 표시 한 줄을 숨겨서 추가합니다. 사용자가 쓴 텍스트는 바꾸지 않습니다. - 시스템 프롬프트에 추가하는 내용. 그 줄의 의미, 작업의 자연스러운 끝에서 한 번 마무리를 제안하는 방식, 인계 파일 위치를 설명하는 짧은 안내를 추가합니다.
- 실행하는 명령. 인계마다
/compact만 한 번 실행하며 Claude가handoff_ready를 호출하고 턴이 끝난 뒤에 수행합니다. Claude의 압축 지침을 인자로 전달합니다. - 자체 도구.
handoff_ready도구 하나를 추가하고 Claude가 마무리 끝에 호출하게 합니다. mod는 호출에 직접 응답해 킥오프 프롬프트와 압축 지침을 저장합니다(세션 끝이면 다음에 사용할 킥오프 프롬프트를 저장). 다른 도구는 건드리지 않습니다. 일반 권한 규칙이 적용되므로 처음에는 확인이 필요할 수 있으며, 묻지 않게 하려면mcp__context-handoff__handoff_ready를 허용 규칙에 추가하세요. - 변경하는 설정.
/handoff 60은 이 플러그인의threshold설정(/config에 있는 같은 설정)에 임계값을 저장합니다. 다른 설정이나 환경 변수는 바꾸지 않습니다. - 마무리 중 프로젝트의 기존 문서를 편집하고 인계 파일을 작성하는 것은 mod가 아니라 Claude입니다. 평소 도구를 사용하므로 일반 권한 확인도 적용됩니다.
- 킥오프 프롬프트는 Claude Code 플러그인 저장소에 프로젝트별로 저장되어 다음 세션에서 제공할 수 있습니다. 사용하면 삭제됩니다。
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add Akash001uts/claude-mods claude plugin install context-handoff
원문 / README
context-handoff
Once a session gets long, Claude tends to get worse at keeping track of things, and auto-compact doesn't always keep the parts you actually need. This mod hands the work off properly instead. It's for longer pieces of work that don't fit in one context window, like a full assignment, a project spread over a few days, or a big refactor. Without it I was writing "here's where we're up to" notes by hand before every compact.
How it works
When the context window hits a threshold (50% by default):
- Claude gets asked to wrap up. It updates the docs your project already has, writes a handoff file
(
.claude/handoff.md), and drafts compaction instructions plus a kickoff prompt. - The mod runs
/compactwith those instructions, so the summary keeps what matters. - Once compaction finishes, it sends the kickoff prompt and Claude picks up from the handoff file.
It also lets Claude see how full the context is. Each prompt gets a hidden line like
Context window: 34% used (68.0k of 200.0k), and Claude's told to suggest wrapping up (once, and only when a task is
actually finished) if the window is filling up. If you run /context-handoff:wrap-up yourself at the end of a session,
the kickoff prompt will be waiting in the prompt box next time you open a session in that project.
Commands and settings
- The status line shows
Handoff at 50%so you know it's armed, and shows what step it's on while a handoff runs. /handoffstarts a handoff straight away, whatever the context level./handoff 60(or/handoff at 60%) changes when the automatic handoff starts. Anything from 5% to 95% works, and it saves to the plugin's settings so it sticks between sessions./handoff offand/handoff onpause or resume the automatic handoff for the current session./handoff statusshows the current reading and settings, and/handoff resumeputs a saved kickoff prompt back in the box.- In
/configyou can changemode:auto(the default) does everything itself,askputs the handoff prompt in the box for you to send, andoffjust shows Claude the reading.handoffPathchanges where the handoff file goes. - It only hands off from the main conversation, and only after a turn finishes normally. If you interrupt a turn it cancels, and Claude Code's own auto-compact never triggers the kickoff prompt.
What it runs and stores
- It reads the session's context usage from Claude Code (percentage used, tokens used, window size). It doesn't send anything outside Claude Code.
- Prompts it submits. When a handoff starts, it submits the wrap-up prompt. That prompt contains the current context
percentage and window size, the handoff file path, and the steps above, nothing else. After compaction it submits
the kickoff prompt Claude wrote. In
askmode it only fills the prompt box and you decide whether to send. At the start of a session it can also put a saved kickoff prompt in the prompt box (it doesn't send it). - What it changes in prompts. Each prompt you send gets one extra hidden line with the context reading, like
[context-handoff] Context window: 34% used (68.0k of 200.0k); handoff at 50%.Your own text isn't changed. - What it adds to the system prompt. A short guide telling Claude what that line means, to suggest wrapping up once at the natural end of a task, and where the handoff file goes.
- Commands it runs. Only
/compact, once per handoff, after Claude has calledhandoff_readyand the turn has finished. It passes Claude's compaction instructions as the argument. - Its own tool. It adds one tool,
handoff_ready, which Claude calls at the end of a wrap-up. The mod answers that call itself: it saves the kickoff prompt and compaction instructions (or, at the end of a session, saves the kickoff prompt for next time) and replies to Claude. It doesn't touch any other tool. Your normal permission rules apply to it, so you may get a prompt the first time; addmcp__context-handoff__handoff_readyto your allow rules if you don't want to be asked. - Settings it changes.
/handoff 60saves the threshold as this plugin'sthresholdsetting (the same one in/config). It doesn't set anything else or touch environment variables. - Claude (not the mod) edits your project's existing docs and writes the handoff file during a wrap-up, using its normal tools, so your usual permission prompts still apply.
- The kickoff prompt is saved in Claude Code's plugin storage, keyed to the project, so it can be offered next session. It's deleted once it's used.
Licence
MIT
동명의 다른 작품
- context-handoffWanyaldee · ★ 1
- context-handoffVibe-Commit · ★ 0
