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.
npx skills add renky1025/agent-skills --skill workbuddy-context-handoffgit clone --depth 1 https://github.com/renky1025/agent-skillsWrote 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.
[](https://agentmods.dev/skills/renky1025/agent-skills/workbuddy-context-handoff)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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
- 确认位置与备份:定位 settings(用户级
~/.workbuddy/settings.json或项目级<proj>/.workbuddy/settings.json),先备份,再读现有hooks键。 - 写三个脚本到
~/.workbuddy/hooks/:handoff-trigger.mjs(Stop)、handoff-resume.mjs(SessionStart)、run-hook.sh。各文件职责与防死循环要求见references/hook-implementation.md。 - 注册 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 } ] }
]
}
- 校验 JSON:用
JSON.parse解析整个 settings 文件,确认其余键未丢。 - 实测触发:手动复现单个 hook ——
echo '<payload json>' | /bin/bash -lc '<command>', 再跑一轮真实会话确认 handoff 产出与注入都发生。 - 清理测试产物:删掉
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。
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.
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.
- 2mo ago First seen · 132 lines · 157 tokens per session scan A c3dc386450ef
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.
workbuddy-context-handoff compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| workbuddy-context-handoffrenky1025/agent-skills | Skill | 14 | 1mo ago | MIT | A | 157 | Claude Code |
| project-wikiGeminiLight/MindOS | Skill | 707 | 23d ago | MIT | A | 63 | Claude Code, Codex |
| mindos-zhGeminiLight/MindOS | Skill | 707 | 23d ago | MIT | A | 490 | Claude Code |
| mindosGeminiLight/MindOS | Skill | 707 | 23d ago | MIT | A | 136 | Claude Code |
| mindos-maxGeminiLight/MindOS | Skill | 707 | 23d ago | MIT | A | 145 | Claude Code |
| mindos-viewsGeminiLight/MindOS | Skill | 707 | 23d ago | MIT | A | 60 | Claude Code, Codex |
| mindosGeminiLight/MindOS | Skill | 707 | 23d ago | MIT | A | 157 | Claude Code, Codex |