mvanhorn/agentcookie
Your agent runs on a Mac that isn't your daily driver. agentcookie keeps its sessions in sync with the Mac you actually browse on, continuously, encrypted over Tailscale, so OpenClaw, Hermes, or any other agent runtime wakes up authenticated. macOS, peer-to-peer, no cloud middleman.
agentcookie — What it does and why you'd want it
agentcookie is a tool that keeps the login sessions (cookies) from your Mac's Chrome browser continuously synced to a Linux machine where you run automated agents (like browser automation scripts). The result: those agents can act as you on websites you're already logged into, without needing to log in again or paste cookies manually.
The problem it solves
If you use a Mac for daily browsing and a Linux server (e.g., a cloud VM) for running agents, you'd normally have to log in to every website twice — once on each machine. Tools that copy cookies between machines usually require a human to confirm or manually unlock a vault. agentcookie is built for unattended, one-way, continuous replication from your Mac to the Linux box, so an agent can use your session within seconds, even when nobody is around.
How it works
- On your Mac (source): agentcookie watches Chrome's cookie database. When cookies change (you log in, a session refreshes), it reads the new cookies, decrypts them (using macOS Keychain), filters them according to a policy, encrypts them, and sends them over your Tailscale network (a private, encrypted mesh VPN) to the Linux machine.
- On Linux (sink): agentcookie receives the encrypted payload, decrypts it, applies its own filter, and injects the cookies directly into Chrome's memory via the Chrome DevTools Protocol (CDP) — no need to touch Chrome's on-disk database. The injection happens on every sync and whenever a new browser tab is opened, so any agent that launches a fresh browser context immediately has your sessions.
All communication is encrypted with AES-256-GCM over the Tailscale WireGuard tunnel, and each peer uses a unique key derived during pairing.
Installation and setup (summary)
- Prerequisites: Tailscale running on both machines, Chrome installed on both, and on Linux Chrome must be started with
--remote-debugging-port=9223(or another port you configure). - Download: Get the appropriate binary from the GitHub Releases page, verify the checksum, and install it.
- Mac source: Run
agentcookie wizard install --as source --peer <linux-hostname>— it prints a pairing code and URL. - Linux sink: The README recommends not using the wizard on Linux (it omits the policy file). Instead, manually create
~/.config/agentcookie/sink.yamlandblocklist.yaml(see below), then runagentcookie pair --as sink ...with the code from the Mac. - Start the sink: Run
agentcookie sink(optionally as a systemd service).
Cookie policy (important)
- Linux default: If no
blocklist.yamlexists or thepolicy:field is missing, the sink accepts no cookies — security by default. - Trusted single-operator box: To sync all cookies, create a
blocklist.yamlwithpolicy: blocklistand an emptydomains: []list. - Allowlist mode: For less-trusted sinks, you can specify only certain domains (e.g.,
github.com,%.openai.com).
Additional features
- Firefox-family browsers (Zen, Firefox, LibreWolf, Floorp): agentcookie can read cookies from these browsers on macOS and Linux, without needing Keychain access (they store cookies unencrypted).
- Linux CDP source: If the authenticated browser already runs on Linux, agentcookie can read cookies directly via CDP instead of touching the SQLite database.
- macOS sink: You can also set up a second Mac as a sink; the wizard works there.
- Teammates: You can let other agents (e.g., your own Tincan agents) pull cookies from your laptop, with per-agent approval and no inbound listener needed.
- Multiple sinks: One source can push to several Linux machines, each with its own key.
- Profile management: Tools like
profile-syncandprofile-keepalivehelp manage multiple Chrome profiles (e.g., for different Claude accounts).
Verification
Use agentcookie doctor and agentcookie status --json on both machines. On Linux, look for live_cdp: endpoint reachable and a line like live_cdp: injected N cookies into M context(s) — that confirms success.
All information above is taken directly from the project's README. No features or details have been added beyond what is documented there.
Related
- Project
- Project
- Project
- Project
- Project