Remote command and control for Cursor AI agents.
I used Cursor to hack Cursor to be able to use Cursor agents from my phone. I did not write a single line of the code in this repository. Not one. Am I proud of the code? I don't know, I haven't even looked at it in detail. Does it work? Yes.
Opus 4.5, GPT 5.2, and Composer-1 were used exclusively. I didn't even do any reverse engineering myself. This was entirely done by Cursor in debug mode wth my direction. I had the best luck with reverse engineering using GPT 5.2. Opus 4.5 largely built the app.
Deadhand enables remote monitoring and control of Cursor AI agents from your phone or any device on your local network. It consists of:
- Daemon: A local server that aggregates data from multiple Cursor instances
- Extension: A Cursor extension that connects to the daemon
- Web UI: A mobile-friendly dashboard for viewing agent status and transcripts
- View all running Cursor instances from a single dashboard
- Monitor agent/session status in real-time
- Stream chat transcripts as they happen
- Secure LAN access with HTTPS and token authentication
- Send messages to existing composer sessions remotely
- Create new chat sessions with a specified mode (Agent, Ask, Plan, Debug)
- Select model when creating new chats (queries available models from Cursor)
- Start agents remotely by creating a new Agent-mode chat with a prompt
- HTTPS required for LAN access (self-signed certificate)
- Token authentication required for all requests
- Plain HTTP allowed only on localhost for development
- Node.js 18+
- pnpm 8+
# Clone the repo
git clone <repo-url> deadhand
cd deadhand
# Install dependencies
pnpm install
# Build all packages
pnpm build# Start in localhost-only mode (for development)
DEADHAND_LOCALHOST_ONLY=true pnpm --filter @deadhand/daemon start
# Start with LAN access (HTTPS, for mobile access)
pnpm --filter @deadhand/daemon startOn first run, the daemon will:
- Generate a self-signed TLS certificate
- Generate an access token
- Display the token and TLS fingerprint in the terminal
- Open the URL shown in the daemon output (e.g.,
https://localhost:31337) - If using HTTPS, accept the self-signed certificate warning
- Enter the access token from the daemon output
- Open Cursor
- Install the extension from
packages/extension(F5 to run in development) - The extension will auto-connect to the daemon
# Run all services in development mode
./scripts/dev.sh
# Or run individually:
# Terminal 1: Daemon
DEADHAND_LOCALHOST_ONLY=true pnpm --filter @deadhand/daemon dev
# Terminal 2: Web UI (with hot reload)
pnpm --filter @deadhand/web dev
# Terminal 3: Extension (press F5 in VS Code)Use the provided .vscode/launch.json:
- Run Daemon: Start the daemon with debugging
- Run Extension: Launch extension development host
- Extension + Daemon: Run both together
| Variable | Default | Description |
|---|---|---|
DEADHAND_PORT |
31337 |
Port for the daemon |
DEADHAND_DATA_DIR |
~/.deadhand |
Directory for config/certs |
DEADHAND_LOCALHOST_ONLY |
false |
Disable LAN access (HTTP only) |
| Setting | Default | Description |
|---|---|---|
deadhand.daemonPort |
31337 |
Daemon port |
deadhand.autoStartDaemon |
true |
Auto-start daemon if not running |
deadhand.enableLogsAdapter |
false |
Enable log file parsing (fallback adapter) |
deadhand.debugMode |
false |
Enable debug mode with verbose logging |
┌─────────────────┐ ┌─────────────────┐
│ Cursor IDE 1 │ │ Cursor IDE 2 │
│ ┌───────────┐ │ │ ┌───────────┐ │
│ │ Extension │──┼─────┼──│ Extension │ │
│ └───────────┘ │ │ └───────────┘ │
└─────────────────┘ └─────────────────┘
│ │
└───────────┬───────────┘
│ (WebSocket)
┌──────▼──────┐
│ Daemon │
│ (HTTPS/WSS) │
└──────┬──────┘
│
┌───────────┴───────────┐
│ │
┌──────▼──────┐ ┌──────▼──────┐
│ Web UI │ │ Mobile App │
│ (Browser) │ │ (Future) │
└─────────────┘ └─────────────┘
packages/
daemon/ # Local server (Node.js/Fastify)
extension/ # Cursor extension
web/ # React web UI
docs/
prd/ # Product requirements documents
scripts/
dev.sh # Development helper script
When accessing the web UI from your phone, you'll see a certificate warning because we use a self-signed certificate. To verify you're connecting to the right server:
- Check the TLS fingerprint shown in the daemon terminal
- Compare it with the fingerprint shown on the login page
- If they match, it's safe to proceed
- Ensure the daemon is running
- Check if the port matches (
deadhand.daemonPort) - Try running
Deadhand: Show Statusfrom the command palette
Agent data extraction from Cursor uses internal APIs:
- The official adapter monitors Cursor's composer commands and SQLite storage
- Enable
deadhand.enableLogsAdapterto try log file parsing as a fallback
These features use Cursor's internal commands (composer.createNew, composer.triggerCreateWorktreeButton) and reverse-engineered storage access that may break with Cursor updates. See docs/reverse-engineering/cursor-storage.md for technical details.
- v1.1: Remote send-message + start agent (complete)
- v1.2: Mode/model switching (complete via create_chat) + image upload (pending)
- v2: Optional tunnel mode for internet access
See docs/prd/deadhand-cursor-v1.md for the full product requirements.
Reverse-engineering notes live in docs/reverse-engineering/cursor-storage.md.
MIT
