A context-aware notification plugin for Claude Code that sends messages via Telegram Bot API. Perfect for monitoring Claude Code task status when working remotely or away from your computer.
- Remote Monitoring - Push notifications to your phone when tasks complete or need confirmation
- Zero Dependencies - Uses only Node.js built-in modules
- Secure Configuration - Supports environment variables for Token configuration
- Context Aware - Automatically extracts project name and task status
- Create a local marketplace directory structure:
# Create marketplace anywhere
mkdir -p ~/claude-marketplace/.claude-plugin
# Create marketplace manifest
cat > ~/claude-marketplace/.claude-plugin/marketplace.json << 'EOF'
{
"name": "local-marketplace",
"owner": { "name": "local" },
"plugins": [
{
"name": "notify-tg",
"source": "./notify-tg",
"description": "Telegram notification plugin"
}
]
}
EOF- Copy notify-tg directory to the marketplace:
cp -r /path/to/notify-tg ~/claude-marketplace/- Add marketplace and install in Claude Code:
# Launch Claude Code
claude
# Add local marketplace
/plugin marketplace add ~/claude-marketplace
# Install plugin
/plugin install notify-tg@local-marketplace- Restart Claude Code for the plugin to take effect.
Merge hooks configuration into ~/.claude/settings.json:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "node /path/to/notify-tg/scripts/notify-hook.js",
"timeout": 20
}
]
}
],
"Notification": [
{
"hooks": [
{
"type": "command",
"command": "node /path/to/notify-tg/scripts/notify-hook.js",
"timeout": 20
}
]
}
]
}
}Note: Replace
/path/to/notify-tgwith the actual path.
You need to provide a Telegram Bot Token and Chat ID.
Add to your shell configuration file (.bashrc, .zshrc):
export TELEGRAM_TOKEN="123456789:ABCdefGHIjklMNOpqrsTUVwxyz"
export TELEGRAM_CHAT_ID="987654321"Edit config/notify-config.json:
{
"telegram": {
"token": "YOUR_BOT_TOKEN_HERE",
"chatId": "YOUR_CHAT_ID_HERE"
}
}The plugin automatically listens for the following events:
| Event | Trigger | Notification Example |
|---|---|---|
| Stop | Claude completes a task | ✅ Claude Response Complete - [Project] |
| Notification | Authorization or confirmation needed |
Manually run the script to test your configuration:
# Test Stop event
echo '{"hook_event_name":"Stop","cwd":"/path/to/project"}' | node scripts/notify-hook.js
# Test Notification event
echo '{"hook_event_name":"Notification","cwd":"/path/to/project","notification_type":"PermissionRequest","message":"Permission required"}' | node scripts/notify-hook.jsnotify-tg/
├── .claude-plugin/
│ └── plugin.json # Plugin metadata
├── hooks/
│ └── hooks.json # Hook configuration
├── scripts/
│ └── notify-hook.js # Core script
├── config/
│ └── notify-config.json # Configuration file
├── README.md # English documentation
└── README_CN.md # Chinese documentation
Apache License 2.0