Skip to main content

Module attention

Module attention 

Source
Expand description

Read the cross-tool attention queue at ${XDG_CACHE_HOME:-$HOME/.cache}/claude-attention/queue.jsonl.

This file is the shared “notification inbox” produced by the notify-stop.sh / notify-notification.sh / notify-codex.sh hooks. Each line is one event Claude or Codex thinks the user should eventually look at — turn finished, prompt waiting, codex response ready. attention-picker.sh (bound to prefix + A) consumes them via fzf with a 1-hour cutoff; we apply the same cutoff so the dashboard agrees with the picker on “what’s pending”.

The file is append-only — entries leave only when the picker deletes them on consumption. We tolerate malformed lines (truncated writes, hand-edited junk) by skipping them.

Structs§

AttentionEntry
One pending attention entry.

Functions§

human_age
Render an epoch-second timestamp as a short relative age string (12s, 4m, 2h, 3d). Matches the human_age helper in attention-picker.sh for visual consistency.
parse_recent
queue_path
Path the bash hooks write to. Mirrors ${XDG_CACHE_HOME:-$HOME/.cache} exactly — we deliberately do NOT use dirs::cache_dir() because on macOS that returns ~/Library/Caches, while the shell hooks fall back to $HOME/.cache even on macOS.
read_recent
Read the queue, filter to entries with ts >= now - cutoff_secs, return newest first. Missing / unreadable file → empty Vec.