Skip to content

feat(NO-TASK): Announce a new release at shell startup - #70

Merged
aaronware merged 1 commit into
mainfrom
feat/shell-update-notice
Aug 30, 2026
Merged

feat(NO-TASK): Announce a new release at shell startup#70
aaronware merged 1 commit into
mainfrom
feat/shell-update-notice

Conversation

@aaronware

Copy link
Copy Markdown
Contributor

The existing notifier only speaks after someone runs a command, so the person most likely to be out of date — the one who has not opened the CLI in a fortnight — is exactly the one it never reaches. This emits a snippet for the shell profile via linchpin shell-init, so a release is announced by opening a terminal instead.

Why it is safe in a profile

  • No Node on the startup path. The common case is test plus cat against a pre-rendered file. Starting the CLI to decide whether to say anything would put ~100ms in front of every new prompt, several times a day, to print nothing on all but a handful of them.
  • Nothing in the foreground. The refresh is detached and redirected to /dev/null, so a slow or unreachable registry cannot hold up a prompt.
  • Nothing is terminal-specific — Ghostty, Terminal.app, iTerm, VS Code and Herd's terminal all just start the user's shell.

syncNoticeFile keeps the notice in step after every command and skips a write that would not change the file, so the steady state is one small read. A copy that cannot update itself — a source checkout, an npx run — neither writes nor clears it: the notice was written by the global install, and a linked working tree wiping it would silence a release for a shell that had nothing to do with that checkout.

Provenance

This was in-flight work already in the working tree, separated out and committed as its own branch so it stays clear of the security review in #69. The code and its tests are unchanged from that working state — I authored the commit message from the code, so check it describes the intent correctly.

Verification

121/121 tests pass, typecheck clean, on this branch alone.

🤖 Generated with Claude Code

The existing notifier only speaks after someone runs a command, so the person
most likely to be out of date -- the one who has not opened the CLI in a
fortnight -- is exactly the one it never reaches. Adds a snippet for the shell
profile, emitted by `linchpin shell-init`, so a release is announced by opening
a terminal instead.

Two properties keep it safe to put in a profile. First, no Node runs on the
startup path; the common case is `test` plus `cat` against a file rendered ahead
of time, rather than starting the CLI to decide whether to say anything, which
would put roughly 100ms in front of every new prompt to print nothing on all but
a handful of them. Second, nothing runs in the foreground -- the refresh is
detached and redirected to /dev/null, so a slow or unreachable registry cannot
hold up a prompt. Nothing in it is terminal-specific.

The notice file is kept in step after every command by syncNoticeFile, which
skips a write that would not change the file, so the steady state is one small
read. A copy that cannot update itself, such as a source checkout or an npx run,
neither writes nor clears it; the notice on the machine was written by the
global install, and a linked working tree wiping it would silence a release for
a shell that had nothing to do with that checkout.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@aaronware
aaronware merged commit 8e25ad0 into main Aug 30, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant