workbuddy-context-handoff

workbuddy-context-handoff is a skill for Claude Code from renky1025/agent-skills. It costs 157 tokens per session (2,220 once invoked), scanned A, original, MIT.

A WorkBuddy setup for handing work from one chat session to the next when the current session is nearly out of context. It creates a handoff document and loads it into a new session.

In plain words
What is it for?
It is for configuring automatic context handoffs, continuing work in a new session, and investigating WorkBuddy's context limits and hooks.
Why use it?
It reduces the risk of losing decisions and unfinished work when a long coding conversation is compressed or ends.

Skill for Claude Code

Written for Claude Code: SessionStart hook event.

Good fit It is for configuring automatic context handoffs, continuing work in a new session, and investigating WorkBuddy's context limits and hooks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/renky1025/agent-skills/workbuddy-context-handoff
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add renky1025/agent-skills --skill workbuddy-context-handoff
Clone the repo
git clone --depth 1 https://github.com/renky1025/agent-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for workbuddy-context-handoff

README.md
[![agentmods](https://agentmods.dev/badge/skills/renky1025/agent-skills/workbuddy-context-handoff/github.svg)](https://agentmods.dev/skills/renky1025/agent-skills/workbuddy-context-handoff)
Your own site
<a href="https://agentmods.dev/skills/renky1025/agent-skills/workbuddy-context-handoff"><img src="https://agentmods.dev/badge/skills/renky1025/agent-skills/workbuddy-context-handoff/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for workbuddy-context-handoff

Your own site · 80×15
<a href="https://agentmods.dev/skills/renky1025/agent-skills/workbuddy-context-handoff"><img src="https://agentmods.dev/badge/skills/renky1025/agent-skills/workbuddy-context-handoff.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 157 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,220 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00157 $0.02220
Opus 5.5 $0.00063 $0.00888
Sonnet 5.5 $0.00031 $0.00444
Haiku 4.5 $0.00016 $0.00222

Measured 2mo ago against content hash c3dc386450ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

workbuddy-context-handoff scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

workbuddy-context-handoff/SKILL.md · 132 lines

How it starts

The opening of the file, as written. The whole thing — 132 lines — stays where its author put it; the contents beside it link to each section on GitHub.

WorkBuddy 上下文 handoff 门禁

Purpose

在 WorkBuddy 桌面端搭一条"上下文快满 -> 强制产出 handoff 文档 -> 新会话自动续接"的流水线。

  • 触发端:Stop hook,按 transcript 里的 token 用量判断是否到阈值,到了就用 {"continue": false, "reason": "..."} 强制模型先写 handoff。
  • 注入端:SessionStart hook,把本项目最新未被消费的 handoff 注入新会话上下文。
  • 附带用途:解释/排查 WorkBuddy 的自动压缩阈值、hooks 事件与 transcript 用量计算。

When to Use

  • 用户要"上下文到 N% 自动生成 handoff / 交接文档 / 新会话续接"。
  • 用户问 WorkBuddy hooks 怎么配、为什么自动压缩了、上下文用量怎么算。
  • 需要定位 WorkBuddy 桌面端的运行时行为(阈值、config option、hook 事件)。
  • 触发词:上下文交接、handoff、上下文压缩、自动压缩、hooks 配置、新会话续接、 context handoff、auto compact。

When NOT to Use

  • 用户只是想知道"我现在用了多少上下文" -> 直接按 transcript 算一次回答,不必配 hook。
  • 目标运行时不是 WorkBuddy 桌面端(路径、事件名、环境变量都不同)-> 不适用,先确认运行时。
  • 用户要的是一份手工交接文档 -> 直接写,不需要这套门禁。

Workflow

  1. 确认位置与备份:定位 settings(用户级 ~/.workbuddy/settings.json 或项目级 <proj>/.workbuddy/settings.json),先备份,再读现有 hooks 键。
  2. 写三个脚本到 ~/.workbuddy/hooks/:handoff-trigger.mjs(Stop)、 handoff-resume.mjs(SessionStart)、run-hook.sh。各文件职责与防死循环要求见 references/hook-implementation.md。
  3. 注册 hooks(合并进 settings 的 hooks 键,不要整体覆盖):
"hooks": {
  "Stop": [
    { "hooks": [ { "type": "command", "command": "<abs>/run-hook.sh <abs>/handoff-trigger.mjs", "timeout": 15 } ] }
  ],
  "SessionStart": [
    { "matcher": "startup|clear",
      "hooks": [ { "type": "command", "command": "<abs>/run-hook.sh <abs>/handoff-resume.mjs", "timeout": 15 } ] }
  ]
}
  1. 校验 JSON:用 JSON.parse 解析整个 settings 文件,确认其余键未丢。
  2. 实测触发:手动复现单个 hook —— echo '<payload json>' | /bin/bash -lc '<command>', 再跑一轮真实会话确认 handoff 产出与注入都发生。
  3. 清理测试产物:删掉 hooks/state/ 与 handoffs/ 下的测试文件。

Decision Rules

  • 触发点只能选 Stop:它是唯一能强制模型继续的事件;注入点只能选 SessionStart:它的 stdout 或 hookSpecificOutput.additionalContext 是唯一能进新会话上下文的位置。PreCompact 不能当 handoff 触发器(stdout 只进压缩指令,exit 2 只给用户看消息)。
  • 阈值调整优先级:先看是不是被内置 50% pre-message 压缩截断 —— 开桌面端 Max Mode, 或设 CODEBUDDY_PRE_MESSAGE_COMPACT_PCT=80;确认能到目标比例后,再调 handoff.config.json 里的 handoff 阈值。
  • contextWindow 兜底顺序:handoff.config.json.contextWindow 留 null 时依次取 settings.autoCompactWindow -> CODEBUDDY_AUTO_COMPACT_WINDOW -> 200000。
  • 需要确认事件名 / matcher 语义 / hook 入参 / 阈值常量 -> 读 references/runtime-facts.md。
  • 要写或改 hook 脚本本身 -> 读 references/hook-implementation.md。
  • hook 不触发 / 到不了阈值 / 搜不到字符串 -> 见 ## Troubleshooting。

Read the full file on GitHub · 132 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 132 lines · 157 tokens per session scan A c3dc386450ef

Subscribe to this mod's changes

workbuddy-context-handoff is a skill published in the GitHub repository renky1025/agent-skills (14 stars, last pushed 1mo ago), licensed MIT. It adds 157 tokens to every session and 2,220 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-25.

Related

workbuddy-context-handoff compared with skills from other repositories

workbuddy-context-handoff next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
workbuddy-context-handoffrenky1025/agent-skillsSkill141mo agoMITA157Claude Code
project-wikiGeminiLight/MindOSSkill70723d agoMITA63Claude Code, Codex
mindos-zhGeminiLight/MindOSSkill70723d agoMITA490Claude Code
mindosGeminiLight/MindOSSkill70723d agoMITA136Claude Code
mindos-maxGeminiLight/MindOSSkill70723d agoMITA145Claude Code
mindos-viewsGeminiLight/MindOSSkill70723d agoMITA60Claude Code, Codex
mindosGeminiLight/MindOSSkill70723d agoMITA157Claude Code, Codex