Clyde Code
A drop-in long-running agent harness for Claude Code. Install it once and your Claude Code session gets:
- Battle-tested quality-loop primitives (progress file, fresh-context evaluator, verify gate, kill switch, auto-commit)
- Text-your-agent front door — send a Telegram message, Claude Code runs headless, replies to your phone
- Unattended scheduling — fire runs on a cadence without keeping a session open
The loop/goal half is lifted from Anthropic's cwc-long-running-agents primitives (Apache-2.0; see NOTICE). The scheduling + messaging half is the net-new contribution.
Quick start: text your Claude Code from your phone
What you need: Claude Code installed, a Mac (for launchd auto-start), Python 3, curl.
1. Create a Telegram bot (2 min)
- Open Telegram → search
@BotFather → /newbot
- Follow the prompts, copy the token it gives you (looks like
123456:ABC-DEF...)
2. Install Clyde Code
/plugin marketplace add bweinfeld5/clyde-code
/plugin install clyde-code
Or clone and copy manually:
git clone https://github.com/bweinfeld5/clyde-code ~/clyde-code
3. Set up secrets
cp ~/clyde-code/secrets.env.template ~/clyde-code/secrets.env
# edit secrets.env — fill in TELEGRAM_BOT_TOKEN and PROJECT_DIR at minimum
Find your Telegram chat ID (do this after texting the bot once):
TELEGRAM_BOT_TOKEN=<your-token> ~/clyde-code/scripts/get-telegram-chat-id.sh
Fill TELEGRAM_ALLOWED_CHAT_ID with the number it prints.
4. Initialize the harness in your project
Open Claude Code in your project and run:
/harness-init
This creates PROGRESS.md, a results file, and a git baseline so headless runs have a known-good starting point.
5. Start the bridge
One-time / manual:
source ~/clyde-code/secrets.env
~/clyde-code/scripts/telegram-bridge.sh
Always-on (auto-starts on login):
cp ~/clyde-code/launchd/com.hermespack.telegram-bridge.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.hermespack.telegram-bridge.plist
Logs: /tmp/hermespack-telegram.out.log and err.log
6. Text it
Send any message to your bot. Claude Code runs headless against your project and replies. Text STOP to halt, GO to resume.
What's inside
| Component | Does |
|---|
scripts/telegram-bridge.sh | Long-polls Telegram, allowlist-checks sender, runs claude -p, texts reply back. No tunnel needed — polling is outbound. |
scripts/agent-relay.py | Streams the headless run to Telegram: working indicator → live tool updates → final answer. |
scripts/get-telegram-chat-id.sh | Prints your chat ID after you've texted the bot once. |
scripts/sms-bridge.sh | Alternative: Twilio SMS → claude -p → SMS reply (needs a public tunnel). |
launchd/com.hermespack.telegram-bridge.plist | Mac launchd plist to keep the bridge alive across reboots. |
skills/harness-init | Scaffolds PROGRESS.md, results file, evidence dir, git baseline — run this first. |
skills/messaging-bridge | Claude skill: explains the bridge architecture and setup options. |
skills/pursue-goal | Run-until-done with evaluator gate — don't stop until a fresh reviewer says PASS. |
skills/run-loop | Open-ended tending with one-item-per-iteration discipline. |
skills/schedule-routine | Picks Cloud Routine / Desktop task / GitHub Actions and wraps it safely. |
agents/evaluator.md | Skeptical fresh-context reviewer; returns PASS / NEEDS_WORK. |
hooks/kill-switch.sh | Blocks every tool call while AGENT_STOP exists. |
hooks/steer.sh | Surfaces STEER.md to the agent once as OPERATOR STEERING:. |
hooks/track-read.sh + verify-gate.sh | Deny marking a test passing until evidence has been Read. |
hooks/commit-on-stop.sh | Commits tracked changes at session end. |
commands/overnight.md | /overnight — arms the full harness and prints the control surface. |
Control surface
Once the bridge is running, you steer without touching the session:
- Halt: text
STOP (or touch AGENT_STOP locally)
- Resume: text
GO (or rm AGENT_STOP)
- Redirect mid-run: write guidance into
STEER.md — surfaced once as higher-priority OPERATOR STEERING:
- Watch:
git log --oneline + PROGRESS.md
secrets.env knobs
PROJECT_DIR="$HOME/your-project" # required: repo with harness-init run
TELEGRAM_BOT_TOKEN="" # from @BotFather
TELEGRAM_ALLOWED_CHAT_ID="" # your numeric id — allowlist is mandatory