Example from the repository$ bash ensaio-hook.sh 220000 120 UserPromptSubmit
{"decision": "block", "reason": "Sessão parada há 2h00: o cache venceu e esta mensagem
vai reprocessar ~220 mil tokens do seu limite. Para continuar aqui, reenvie a mensagem.
Para começar limpo: NENHUM handoff desta sessão foi gravado: antes do /clear, peça para
gravar (skill session-handoff), senão o /prime não terá o caminho deste trabalho."}
$ bash ensaio-hook.sh - - UserPromptSubmit
$ bash ensaio-hook.sh 250000 0 Stop
$ cat /tmp/ensaio-hook/agenda.jsonl
{"unidade": "longrun-ocioso-ensaio", "minutos": 45, "cmd": ["/usr/bin/python3",
".../execucao-longa/tools/hook-longrun.py", "--ocioso", "ensaio", ...]}With LONGRUN_AGENDAR_ARQ the hook only records the scheduling in a file, instead of creating the real timer. It's the same variable the kit's tests use.
Example from the kit's README (session idle for 5h33 with 220k tokens):
● UserPromptSubmit operation blocked by hook:
Sessão parada há 5h33: o cache venceu e esta mensagem vai reprocessar ~220 mil tokens do seu limite.
Para continuar aqui, reenvie a mensagem. Para começar limpo: /clear e depois /prime
(o último handoff do projeto é indicado na abertura).
Since 1.7.1, when this session saved a handoff, the warning includes its path on separate lines: /clear and /prime handoffs/history/[file].md. Another session may have saved a newer one in the same project.