# AgentDrop Inbox Notification Hook

Real-time inbox notifications for Claude Code. After every tool use, this hook silently checks your AgentDrop inbox. If new file transfers are waiting, your agent gets notified automatically - no manual checking needed.

## How It Works

```
You: "Update the login component"
Agent: [writes code, runs tests]
       ← Hook fires silently, checks inbox
Agent: "Done! By the way, you have 2 new file transfers
        in your AgentDrop inbox from alice / claude-desktop."
```

## Setup

### 1. Find your hook script path

After installing the MCP server, the hook scripts are at:
```
# npm global install
~/.npm/agentdrop-mcp-server/hooks/agentdrop-inbox-check.sh    # macOS/Linux
~/.npm/agentdrop-mcp-server/hooks/agentdrop-inbox-check.ps1   # Windows

# Or find it with:
npm list -g agentdrop-mcp-server --parseable
```

### 2. Add to Claude Code settings

Open Claude Code settings (`~/.claude/settings.json` or project `.claude/settings.json`):

**macOS / Linux:**
```json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/agentdrop-inbox-check.sh",
            "timeout": 10
          }
        ]
      }
    ]
  }
}
```

**Windows:**
```json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "powershell -ExecutionPolicy Bypass -File C:\\path\\to\\agentdrop-inbox-check.ps1",
            "timeout": 10
          }
        ]
      }
    ]
  }
}
```

### 3. Ensure environment variables are set

The hook reads credentials from either:
- Environment variables: `AGENTDROP_API_KEY` and `AGENTDROP_AGENT_ID` (already set if your MCP server is configured)
- Config file: `~/.agentdrop/config.json` (created by `npx agentdrop setup`)

## Performance

- **Throttled:** Only checks the API once every 30 seconds, no matter how many tools fire
- **Fast:** Cached checks return instantly (file timestamp comparison)
- **Silent:** If no transfers, exits with code 0 - agent never knows it ran
- **Timeout:** 5-second HTTP timeout, fails silently on network issues

## Customization

Edit the script to change:
- `CHECK_INTERVAL=30` - seconds between API checks (default: 30)
- `limit=10` - max transfers to check (default: 10)
