The bridge
Claude Code setup
Pagr drives the ordinary claude binary you already have, signed in with your own account. There is no plugin to install and no configuration to write.
Prerequisites#
npm i -g @anthropic-ai/claude-codeclaude # sign in once, with your own accountclaude --versionclaude must be on the PATH the launch agent captured. If you installed it after pairing, re-run pagr daemon install from a shell where which claude works.
pagr statusAgents claude ✓ 2.1.220 (cli-hooks, auth unknown)cli-hooks is the default and only production mode. The alternative, approved-channel, is a flagged research preview — see Claude Channels.
How Pagr runs Claude Code#
Each session is one long-lived claude child process, driven over stdin and stdout in streaming JSON:
claude -p \ --input-format stream-json \ --output-format stream-json \ --verbose \ --permission-mode default \ --permission-prompt-tool stdio \ --session-id <uuid>- A new session gets
--session-id; resuming an existing one uses--resume. - The process stays alive after each result until stdin closes, so follow-up messages reuse the same process rather than starting a new one.
- Child processes are spawned with argument arrays, never through a shell.
--permission-mode defaultmeans Claude Code's own permission model is fully in force. Pagr never widens it.
Approvals#
Because the session is started with --permission-prompt-tool stdio, permission requests come straight back to the bridge over the same pipe. The bridge turns each one into an approval.requested event with a short preview and a hash, and you answer it by text.
A decision must echo the approval id, the session id, Claude's own request id and the preview hash, or the bridge rejects it. If nobody answers before the timeout — 600 seconds by default — the provider is told deny. The classification rules are in approvals.
Follow-ups are queued#
If you need the message to land inside the turn that is already running, the only path today is the flagged Channels preview. Codex, which Pagr drives over its local app-server, does not have this limitation — see Codex setup.
Read-only sessions#
Review sessions — the reviewer half of a review workflow, or anything started with the read-only flag — add:
--disallowedTools Edit,Write,MultiEdit,NotebookEditThe session can read, search and run its usual analysis, but the editing tools are simply not available to it.
Sessions you started yourself#
A plain claude you ran in a terminal is not a Pagr session. Pagr did not spawn it, does not track it, and cannot steer or stop it — pagr sessions lists only sessions the daemon started or resumed.
Claude Code does support a PermissionRequest hook, and the bridge ships one that talks to the local daemon socket so prompts from your own interactive sessions could reach your phone. It is not installed for you, and there is no pagr command that installs it today, so treat this as unavailable rather than as a setup step you have missed. The hook is written to fail open: on any timeout or socket error it prints nothing, which means “no decision” and leaves Claude Code's native prompt in control. It never auto-allows.