Skip to content

Commit 1ef544a

Browse files
zachlloydwarp-agent
andcommitted
Initial commit: Warp plugin for Claude Code notifications
Adds native Warp terminal notifications when Claude Code completes tasks or needs user input. Notifications include the original prompt and Claude's response for quick context. Co-Authored-By: Warp <agent@warp.dev>
0 parents  commit 1ef544a

8 files changed

Lines changed: 221 additions & 0 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "claude-code-warp",
3+
"description": "Official Warp terminal integrations for Claude Code",
4+
"owner": {
5+
"name": "Warp",
6+
"url": "https://warp.dev"
7+
},
8+
"plugins": [
9+
{
10+
"name": "warp",
11+
"description": "Native Warp notifications when Claude completes tasks or needs input",
12+
"source": "./plugins/warp",
13+
"version": "1.0.0",
14+
"category": "productivity",
15+
"tags": ["notifications", "terminal", "warp"]
16+
}
17+
]
18+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Warp
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Claude Code + Warp
2+
3+
Official [Warp](https://warp.dev) terminal integration for [Claude Code](https://docs.anthropic.com/en/docs/claude-code).
4+
5+
## Features
6+
7+
### 🔔 Native Notifications
8+
9+
Get native Warp notifications when Claude Code:
10+
- **Completes a task** — with a summary showing your prompt and Claude's response
11+
- **Needs your input** — when Claude requires approval or has a question
12+
13+
Notifications appear in Warp's notification center and as system notifications, so you can context-switch while Claude works and get alerted when attention is needed.
14+
15+
**Example notification:**
16+
```
17+
"what's 1+1" → 2
18+
```
19+
20+
## Installation
21+
22+
```bash
23+
# In Claude Code, add the marketplace
24+
/plugin marketplace add warpdotdev/claude-code-warp
25+
26+
# Install the Warp plugin
27+
/plugin install warp@claude-code-warp
28+
```
29+
30+
That's it! Notifications will appear automatically when Claude completes tasks.
31+
32+
## Requirements
33+
34+
- [Warp terminal](https://warp.dev) (macOS, Linux, or Windows)
35+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI
36+
- `jq` for JSON parsing (install via `brew install jq` or your package manager)
37+
38+
## How It Works
39+
40+
This plugin uses Warp's [pluggable notifications](https://docs.warp.dev/features/notifications) feature via OSC escape sequences. When Claude Code triggers a hook event, the plugin:
41+
42+
1. Reads the session transcript to extract your original prompt and Claude's response
43+
2. Formats a concise notification message
44+
3. Sends an OSC 777 escape sequence to Warp, which displays a native notification
45+
46+
The plugin registers two hooks:
47+
- **Stop** — fires when Claude finishes responding
48+
- **Notification** — fires when Claude needs user input
49+
50+
## Configuration
51+
52+
Notifications work out of the box. To customize Warp's notification behavior (sounds, system notifications, etc.), see [Warp's notification settings](https://docs.warp.dev/features/notifications).
53+
54+
## Roadmap
55+
56+
Future Warp integrations planned:
57+
- Warp AI context sharing
58+
- Warp Drive integration for sharing Claude Code configurations
59+
- Custom slash commands
60+
61+
## Uninstall
62+
63+
```bash
64+
/plugin uninstall warp@claude-code-warp
65+
/plugin marketplace remove claude-code-warp
66+
```
67+
68+
## Contributing
69+
70+
Contributions welcome! Please open an issue or PR on [GitHub](https://github.com/warpdotdev/claude-code-warp).
71+
72+
## License
73+
74+
MIT License — see [LICENSE](LICENSE) for details.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "warp",
3+
"description": "Warp terminal integration for Claude Code - native notifications, and more to come",
4+
"version": "1.0.1",
5+
"author": {
6+
"name": "Warp",
7+
"url": "https://warp.dev"
8+
},
9+
"homepage": "https://github.com/warpdotdev/claude-code-warp"
10+
}

plugins/warp/hooks/hooks.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"description": "Warp terminal notifications",
3+
"hooks": {
4+
"Stop": [
5+
{
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/on-stop.sh"
10+
}
11+
]
12+
}
13+
],
14+
"Notification": [
15+
{
16+
"matcher": "*",
17+
"hooks": [
18+
{
19+
"type": "command",
20+
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/on-notification.sh"
21+
}
22+
]
23+
}
24+
]
25+
}
26+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# Hook script for Claude Code Notification event
3+
# Sends a Warp notification when Claude needs user input
4+
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
7+
# Read hook input from stdin
8+
INPUT=$(cat)
9+
10+
# Extract the notification message
11+
MSG=$(echo "$INPUT" | jq -r '.message // "Input needed"' 2>/dev/null)
12+
[ -z "$MSG" ] && MSG="Input needed"
13+
14+
"$SCRIPT_DIR/warp-notify.sh" "Claude Code" "$MSG"

plugins/warp/scripts/on-stop.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
# Hook script for Claude Code Stop event
3+
# Sends a Warp notification when Claude completes a task
4+
5+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
7+
# Read hook input from stdin
8+
INPUT=$(cat)
9+
10+
# Extract transcript path from the hook input
11+
TRANSCRIPT_PATH=$(echo "$INPUT" | jq -r '.transcript_path // empty' 2>/dev/null)
12+
13+
# Default message
14+
MSG="Task completed"
15+
16+
# Try to extract prompt and response from the transcript (JSONL format)
17+
if [ -n "$TRANSCRIPT_PATH" ] && [ -f "$TRANSCRIPT_PATH" ]; then
18+
# Get the first user prompt
19+
PROMPT=$(jq -rs '
20+
[.[] | select(.type == "user")] | first | .message.content // empty
21+
' "$TRANSCRIPT_PATH" 2>/dev/null)
22+
23+
# Get the last assistant response
24+
RESPONSE=$(jq -rs '
25+
[.[] | select(.type == "assistant" and .message.content)] | last |
26+
[.message.content[] | select(.type == "text") | .text] | join(" ")
27+
' "$TRANSCRIPT_PATH" 2>/dev/null)
28+
29+
if [ -n "$PROMPT" ] && [ -n "$RESPONSE" ]; then
30+
# Truncate prompt to 50 chars
31+
if [ ${#PROMPT} -gt 50 ]; then
32+
PROMPT="${PROMPT:0:47}..."
33+
fi
34+
# Truncate response to 120 chars
35+
if [ ${#RESPONSE} -gt 120 ]; then
36+
RESPONSE="${RESPONSE:0:117}..."
37+
fi
38+
MSG="\"${PROMPT}\"${RESPONSE}"
39+
elif [ -n "$RESPONSE" ]; then
40+
# Fallback to just response if no prompt found
41+
if [ ${#RESPONSE} -gt 175 ]; then
42+
RESPONSE="${RESPONSE:0:172}..."
43+
fi
44+
MSG="$RESPONSE"
45+
fi
46+
fi
47+
48+
"$SCRIPT_DIR/warp-notify.sh" "Claude Code" "$MSG"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# Warp notification utility using OSC escape sequences
3+
# Usage: warp-notify.sh <title> <body>
4+
5+
TITLE="${1:-Notification}"
6+
BODY="${2:-}"
7+
8+
# OSC 777 format: \033]777;notify;<title>;<body>\007
9+
# Write directly to /dev/tty to ensure it reaches the terminal
10+
printf '\033]777;notify;%s;%s\007' "$TITLE" "$BODY" > /dev/tty 2>/dev/null || true

0 commit comments

Comments
 (0)