AI Agent Keys
Agent keys need firmware 1.13.0 and PolyKybdHost 1.22.4 or later.
Each AI coding agent session you run (Claude Code, Codex, Gemini CLI, Copilot CLI, OpenCode, Qwen Code and others) gets one key of the number row, 1 to 0. The key’s light shows what the agent does. Hold the AI key and every number key shows a card for its agent: the agent’s mark, its state and the session’s title. Press a number key to bring that agent’s window to the front.

The cards
Section titled “The cards”From PolyKybdHost 1.28.2, a card shows:
- the agent’s mark at the top left, cut by the top edge of the display;
- the session’s title in up to three lines. A longer title is split into pages, and the card shows the next page every 3 seconds;
- a state icon at the bottom right: an arrow for working, ! for waiting, a check mark for done, a moon for idle and ? for stale;
- for a Claude Code cloud session, a cloud outline over the mark, so you can tell it from a session on your computer.
The lights
Section titled “The lights”| Light | State | Meaning |
|---|---|---|
| Amber, slowly pulsing | working | The agent runs a prompt or a tool. |
| Red, blinking | waiting | The agent waits for your answer, for example a permission prompt. |
| Green | done | The agent finished its turn. |
| Dim green | idle | The session is open and nothing happens. |
| Dim white | stale | A working agent reported nothing for 30 minutes. |
The lights show only while RGB lighting is on. Keys with no agent keep the running effect.
While an agent waits, a ripple runs over the keycaps from its number key every 4 seconds (split72). When several agents wait, they take turns.
From firmware 1.13.6, when an agent finishes its turn (working to done), the same ripple runs from its number key three times, 4 seconds apart (split72), so you see when to check the result. The ripple of a waiting agent runs first. Press the key to stop it.
From firmware 1.13.9 and PolyKybdHost 1.27.6, an agent on another page gets the ripple too: it runs from the AI key, every 4 seconds while the agent waits and three times when it finishes. Hold the AI key and press Esc to get to that page. Paging rings no key.
The AI key
Section titled “The AI key”From firmware 1.13.2, the split72 layouts QWERTY, Stag, Colemak DH and Workman have the AI key where Hyper was. On QWERTY it is the key left of Y. A keyboard that stored its keymap gets this change once, at the first start after the update: only keys that still hold Hyper there become the AI key, and keys you remapped and your macros stay. PolyKybdHost 1.22.8 names the change in the firmware update dialog.
Neo and the split42 have no AI key by default. In the keymap editor,
the AI key is the first tile on the User / Macro tab, labelled AI. From the command
line, polyctl keymap set <layer> <row> <col> 0x7E2A puts it on a key.
| You do | What happens |
|---|---|
| Tap the AI key | It sends a Hyper tap (Ctrl+Shift+Alt+Win). On Windows this opens Copilot. A tap does not show the cards. |
| Hold the AI key | AI mode: the number row shows one card per agent. |
| Hold it and press a number key | The agent of that key comes to the front, and AI mode ends. |
| Long press and release | AI mode stays on until you press a key, or for 10 seconds. You can then reach the keys with the same hand. |
In AI mode, more keys have a job:
| Key | In AI mode |
|---|---|
| 1 to 0 | Bring that agent’s window forward. |
| Esc | Next page, when more than 10 agents run. From firmware 1.13.9 it shows the page, for example Next 1/2. It blinks red when an agent on another page waits. When AI mode ends, the keys show page 1 again. |
| - | Start dictation. The default is Win+H on Windows; set your own shortcut in Settings → AI agents → Dictation shortcut. |
| + (the = key) | Bring the next waiting agent forward. It blinks red while any agent waits. |
Hold a number key
Section titled “Hold a number key”Outside AI mode, the number key of a waiting agent works as a hold key. Hold it longer than the tapping term and the agent’s window comes forward, as AI key + number does. Tap it and it types its digit, as always. From firmware 1.13.6, the key of a finished agent works the same way while its ripple runs and for 4 seconds after the last one (split72). The keys of other agents are not held back at all.
Turn it on
Section titled “Turn it on”
Click an agent in the list to bring its window forward, as its key does.
- In the tray menu, choose AI Agents → Show on the Number Row, or run
polyctl settings set agents_enabled true. - Unplug and replug the keyboard once.
- Set up the hooks for each agent you use (next section).
Set up the hooks
Section titled “Set up the hooks”An agent tells the host its state through a hook: on each event (prompt sent, tool started,
permission asked, turn finished) the agent runs one polyctl command. The host writes these hooks
for you:
- Tray menu: AI Agents → Set Up Hooks…, or Integrations… → AI agents. Tick the agents and click Install. Each row shows the agent’s settings file and whether the hooks are set up. Remove takes them out again. Needs PolyKybdHost 1.25.0.
- Command line:
polyctl agents hooks install <agent>, where<agent>isclaude-code,codex,copilot,gemini,qwenoropencode.
The installer shows the change and asks before it writes. It keeps the hooks you wrote yourself
and saves a copy of each file as <file>.polykybd.bak. --dry-run only shows the change;
polyctl agents hooks uninstall <agent> removes the hooks again.
The hook sends the session id, the event, the state, the working folder and the agent’s process id. For Claude Code it also sends the session’s title, which is the text of the terminal tab and can describe your work. It never sends your prompt, the transcript or tool arguments.
The Codex installer writes Codex’s notify setting, which reports only that a turn finished, so a
Codex key shows done but never working or waiting. If your Codex version has hooks for
more events, write them by hand with the setup guide below.
Agents without hooks (Gemini, Codex, Qwen, OpenCode, Copilot, Kimi, Grok, Vibe) are also found from their terminal window’s title, with less detail. Once an agent has reported through a hook, the window title of that agent is no longer used. Turn this off in Settings → AI agents → Find by window title. This does not work on macOS.
Check the hooks
Section titled “Check the hooks”When an agent’s key does not change, run polyctl agents hooks check (PolyKybdHost 1.28.2). It
shows:
- where the hooks send their reports, and whether that host answers within 4 seconds;
- for each agent, whether its hooks are installed;
- the last three hook runs of each agent.
polyctl agents hooks check claude-code checks one agent. The command exits with code 1 when the
host does not answer or a hook file is broken.
Each hook run writes one line to agent_hooks.log in the PolyKybdHost config folder: the agent,
the event, the state, the start of the session id, where the report went and how it ended. The
log has no prompt text, title or file content. A report that does not finish in 4 seconds shows
as timeout in connect (the host cannot be reached, for example from a container) or
timeout in report (the host accepted the connection and did not answer). The log is part of
Collect logs… and polyctl logs bundle, and the log viewer shows it.
For other agents, or to write the hooks by hand, see the setup guide in the host repository:
docs/agent-keys-agent-setup.md.
You can give that file to the agent and ask it to set itself up.
When an agent leaves its key
Section titled “When an agent leaves its key”- An agent on this computer whose process ends is removed at once. An agent on another computer is not checked this way: if it ends without a session-end event, its key follows only the time rules below. A waiting or done key is never removed by time. Pressing a done key makes it idle.
- When you end a session (
/exit,/clear, logout), its key is freed. - When an editor or the Claude desktop app restarts the agent’s process, the key stays as idle until the agent reports again. If you press such a key and no window is found for it, the key is freed (PolyKybdHost 1.22.8 and later).
- An idle or stale agent that reports nothing for 4 hours is removed (Settings → AI agents → Remove idle agents after; 0 turns this off).
The keyboard clears all agent keys when the computer sleeps, and when the host sends nothing for 30 seconds, for example after the host app was closed. The host sends them again when it runs. From PolyKybdHost 1.22.8, the agents that reported through a hook stay across a restart of the app, with their key, state and title. An agent on this computer whose process ended meanwhile is not restored.
Remove an agent
Section titled “Remove an agent”A session that ends without telling the host (a closed terminal, a crashed agent, a cloud session you deleted) keeps its key. From PolyKybdHost 1.23.3:
- Tray menu: AI Agents → Remove Agent lists every agent. Click one to free its key.
- AI Agents → Remove Agent → Remove All Inactive removes every agent that is idle, done or stale. Agents that are working or waiting stay.
- Command line:
polyctl agents forget <agent> <session>for one agent,polyctl agents forget --inactivefor the inactive ones.
A removed agent comes back when its session reports again.
Settings
Section titled “Settings”All in Settings → AI agents:
| Dialog | Key | Default | What it changes |
|---|---|---|---|
| Show on the number row | agents_enabled |
off | The whole feature. Takes effect at the next keyboard connect. |
| Find by window title | agents_title_scan |
on | Finds agents in terminal windows that have no hook. Not on macOS. |
| Dictation shortcut | agents_dictation_shortcut |
empty | The shortcut - sends in AI mode, for example <cmd>+h or <ctrl>+<alt>+d. Empty: Win+H on Windows, nothing on macOS and Linux. |
| Agents from other computers | agents_remote_enabled |
off | Shows the agents of computers with a paired forwarder. |
| Raise agent windows on this computer | agents_raise_here |
off | On a forwarder’s computer: a key press on one of its agents also brings the agent’s window forward there. |
| Hide agent titles and folders | agents_anonymize |
off | On a forwarder’s computer: its agents send no title, folder or window title to the keyboard computer (1.28.30). See AI agents on another computer. |
| Stale after (minutes) | agents_stale_minutes |
30 | A working agent that reports nothing for this long shows as stale. 0: never. |
| Remove idle agents after (minutes) | agents_forget_minutes |
240 | An idle or stale agent that reports nothing for this long is removed. 0: never. |
From the command line
Section titled “From the command line”| Command | What it does |
|---|---|
polyctl agents list [--json] |
The agents the host knows, by page and key. |
polyctl agents label <agent> <session> <text> |
Set the text an agent’s card shows. |
polyctl agents forget <agent> <session> |
Remove an agent and free its key. |
polyctl agents forget --inactive |
Remove every idle, done or stale agent (1.23.3). |
polyctl agents cloud [connect|disconnect] |
Show, create or delete the cloud-session channel (1.23.3). |
polyctl agents cloud join-code |
Print the join code of this computer’s channel (1.28.2). |
polyctl agents cloud join [CODE] [--replace] |
Join the channel of another computer (1.28.2). |
polyctl agents cloud leave |
Remove the channel from this computer only (1.28.2). |
polyctl agents report <agent> <session> <state> |
Report a state by hand: working, waiting, done, idle, stale or ended. |
polyctl agents hooks install|uninstall <agent> |
Write or remove the hooks, as above. |
polyctl agents hooks check [agent] |
Check the hooks, the host they report to and the last hook runs (1.28.2). |
polyctl attention <row> <col> [--count N] [--period-ms MS] |
Run the ripple on any key, by its matrix position (firmware protocol 32). --cancel ends it. |
More AI agent pages
Section titled “More AI agent pages”- AI Agents in the Cloud and on Other Computers: cloud sessions and agents on another computer.