handoff
/handoff
Porządkuje długą sesję agenta Hermes w tmux: zapisuje ją do JSONL, przenosi kopię do nowej karty i czyści oryginał.
- Autor
- biliboss ↗
- Repozytorium
- skills ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 09.11.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 8
- Skrypty
- 4
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 09.11.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
- 4 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.
Skrypty: plugin/handoff-guard/__init__.py, scripts/handoff.sh, scripts/test.sh, scripts/test_guard.py
Co robi i kiedy
Porządkuje długą sesję agenta Hermes w tmux: zapisuje ją do JSONL, przenosi kopię do nowej karty i czyści oryginał.
Wyzwalacze z opisu
Oryginalny opis (EN)
Use when a Hermes agent's session in tmux has grown long and must start clean without losing anything, or the owner says "handoff", "passagem de turno", "limpa a sessão", "começa do zero mas guarda", "salva as últimas sessões do bili". Logs the session (id, title, context, last message) to a JSONL, branches it offline into a tab right of the agent's, and only when the copy is up sends /new plus a short summary to the original. `handoff.sh log` lists the last sessions with the resume command. Not for opening a topic (thread) nor compacting in place (/compress).
Jak działa
- What the owner means by "handoff"
- Use
- Pitfalls
- The guard
- Tests
Podgląd SKILL.md
---
name: handoff
description: >-
Use when a Hermes agent's session in tmux has grown long and must start clean without losing anything, or the owner
says "handoff", "passagem de turno", "limpa a sessão", "começa do zero mas guarda", "salva as últimas sessões do
bili". Logs the session (id, title, context, last message) to a JSONL, branches it offline into a tab right of the
agent's, and only when the copy is up sends /new plus a short summary to the original. `handoff.sh log` lists the
last sessions with the resume command. Not for opening a topic (thread) nor compacting in place (/compress).
metadata:
version: 0.2.0
license: MIT
---
# handoff: the shift handover of an agent session
**The name.** *Handoff* is the shift handover of nursing and aviation (SBAR, the I-PASS studies; the ATC position
relief briefing): who leaves hands the state to who comes in, out loud, before leaving. Here the long session is who
leaves, the clean session is who comes in, and the branch keeps everything that was said.
## What the owner means by "handoff"
**"Faz o handoff desta sessão" means step 1 only: the log line** (session id, title, context, last message), so the
session can be found and resumed later. The branch tab and the `/new` are a separate, explicit ask ("limpa a sessão",
"começa do zero", "abre o branch"). When the words do not say clean or branch, write only the log line (same fields,
same file) and say the resume command; never launch the full script "to be safe": with `--detach` it runs the moment
the turn ends, nothing in the same turn can stop it, and it clears the owner's live tab (the desktop chat and the
Bili's tmux tab are the same session).
## Use
```
handoff.sh [<tmux target>] [--from <session id>] [--detach] # target default: $TMUX_PANE (the caller)
handoff.sh log [N] # the last N handovers, with `hermes -p bili --resume <id>`
```
Order, and nothing is skipped:
1. **Log first.** One line in `~/.local/state/bili-sessions.jsonl`: `{at, session_id, title, context, last_message,
tmux}`. The context is read from the Hermes status bar (`244.6k/1M`); the last message from
`hermes sessions export --only user-prompts`. Whatever fails later, the session can be found and resumed.
2. **The lock.** The agent must be idle (its bar says `ready`). Mid-turn, the script waits for the turn to end, at most
`HANDOFF_IDLE_TIMEOUT` (600 s); past it, nothing else happens (only the log line).
3. **Branch.** An offline fork of the session (the `thread` skill's `fork.py`: a child row, the source untouched)
opens in a tab **right of the agent's**, in the same tmux session, in the background (`new-window -a -d`: the
owner's focus is never moved), named `<tab> antes` through the `thread()` Value Object (`bili antes`).
4. **Clean.** Only when the copy shows `ready`: `/new` in the original tab, then one pasted summary (where the old
conversation went, the tab, the log, the resume command, the plan to read). A fork failure, a copy that never gets
ready, or the agent busy again: the original is left as it was.
The session id comes from `--from`, else the window's `@hsid` (threads have it), else `$HERMES_SESSION_ID` when the
target is the caller's own pane. None of them: refused, nothing changed. When the caller hands **itself** over, steps
2 to 4 run detached (its turn only ends after the script returns); their output goes to
`~/.local/state/bili-sessions.handoff.log`.
## Pitfalls
- Targets are ids (`%N`, `@N`): a session name with a dot (`sygnal 0.2`) in `=name:` is read by tmux as a pane
separator and once killed the wrong tab.
- Never run the full script on the Bili's real session unless the owner asked to clear it: it does clear the tab.
The desktop chat's `$HERMES_SESSION_ID` is the session running in the Bili's tmux tab (find it by
`pane_start_command` empty + the context number on its bar), so "this session" from the desktop is that tab.
- The Bili's own tab has no `@hsid` (only threads do): handing it over from outside needs `--from <id>`; take the id
from `hermes -p bili sessions list` (the row whose title/last activity matches) and say which one before running.
- Idle means `ready` in the **last 3 non-blank lines** of the pane, not anywhere on screen: the model name (`opus`,
`sonnet`) is on the bar even mid-turn, so the thread skill's looser readiness check would let a busy agent through.
- Optional JSONL fields go as `if $x=="" then null else $x end`, never `($x|select(.!=""))` inside the object:
`select` yielding nothing drops the WHOLE object, and the log line silently never gets written.
- The thread skill's fake hermes keeps control keys as text (`C-u` lands as `\x15` before `/new`): match the end of
the message (`/new$`) in tests, not the whole line.
- The summary tells the clean session to read the plan; the branch keeps the history, so ask it, not the log.
## The guard
`plugin/handoff-guard/` is a Hermes plugin that makes a long session hand itself over. Off by default; a folder opts in
with `HANDOFF_AT=<percent>` in `<git toplevel>/.wiki/wiki.config`, else `<git toplevel>/.biliboss` (written by
`setup-biliboss`). No key, not a git repo, or an unreadable file: it does nothing, and it never fails a turn.
- At used% >= `HANDOFF_AT` it injects, once per crossing, the order to finish the step and run
`handoff.sh --from <session id> --detach` on itself.
- At used% >= `HANDOFF_AT` + 15 it blocks the turn with that command. A user message containing `handoff` is never
blocked (the escape: say "handoff" and the agent can run it).
- Used% is real, not an estimate: `post_api_request` stores `usage.prompt_tokens` and `context_length` (what the status
bar shows) in `~/.local/state/handoff-guard/<session id>`, and `pre_llm_call` (whose payload carries no agent) reads
it. A session with no API call yet (first turn after a resume) has no number, so nothing happens.
Install (per profile; Hermes needs the plugin enabled):
```
ln -s <repo>/skills/handoff/plugin/handoff-guard ~/.hermes/profiles/<profile>/plugins/handoff-guard
hermes -p <profile> plugins enable handoff-guard # a running session only loads it on restart
```
## Tests
`scripts/test.sh`: the `thread` skill's fake hermes on a private tmux server (`-L handoff-test-<pid>`), a session
name with a dot; covers the refusal without an id, the log line, the fork, the tab position, the focus, `/new` then
the summary, `log`, a busy agent (timeout: no fork) and a failed fork (nothing sent).
`scripts/test_guard.py` (`uv run`, pytest) drives the guard hooks with fake payloads and temp git repos: no key, below
the line, inject once, re-inject after a drop, block at +15, the handoff escape, `wiki.config` over `.biliboss`, outside
a repo, bad values.
Pliki w paczce (8)
- CHANGELOG.md 1 KB
- README.md 1 KB
- SKILL.md 7 KB
- plugin/handoff-guard/__init__.py 6 KB
- plugin/handoff-guard/plugin.yaml 1 KB
- scripts/handoff.sh 8 KB
- scripts/test.sh 4 KB
- scripts/test_guard.py 4 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · biliboss/skills | 100 | MIT |
| lumpen-mya/claude-handoff | 100 | MIT |
| generous-corp/pulp | 100 | MIT |
| Ovid/paad | 100 | MIT |
| Ovid/paad | 100 | MIT |
| Ovid/paad | 100 | MIT |
| webdevnerdstuff/claude-marketplace | 100 | MIT |
| terencebristol/terencebristol-toolkit | 100 | MIT |
| verkyyi/claude-fleet | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 8a6268c42837 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100thread-handoff
Zamienia długą sesję Claude Code w trwały dokument przekazania: decyzje, stan, dokumenty i zrzuty ekranu, by kontynuować w nowej sesji. - 90hermes-session-handoff
Przekazuje bieżącą pracę z sesji, profilu, maszyny lub agenta Hermes do świeżego kontekstu bez utraty zweryfikowanego stanu, decyzji, artefaktów, blokad i dokładnego następnego kroku. - 100handoff-writer
Zamienia długą sesję w plik HANDOFF.md, by nowa sesja przejęła pracę bez czytania całej historii rozmowy. - 100memory
Redukuje sesje agenta do małej, przeszukiwalnej pamięci faktów: decyzji, preferencji, poprawek i otwartych próśb, każdy fakt sprawdzając w źródle. - 90hermes
Uruchamia lokalne profile Hermes jako agentów z własnym modelem, pamięcią i umiejętnościami, z Claude Code lub pi. - 100session-handoff-prompt
Tworzy zwięzły prompt kontynuacji, który świeża sesja agenta może wkleić, żeby wznowić długą lub zdegradowaną sesję, przy prośbach o handoff, restart lub przeniesienie kontekstu.