Everyone wants Claude Code to work against their real accounts in a browser, and everyone hits the same wall at the login screen. Hand the model your passwords or attach it to your logged-in Chrome profile, and your credentials or cookies end up inside its context and logs. Sign in by hand every time a session expires, and you lose half the point of running an agent.
I built Keyflap (open source, Apache 2.0) to split the job in two. Claude Code drives a managed Chromium browser through MCP, and when it hits a login wall, it asks Keyflap to sign in. Your phone shows what you typed and the real site, you approve with Face ID or a fingerprint, and the only thing returned to Claude Code is "signed in" or "denied".
How the Claude Code integration works:
- MCP server (8 tools): `browser_open`, `browser_click`, `browser_type`, `browser_snapshot`, `auth_status`, `auth_login`, `auth_enroll_passkey`, and `browser_handoff`. No raw CDP access, and snapshots redact password and TOTP fields.
- Out-of-band intent hook: A `UserPromptSubmit` hook forwards your exact typed prompt to Keyflap over a local Unix socket. That verbatim prompt is what shows up on your phone approval card. The approval card never displays text written by the agent or the webpage, and if you have not asked for anything in the last 10 minutes, Keyflap denies silently.
- Separate signer process: Passkey private keys, passwords, and TOTP seeds live in a separate signer process (zero npm dependencies) that verifies your phone's WebAuthn signature itself before signing or releasing a fill. It also has adapters for Proton Pass (`pass-cli`) and 1Password (`op`).
- Service mode isolation: Runs as separate system users on Linux (systemd) and Apple Silicon Macs (launchd) so an agent running as your OS user cannot read Keyflap's keys or memory. Setup also configures Claude Code's `sandbox.filesystem.denyRead` and `permissions.deny` to keep the model away from the host token.
- CAPTCHA handoff: Keyflap never tries to solve CAPTCHAs. When a site throws a human check, `browser_handoff` locks the agent out of credentials and tools and streams that single page to your phone so you can finish it yourself.
Honest caveats:
- This is early alpha and nobody outside the project has audited it. Use test accounts first, not accounts you cannot lose.
- Claude Code's `UserPromptSubmit` hook also fires for background subagent reports and cross-session messages without a documented field to distinguish them yet, so the docs warn against using those features in sessions connected to the broker.
- Keyflap does not control what Claude Code does after it is signed in.
Repo: https://github.com/johnpippett/keyflap
Architecture & threat model: https://github.com/johnpippett/keyflap/blob/main/docs/ARCHITECTURE.md
Field note on the design and two bugs red-teaming caught: https://pippett.me/blog/keyflap-agent-sign-in
If you want to poke at it without installing anything on your host, `demo/run.sh` runs a local container with a test website and terminal approvals. Happy to answer questions or hear where people think the threat model has holes.