wingmirror Download
Docs Claude Code

Docs · Agents

Connecting Claude Code

Press Connect in the setup window, or choose Connect Claude Code… in the menu and confirm. The menu line then reads "Claude Code: Connected". A new session appears on the panel with its first status line.

Sessions in the Claude desktop app. A Claude Code session run on this Mac from the Claude desktop app's Code tab uses the same settings file, so its hooks reach the panel: its card appears with its first prompt, and its requests show on it. Such a session sends no status line, so its card has no context figure, cost or lines changed, and the desktop app stops the session's program a couple of minutes after each turn and starts it again for the next. Its card stays through that, at rest, until the next turn. It goes when you archive or delete the session in the desktop app (within half a minute), or after six hours with nothing heard from it, and comes back with its next prompt. Wingmirror knows which sessions these are by reading the desktop app's own records of them in ~/Library/Application Support/Claude/claude-code-sessions/: which session, and whether it is archived, and nothing else. A session that runs in the cloud, or in the desktop app's sandbox, cannot appear at all: its hooks never run on this Mac. End session does nothing to one of these; end or archive it in the desktop app.

What is added to ~/.claude/settings.json

The status line. statusLine is pointed at ~/Library/Application Support/Wingmirror/hooks/claude-statusline.sh. The script forwards each status update to the app, along with which terminal the session is in, and then runs the status line command you had, so what you see in the terminal is unchanged. Its refresh interval is set to 10 seconds, or left alone if yours is shorter; that is how the app knows a session is still there.

The hooks. One HTTP hook is added for each of ten events, each posting to http://127.0.0.1:7317/hooks/claude/…. Your own hooks are left where they are.

EventPosts toTimeoutWhat it is for
PermissionRequestpermission600 sThe request is held until you tap Approve or Deny, and the answer goes back to Claude Code. The app lets go after 590 seconds, so it always ends first.
PreToolUsetool-start1 sWhat the session is doing as it does it: the line on a working card. The reply is always empty, so it never decides anything about the tool. Claude Code waits for this hook before every tool, so it is given one second and no more.
PostToolUse, PostToolUseFailuretool-done5 sA tool has finished: the recent tools on the card, and a request answered at the keyboard is cleared.
PostToolBatchbatch-done5 sEvery tool called together has been dealt with, refused ones included. This is how the panel learns that a prompt was refused at the keyboard, which sends nothing else.
SubagentStophelper-done5 sA helper has finished, so nothing of its is waiting any longer.
Stop, UserPromptSubmitturn5 sA turn has ended or begun: idle or working.
Notificationnotification5 sThe session is waiting for a prompt, needs input, or has finished.
SessionEndsession-endClaude Code's ownThe session is taken off the panel about twenty seconds later, unless it is heard from again in that time. A helper's end is not the session's.

The allow-list. If you have an allowedHttpHookUrls list, http://127.0.0.1:7317/* is added to it. If you have none, none is made.

The backup. The file is copied to settings.json.wingmirror-backup-<date>-<time> beside it before every change, and the "Done" message gives the copy's path.

Updating the Claude Code connection

A newer version may listen for an event that the connection on your Mac does not send yet. The menu then says "Claude Code: Partly Connected", and when the app opens it asks "Update the Claude Code connection?" with Update and Later. Update adds the missing hooks, backing the file up first. Repair Claude Code Connection in the menu does the same at any time. The status line script is brought up to date by itself when the app opens, without touching settings.json.

Sessions that were already open pick the new hooks up when they are restarted. Until then such a session shows on the panel without whatever the new hook brings, for instance the line saying what it is doing.

Disconnecting Claude Code

Choose Disconnect Claude Code in the menu. The status line you had is restored (or removed, if you had none), Wingmirror's hooks are taken out of every event, and the allow-list entry it added is removed. The file is backed up first here too. From a terminal:

/Applications/Wingmirror.app/Contents/MacOS/Wingmirror hooks status
/Applications/Wingmirror.app/Contents/MacOS/Wingmirror hooks install
/Applications/Wingmirror.app/Contents/MacOS/Wingmirror hooks uninstall

A build made with tools/make-app.sh is in ~/Applications, not /Applications.

With the app not running, Claude Code behaves as if nothing were installed: the forward fails quietly and nothing waits on it.

Edit source on GitHub README.md#connecting-claude-code