SLOPSHOPPER

finish-toast

Sober toast when a long turn finishes or is waiting on an answer

newtoast
v0.1.0no licenseupdated 2026-10-06dillonmohr8777/claude-skills-repo/mods/finish-toast
A shopper browsing a rack in a slop shop
Source 1 files
hooks/register.ts 22 lines
1import type { Register } from 'claude-code'
2
3// Toasts are plain text (no ANSI), so color rides on the emoji marker.
4const MIN_MS = 45_000 // short turns stay silent; the person is still looking
5
6// Pure, so it can be dry-run without the engine.
7export const toastText = (e: { durationMs: number; answer: string; reason: string }): string | null => {
8  if (e.durationMs < MIN_MS || e.reason === 'aborted') return null
9  const s = Math.round(e.durationMs / 1000)
10  const t = s >= 60 ? `${Math.floor(s / 60)}m ${s % 60}s` : `${s}s`
11  const asks = e.answer.trim().endsWith('?')
12  return asks ? `馃煛 Needs your input (after ${t})` : `馃煝 Finished in ${t}`
13}
14
15export const register: Register = on => {
16  on('turn.complete', ($, e, next) => {
17    const text = toastText(e)
18    if (text) $.ui.toast(text)
19    return next(e)
20  })
21}
22