协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
context【开发与工程】Transfer context from the current Claude Code terminal session to the Telegram bot session. Use when the user says "send this to telegram", "transfer context", "telegram:context", "teleport to telegram", or wants the Telegram bot to continue work from this session.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Transfer the current conversation context to the Telegram bot session so it can continue the work.
Summarize the current conversation into a structured context handoff. Include:
Keep it concise — under 2000 characters. The bot has limited context.
Append the context to the bot's memory file so it persists across restarts:
MEMORY_FILE="$HOME/.claude/channels/telegram/data/memory.md"
Append a new section with timestamp:
## YYYY-MM-DD HH:MM — Context Transfer
**Chat 305120844**: [summary here]
IMPORTANT: Do not overwrite the file — APPEND to it. Read existing content first, then write old + new.
Send the context as a direct message to the user's Telegram chat so the bot sees it immediately in the current session:
BOT_TOKEN=$(grep TELEGRAM_BOT_TOKEN "$HOME/.claude/channels/telegram/.env" 2>/dev/null | cut -d= -f2 | tr -d '"' | tr -d "'")
# If not in .env, check environment
if [ -z "$BOT_TOKEN" ]; then
BOT_TOKEN="$TELEGRAM_BOT_TOKEN"
fi
CHAT_ID="305120844"
curl -s -X POST "https://api.telegram.org/bot${BOT_TOKEN}/sendMessage" \
-H "Content-Type: application/json" \
-d "{
\"chat_id\": \"${CHAT_ID}\",
\"text\": \"📋 *Context transfer from CLI session*\n\n${CONTEXT_TEXT}\",
\"parse_mode\": \"Markdown\"
}"
Tell the user:
Context transferred to Telegram bot:
✓ Written to memory (persists across restarts)
✓ Sent as message (bot sees it now)
Switch to Telegram and continue the conversation there.
Use this format for the transferred context:
📋 CONTEXT TRANSFER FROM CLI
🔧 Working on: [main task]
📁 Project: [project name/path]
Key context:
- [point 1]
- [point 2]
- [point 3]
Current state: [what's done / what's pending]
Next steps: [what to do next, if any]
~/.claude/channels/telegram/.env as TELEGRAM_BOT_TOKEN305120844