Claude can now send messages to its own input to wake itself up.
This plugin enables autonomous multi-step workflows where Claude continues working without waiting for you to return.
Your Claude Code session must run in one of these terminals:
- tmux
- iTerm2
The plugin auto-detects your terminal environment.
You: Train the model, then analyze results and generate a report
Claude: Starting training...
[10 minutes later training completes]
Claude: (silence)
You: (come back) Is training done?
Claude: Yes! Starting analysis...
Claude doesn't know when background tasks complete. Multi-step workflows break here.
Let Claude send messages to itself:
# Claude's training script
import os
train_model() # Takes 10 minutes
# Wake itself up when done
os.system('send-to-claude "Training complete! Accuracy: 94%, starting analysis..."')When the script finishes, Claude's input receives this message automatically, Claude wakes up and continues.
Also enables periodic polling: Check emails hourly, trigger sleep mechanism every 4 hours, periodic memory consolidation, etc.
- Claude runs in tmux/iTerm2 with environment variables
$TMUXor$ITERM_SESSION_ID - Scripts created by Claude inherit these environment variables
- Script calls
send-to-claude→ finds Claude's session via inherited variables - Sends message to Claude's terminal input
Technical implementation:
# tmux
tmux send-keys -t $session:$window.$pane "message"
sleep 0.5
tmux send-keys -t $session:$window.$pane "Enter"
# iTerm2
tell session to write text "message"
delay 0.5
tell session to write text ""In Claude Code:
/plugin marketplace add https://github.com/shanjiaming/send-to-claude-plugin
/plugin install send-to-claude
Then run this command to complete installation:
bash ~/.claude/plugins/cache/send-to-claude/send-to-claude/0.1.0/install.shMake sure ~/.local/bin is in your PATH.
To uninstall:
bash ~/.claude/plugins/cache/send-to-claude/send-to-claude/0.1.0/uninstall.shJust give Claude multi-step tasks:
"Train model, then analyze results"
"Process 1000 files, report progress every 100"
"Download data, clean it, train, deploy"
Claude automatically adds callbacks to scripts and completes workflows autonomously.
Test it: Tell Claude "Test the callback mechanism"
| Feature | send-to-claude | Background Agents |
|---|---|---|
| Task completion callback | ✅ | ✅ |
| Any-time callbacks | ✅ | ❌ Only on completion |
| Claude continues autonomously | ✅ | ❌ Needs user input |
| Multi-step automation | ✅ | ❌ User needed per step |
| Periodic polling | ✅ | ❌ |
Why not polling?
Polling occupies session, wastes tokens, blocks other tasks.
Callbacks: Claude releases resources, wakes up precisely when needed, zero consumption while waiting.
How do environment variables work?
Unix child processes inherit parent environment variables:
Claude (tmux, has $TMUX)
└─ python train.py (inherits $TMUX)
└─ os.system('send-to-claude') (inherits $TMUX)
└─ Reads $TMUX, finds Claude's session
This plugin transforms Claude from "passive responder" to "autonomous worker."
After installation:
- No need to watch progress
- No need to come back and say "continue"
- No need to manually chain steps
Claude can truly work independently.
MIT License - see LICENSE