Skip to main content
The Davenporter
Essays Notes Builds Now About
Theme
Palette
Jason Davenport

I write about agents doing real engineering work: source control, memory, telemetry, and the human side of AI.

Subscribe

Elsewhere

  • About me
  • Substack
  • Medium
  • LinkedIn
  • GitHub
  • X
  • RSS
  1. Home
  2. Essays
  3. Something to do while the agent thinks

Something to do while the agent thinks

Nov 25, 2026 · 4 min read

I was waiting a few minutes on a coding agent turn and wondered what else I could do inside the interface. Model Invaders is a fun Space Invaders sidecar, but the real intent is showing how plugins, hooks, and local sidecars can drive new workflows and where the platform edges sit.

Developer playing a tiny pixel arcade game beside a laptop while an AI agent thinks.

I was waiting a few minutes on a turn and started wondering: what if I could do other things inside Antigravity (or another coding agent) and then come right back?

So I built a game.

It's called Model Invaders, it's basically Space Invaders living next to the chat, and it only plays while an agent is working. The second a conversation finishes, asks me a question, or wants approval, the game pauses and tells me which one.

The game is interesting on its own, but the real intent is to showcase how you can use plugins, hooks, and sidecars for things you might not have thought about initially.

Model Invaders paused, showing one finished conversation waiting and a Keep playing button.

The code is in agent-skills and it runs in Antigravity, Claude Code and Codex CLI (other harnesses work too if they have hooks).

How it knows

Hooks handle the lifecycle signals. Every harness fires events as it runs: a turn starts, a tool runs, a permission prompt pops, the turn stops. A small script maps those to four states (THINKING, TOOL_RUNNING, WAITING_FOR_APPROVAL, IDLE).

A tiny local server on 127.0.0.1:4777 collects them. There are no dependencies, just Node, HTTP and server sent events, and the hooks post to it while the game listens.

Here is how the hooks, local server, and sidecar loop fit together.

Architecture diagram showing harness lifecycle hooks feeding a local SSE server that drives Model Invaders and the Needs you board.

That's the whole trick. Hooks plus a tiny local server can give any agent harness real time lifecycle awareness, and a game is only one thing you can hang off it.

Each tool call spawns a bonus UFO labeled with the tool name, so you see run_command fly across the screen while the agent works. We wanted this to be fun (the invaders are HALLUCIN, CTX_DRIFT, and RAW_GREP), so the intent was to show what we can do and how to pause on a live callback rather than ship a full working game.

The game turned into a status board

Once I had more than one chat going, the pause screen got more useful than the game.

The server tracks every conversation active in the last 30 minutes. It plays while they're all working and pauses when any one needs me. A 'Needs you' list under the game shows each waiting chat, why it's waiting, and the last thing I asked it.

If I want to keep playing while the others work I hit Enter, and sending a new prompt to the finished chat clears it too.

In Antigravity it docks in the right pane, and each row links straight back to its chat.

The right pane version with a Go to chat link for the waiting conversation.

Where the edges are

Building with agents means learning the platform's limits, and honestly most of my time went here.

  • No deep links from outside. A separate window can bring Antigravity to the front but can't open a specific chat. conversation:// links only work from inside the right pane.
  • The right pane belongs to one chat. Switch chats and it closes, you click to reopen it.
  • No prompt submit hook. The earliest signal is the first model call of the turn, so if Antigravity is compacting a long conversation the game sits paused for up to a minute.
  • The turn counter isn't always reset. I relied on invocationNum === 0 to spot a new prompt and resume didn't happen, so now a changed prompt also counts.
  • One bad field kills the hook. Return systemMessage.metadata and Antigravity silently drops the whole result.

Three things that broke

The window kept opening behind Antigravity, and every new prompt opened another one. I ended up with one shared window and an AppleScript raise instead of a fresh launch. Then I moved the default to the right pane anyway, nobody wants a window popping up on every prompt.

Keep playing stopped working. It turned out Antigravity runs its own copy of the server for the pane, so two copies held different state in memory. Now every copy re-reads the shared state file every 500 ms.

The agent edited its own hook script mid session and crashed every tool call. The plugin folder in the repo is the same one Antigravity loads, so a half finished edit went live instantly, including for the git checkout that would have fixed it, so I had to run that one myself in a terminal. Now edits to live hook scripts go to a temp file, get checked, then swap in.

When you're editing a live hook you can break all of your conversations at once, so you have to think about isolation even in your developer tools.

Try it

git clone https://github.com/davenportjw/agent-skills.git
cd agent-skills
ln -sfn "$(pwd)/plugins/thinking-arcade" ~/.gemini/config/plugins/thinking-arcade

Restart Antigravity, send a prompt, and click the Open Model Invaders link when the agent posts it. For Claude Code run claude plugin marketplace add davenportjw/agent-skills then claude plugin install thinking-arcade@davenportjw-agent-skills, and arcade-cli.mjs codex-config prints the Codex hooks. This is by no means perfect, it's meant to showcase what's possible.

If you think about other organization tools you might want to build, or even sideloading MCP apps so people stay in a single interface, there are a lot of designs you can build once you really understand the capabilities of your coding tools.

Try wiring one lifecycle hook on your own harness to a tiny local HTTP server and see what events fire. Once you have that stream, you can hang a game, a multi session status board, or an internal team tool right off it.

Let me know in the comments!

More essays

Keep reading

  • Same harness, same rules, different habits: Opus vs. Argon in Antigravity → · Nov 11, 2026 · 8 min read
  • Your coding agent is reading too much code → · Nov 06, 2026 · 5 min read
  • Coding harnesses are cheap to swap now. Model behavior isn't. → · Nov 19, 2026 · 5 min read
  • Stop generating JSON just to pick a model: semantic routing with Gemini Decisions → · Nov 13, 2026 · 5 min read
← All essays Browse all 29 essays Older essay → CLI beat MCP for my code graph, and Blender broke my line limit

Get new posts by email

I send new essays by email through Substack. Subscribe there and they'll land in your inbox.

Subscribe on Substack ↗
About · Notes · Subscribe on Substack · RSS · Privacy ·
Ask

Social card and structured data

The share image, feeds and Schema.org JSON-LD that search engines and AI tools read for this page.

Social card

Ink sketch of a developer at a laptop beside a tiny arcade cabinet with a note reading needs you.
Card URL: /og/thinking-arcade-model-invaders.svg

Machine feeds

/llms.txt /llms-full.txt /sitemap.xml /api/agent/spec

Structured data

Ask The Davenporter

Ask anything about the essays and builds on this site.