@inchidev/afterprompt
v0.1.0
Published
A tiny physics game pops up when your coding agent (Claude Code, Codex) takes longer than a minute, and closes when it's done.
Maintainers
Readme
AfterPrompt for Claude Code and Codex
When your agent has been working for more than a minute, a small game window opens in the corner of your screen. When the agent finishes or needs your permission, the window says so and closes itself after five seconds. It never closes while you're dragging a blob, and "keep playing" keeps it open.
Quick answers never open anything: if the agent is done within the delay, no window appears.
Install
Claude Code
/plugin marketplace add https://inchi.dev/afterprompt/marketplace.json
/plugin install afterprompt@inchiCodex
npx @inchidev/afterprompt install codexThen open codex, type /hooks, and trust the five AfterPrompt hooks. Codex skips new hooks until you do.
The installer copies the script to ~/.afterprompt/bin/afterprompt.mjs and adds its hooks to ~/.codex/hooks.json. Your other hooks stay as they are, and the original file is saved once as hooks.json.before-afterprompt. Running it again updates the hooks instead of adding them twice. To remove them:
npx @inchidev/afterprompt uninstall codexThe hooks run node. Node 18 or newer must be on your PATH.
How it works
| Claude Code hook | Codex hook | What happens |
| --- | --- | --- |
| UserPromptSubmit | UserPromptSubmit | Starts a background timer (async hook: the agent is never delayed). |
| after the delay | after the delay | Creates a session and opens …/goo?session=…&popup=1 as a chromeless Chrome, Edge, Brave, or Chromium --app window, in the top-right corner. Without a Chromium browser, it opens a normal tab. |
| Stop, Notification (permission_prompt) | Stop, PermissionRequest | Completes the session. The window shows "claude is ready" or "codex is ready", counts down, and closes. On macOS the dedicated browser profile quits once the window is gone. |
| SessionEnd | SessionEnd, Interrupt | Completes any open session. |
State lives in ~/.afterprompt/: one small file per agent session, a log, and a separate browser profile that keeps your game progress. Your everyday browser profile is never touched.
Privacy: only the agent name (claude or codex) and timestamps are sent to inchi.dev. Prompts, code, file paths, and transcripts never leave your machine.
Settings
Set these environment variables, for example in the env block of ~/.claude/settings.json, or in your shell profile for Codex:
| Variable | Default | Meaning |
| --- | --- | --- |
| AFTERPROMPT_DELAY | 60 | Seconds of work before the window opens |
| AFTERPROMPT_DISABLE | — | 1 turns the plugin off without uninstalling |
| AFTERPROMPT_BROWSER | auto | Path to a Chromium-family browser binary |
| AFTERPROMPT_URL | https://inchi.dev/afterprompt | Game server (for local development) |
| AFTERPROMPT_HOME | ~/.afterprompt | Where state, logs, and the browser profile live |
Open a practice window any time:
npx @inchidev/afterprompt open