Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Mishchenko.
`UserPromptSubmit` hook's stdout into the prompt, and Codex reads a `PermissionRequest` hook's
stdout as a decision.
4. **Never decide a permission.** The Codex `PermissionRequest` hook only observes.
5. **Never commit secrets.** A user's config (ntfy topic, token) lives in their config folder, never
in a repository. Never log the topic or a token.
5. **Never commit secrets.** A user's config (ntfy topic, tokens, the app pairing's token) lives in
their config folder, never in a repository. Never print or log the topic or a token.
6. **Never promise guaranteed delivery** in docs or output. Push is best-effort.
7. **No attribution trailers** in commits or pull requests: no `Co-Authored-By`, no "Generated
with".
Expand All @@ -37,7 +37,7 @@ Mishchenko.

| Path | Contents |
|---|---|
| `cli/src/` | The CLI: `main.ts` (commands), `hook.ts` (hook and signal logic), `state.ts` (arming), `events.ts` (protocol), `ntfy.ts`, `deliver.ts` (detached sending), `install.ts` (Codex), `skill.ts` (the alarm skill's text) |
| `cli/src/` | The CLI: `main.ts` (commands), `hook.ts` (hook and signal logic), `state.ts` (arming), `events.ts` (protocol), `ntfy.ts`, `app.ts` (pairing and the Code Alarm app's relay), `qr.ts` (the pairing QR; the encoder in `vendor/` is Project Nayuki's, MIT, kept as is), `deliver.ts` (detached sending), `install.ts` (Codex), `skill.ts` (the alarm skill's text) |
| `cli/test/` | `node:test` suites; the privacy and hook tests are the important ones |
| `cli/dist/code-alarm.mjs` | The bundled CLI, **committed** and built by `cli/build.mjs`; also the npm package's entry |
| `plugins/claude-code/` | The Claude Code plugin: manifest, hooks, the skill (generated) and `bin/` (the bundle plus PATH shims) |
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,37 @@ Notable changes to the `code-alarm` CLI and the Claude Code plugin. The format f

## [Unreleased]

## [0.2.0] — 2026-10-16

### Added

- The Code Alarm app transport, for the Android app now in testing:
- `pair <code>` pairs this computer with the phone through the Code Alarm relay. It sends only
the code and a name (`--name`, or "Windows PC", "Mac" or "Linux computer"; never the hostname).
- `unpair` removes this computer from the phone; `use ntfy|app` switches between the two.
- `status --last` shows what the phone did with the last alert: whether it rang, how long after
it was sent, and when it was stopped.
- Events go to the relay as they are, with the token only in a header. A failed push is retried
once with the same ID, which the relay dedupes.
- `pair` uses the Code Alarm relay at `https://relay.codealarm.workers.dev`; `--relay` or
`CODE_ALARM_RELAY` points it at another one, such as a local test relay.

- QR pairing: `code-alarm pair` with no code shows a QR in the terminal for the Code Alarm app to
scan, and pairs once you tap Pair on the phone. The computer makes its own token and sends the
relay only its hash. `pair <code>` still takes the code the app shows. The QR is drawn with
Project Nayuki's QR Code generator (MIT), bundled with its notice.
- `docs/protocol-examples.json`: valid and invalid events, the contract the CLI and the Code Alarm
relay both test against. `protocol.md` now states the rules exactly: the label's characters, the
ID's form, the one-hour lifetime and the clock skew the relay allows.

### Fixed

- Codex's hooks run their own copy of the CLI, made by `install codex`, and an old copy can't read
settings a newer version wrote: its alerts stopped silently. `status` now says when that copy is
older than, or different from, the code-alarm you're running. `init`, `pair`, `unpair` and
`use` update it, unless it's the newer one. Only the copy changes, so Codex doesn't ask to trust
the hooks again. The bundle's banner now carries the version.

## [0.1.0] — 2026-10-14

### Added
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ reason. If it forgets, the alarm still rings when it stops, labelled *stopped*.
`code-alarm status` shows what's set up, what's armed and the last alerts. `code-alarm disarm`
cancels arming.

Codex's hooks run their own copy of code-alarm. After you update code-alarm, `status` says if
that copy is out of date, and `init`, `pair`, `unpair` and `use` update it for you.

## How it works

```mermaid
Expand Down Expand Up @@ -122,3 +125,7 @@ To try your working copy in Claude Code: `claude --plugin-dir plugins/claude-cod
## License

[MIT](LICENSE). Not affiliated with Anthropic or OpenAI.

The CLI bundles Project Nayuki's [QR Code generator library](https://www.nayuki.io/page/qr-code-generator-library)
(MIT), to draw the pairing QR in the terminal. Its notice is kept in `cli/src/vendor/qrcodegen.ts`
and at the end of the bundle.
6 changes: 4 additions & 2 deletions cli/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ await build({
format: "esm",
target: "node22",
minify: false,
legalComments: "none",
banner: { js: "#!/usr/bin/env node\n// code-alarm, MIT License, https://github.com/Draganoider/code-alarm. Generated by cli/build.mjs: do not edit." },
// Keeps the MIT notice of the vendored QR encoder (src/vendor/qrcodegen.ts), as its licence requires.
legalComments: "eof",
// The version in the banner lets `code-alarm status` tell how old Codex's copy of the CLI is.
banner: { js: `#!/usr/bin/env node\n// code-alarm ${version}, MIT License, https://github.com/Draganoider/code-alarm. Generated by cli/build.mjs: do not edit.` },
define: { __VERSION__: JSON.stringify(version) },
});

Expand Down
Loading
Loading