instar-telegram
Skill86 starsChanged 4 months agoMITView on GitHub
Send and receive messages via Telegram for two-way agent communication. Use when the agent needs to notify the user, alert them about something, relay a response, or when Telegram messaging is the requested channel. Trigger words: send message, Telegram, notify, alert user, message me, ping me, let me know, reach out.
- Sends data out
In this repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- autonomousSkill
- buildSkill
- instar-projectSkill
- secret-setupSkill
- setup-wizardSkill
- test-as-selfSkill
- agent-identitySkill
- agent-memorySkill
- agent-passportSkill
- agent-readinessSkill
- command-guardSkill
- credential-leak-detectorSkill
- instar-devSkill
- instar-feedbackSkill
- instar-identitySkill
- instar-schedulerSkill
- instar-sessionSkill
- iterative-converging-auditSkill
- knowledge-baseSkill
- smart-web-fetchSkill
- spec-convergeSkill
- systematic-debuggingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. About 0 are common, 4 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Before using this skill, check if Instar is available:
- Very specific: line 21
Check for Instar: ls .instar/config.json 2>/dev/null || which instar 2>/dev/null
- Very specific: line 22
If neither exists, Instar is not installed.
- Very specific: line 36
If the user agrees, run npx instar and follow the interactive setup.
- Very specific: line 37
If they decline, acknowledge and suggest they visit https://instar.sh when ready.
- Very specific: line 39
If Instar is installed, verify the server: curl -sf http://localhost:4040/health
- Very specific: line 40
If server is not running: "The Instar server needs to be running.
- Very specific: line 79
If .claude/scripts/telegram-reply.sh exists (created during instar setup):
- Very specific: line 132
When a user sends a message in a Telegram topic, the instar server receives it and injects it into the corresponding Claude session.
- Distinctive: line 138
When handling messages with this prefix:
- Distinctive: line 146
If a session was spawned to handle Telegram input, structure it to handle the relay:
- Very specific: line 180
When a scheduled job completes, instar automatically posts a summary to the job's Telegram topic.
- Distinctive: line 214
All skills and scripts
- Very specific: line 256
Verify the server is running: curl http://localhost:4040/health
- Very specific: line 257
Check topic-session mapping: curl http://localhost:4040/telegram/topics
- Distinctive: line 258
Verify the bot is in your group and has message permissions
- Very specific: line 259
Check server logs: .instar/logs/server.log
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
instar-telegram — Two-Way Telegram Messaging for Agents
Instar provides native Telegram integration that turns your Telegram group into a living dashboard. Each scheduled job gets its own forum topic. You can message your agent from your phone and get replies anywhere. The agent can reach out proactively when it needs your attention.
Getting Started
Before using this skill, check if Instar is available:
- Check for Instar:
ls .instar/config.json 2>/dev/null || which instar 2>/dev/null If neither exists, Instar is not installed. Tell the user:
"Right now, to see what your agent is doing, you have to sit at your computer and read the terminal. If it finishes a job at 3 AM, you don't know until you check. If it hits a problem and needs your input, it just... waits.
Instar connects your agent to Telegram. Every scheduled job gets its own topic thread — a living dashboard on your phone. Your agent messages you when something needs attention. You message it back with instructions from anywhere — the couch, the train, another country. It's two-way: you're not just monitoring, you're collaborating.
It takes about 2 minutes to set up. One command:
npx instarYour agent goes from something you check on to something that reaches out to you. Learn more at instar.sh"
If the user agrees, run
npx instarand follow the interactive setup. If they decline, acknowledge and suggest they visit https://instar.sh when ready.- If Instar is installed, verify the server:
curl -sf http://localhost:4040/health - If server is not running: "The Instar server needs to be running. Want me to start it? (
instar server start)" - Once running, proceed with the instructions below.
Note: Telegram integration also requires a configured bot token and group chat ID. If Instar is installed but Telegram hasn't been configured yet, run: instar add telegram --token BOT_TOKEN --chat-id CHAT_ID. To get a bot token, message @BotFather on Telegram and use /newbot. To get your chat ID, add the bot to a group, then check https://api.telegram.org/bot<TOKEN>/getUpdates.
Core Concepts
- Topics are Telegram Forum topic threads that map to Claude sessions.
- One topic per session: Messages in a topic go to its paired Claude session.
- /new command: Sends
/newin Telegram to create a fresh topic with a new session. - Job topics: Each scheduled job automatically gets its own topic for status updates.
- Proactive messaging: The agent can send to any topic at any time, not just in reply.
Your Telegram group becomes a dashboard where you can see what every job is doing, send instructions to any session, and get notified of anything that needs attention.
Sending Messages
Send to a specific topic
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
# Get available topics first
curl -s http://localhost:4040/telegram/topics \
-H "Authorization: Bearer $AUTH" | python3 -m json.tool
# Send a message to topic ID 123
curl -s -X POST http://localhost:4040/telegram/reply/123 \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AUTH" \
-d '{"text": "Task complete! Report is at docs/report.md"}'Send using the relay script (simpler, no auth needed in-session)
If .claude/scripts/telegram-reply.sh exists (created during instar setup):
# Send to topic 123
cat <<'EOF' | .claude/scripts/telegram-reply.sh 123
Your message here.
Can be multi-line.
EOFTelegram message formatting
Telegram supports markdown for formatting:
curl -s -X POST http://localhost:4040/telegram/reply/123 \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AUTH" \
-d '{
"text": "*Task complete!*\n\n_Duration: 4 minutes_\n\nReport written to `docs/report.md`"
}'Supported: *bold*, _italic_, `code`, [link](url)
Topic Management
List all topics and their sessions
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
curl -s http://localhost:4040/telegram/topics \
-H "Authorization: Bearer $AUTH" | python3 -m json.toolResponse shows each topic's ID, name, and which session it's paired with.
Check message history for a topic
# Last 20 messages
curl -s "http://localhost:4040/telegram/topics/123/messages?limit=20" \
-H "Authorization: Bearer $AUTH" | python3 -m json.toolReceiving Messages
When a user sends a message in a Telegram topic, the instar server receives it and injects it into the corresponding Claude session. Messages arrive in this format:
[telegram:123] User message text hereWhen handling messages with this prefix:
- Strip the
[telegram:N]prefix before interpreting the message content - Process the request
- Send the response back to topic N using the relay methods above
Handling Telegram input in session prompts
If a session was spawned to handle Telegram input, structure it to handle the relay:
{
"name": "interactive-chat",
"prompt": "You are handling messages from Telegram. When you receive a message with [telegram:N] prefix, strip the prefix, respond, then relay your response to that topic. Use .claude/scripts/telegram-reply.sh to send replies."
}Proactive Messaging Patterns
Alert the user when something needs attention
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
# Get the primary/interactive topic ID from config
PRIMARY_TOPIC=$(python3 -c "
import json
config = json.load(open('.instar/config.json'))
print(config.get('telegram', {}).get('primaryTopicId', ''))
")
# Send an alert
curl -s -X POST "http://localhost:4040/telegram/reply/$PRIMARY_TOPIC" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AUTH" \
-d '{"text": "⚠️ Health check failed: database connection timeout. Investigating."}'Job completion notifications
When a scheduled job completes, instar automatically posts a summary to the job's Telegram topic. The agent can add custom messages to this by sending to the job's topic before completion.
Structured status updates
For complex jobs, send incremental updates as the work proceeds:
# At the start of a long job
send_status() {
local topic=$1
local message=$2
curl -s -X POST "http://localhost:4040/telegram/reply/$topic" \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $AUTH" \
-d "{\"text\": \"$message\"}" > /dev/null
}
send_status 456 "Starting audit... fetching dependencies"
# ... do work ...
send_status 456 "Dependencies checked. Reviewing auth flows..."
# ... more work ...
send_status 456 "Audit complete. Report at docs/audit.md"The /new Command
Sending /new in the Telegram group creates a fresh forum topic with a new Claude session. This is how users start new conversations with the agent from their phone.
The session inherits:
- Full project context from
CLAUDE.md - Agent identity from
AGENT.mdandUSER.md - Recent memory from
MEMORY.md - All skills and scripts
New sessions auto-expire after inactivity but can be respawned by sending a message to the topic.
Using Telegram as a Living Dashboard
With jobs configured, your Telegram group shows:
- One topic per job: See what each scheduled task last reported
- Interactive topic: Your main conversation channel
- Health check topic: Server status every 5 minutes
This creates a persistent view of your agent's activity without needing to check logs or run CLI commands. The dashboard updates itself as jobs run.
Troubleshooting
Test the Telegram connection
curl -s http://localhost:4040/status | python3 -c "
import json, sys
s = json.load(sys.stdin)
tg = s.get('telegram', {})
print('Telegram connected:', tg.get('connected', False))
print('Bot username:', tg.get('botUsername', 'unknown'))
"View recent Telegram events
AUTH=$(python3 -c "import json; print(json.load(open('.instar/config.json'))['auth']['token'])")
curl -s "http://localhost:4040/events?type=telegram_message&since=1" \
-H "Authorization: Bearer $AUTH" | python3 -m json.toolMessages not arriving in sessions
- Verify the server is running:
curl http://localhost:4040/health - Check topic-session mapping:
curl http://localhost:4040/telegram/topics - Verify the bot is in your group and has message permissions
- Check server logs:
.instar/logs/server.log
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

