Repository navigation
feat(afk): work to the end, notify only on done or needs-you - #46
Merged
Merged
Conversation
The hook is the half of afk mode that reaches the user: while a session's marker exists, Stop and a non-idle Notification ring the terminal, and the text says whether the work is done or needs them. It reads that from the last line of the final message, so a missing line degrades to a neutral ping rather than to silence. The terminal is found through the TUI's pid because /dev/tty cannot be opened from a hook's child process. Terminal.app shows no OSC 9, so it also gets a Notification Center message, with the text passed as argv and never parsed as AppleScript. Bump the plugin to 3.2.0: an installed copy is re-fetched only when the version moves. Refs: #45 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the afk skill, a standing mode for when the user steps away: the agent decides the ordinary itself, stops only when the task is done, for a question only the user can answer, or before a hard-to-undo action they did not ask for, and ends every turn with `AFK: DONE` or `AFK: ASK — <question>` for the hook to turn into the notification. The mode changes when the agent stops, never what it may do: no permission is widened, and a permission request is itself the needs-you ping. The READMEs say so, with the Terminal.app and tmux caveats. Closes #45 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A standing
afkmode (magic wordafk mode, off withafk off) for when you step away from a long task.afk— the agent works to completion, decides ordinary obstacles and reversible choices itself, and stops only when the task is done, for a question only you can answer, or before a hard-to-undo action you did not ask for. Every turn ends inAFK: DONEorAFK: ASK — <question>.afk-notify.pyonStop,NotificationandSessionEnd— while the session's marker exists it rings the terminal (bell + OSC 9; under Terminal.app also a Notification Center message) with "done", "needs you: …" or "stopped". Idle reminders are skipped. Sessions that never turned the mode on are untouched.Verified
make test: 4/4 checks, 24 skills.osascriptas argv only, unreachable tty is a silent no-op,SessionEndclears the marker.Not yet verified
CLAUDE_PID/CLAUDE_CODE_SESSION_ID, and the realNotificationpayload field names. The script falls back to the payload'ssession_idand the parent pid.Closes #45
🤖 Generated with Claude Code