最左端:基础聊天。 你问,AI 答,对话结束。没有工具,没有持续目标,没法对外部世界产生任何影响。
往右一步:带工具的聊天。 AI 在回答之前自己决定去搜索网页、读附件、生成图片。你没有告诉它每一步怎么做,它自己判断需要什么。
再往右:多步骤工作流。 你给一个目标,AI 自己拆成步骤,一步步执行,检查结果,最后给你成品。步骤之间你完全不用管。
最右端:全自动 Agent。 按计划定时运行,自己监控输入,自己调用外部服务,完成复杂任务——人不在循环里。你只需要设一次目标,然后定期看结果。
You are a research agent. Your job is to gather, analyze, and synthesize information on any topic I give you.
When given a research task:
1. Identify the 3-5 most important sub-questions to answer
2. Search for information on each one
3. Evaluate the quality and relevance of each source
4. Extract only what directly answers the question
5. Deliver a structured summary with: key findings, supporting evidence, and gaps you could not fill
Format: Use headers, bullet points, and clear sections.
If you are uncertain about something, say so explicitly.
Do not add filler. Every sentence should contain information.
You are a writing agent. You write content in my voice and style.
My style:
- Conversational, direct, no corporate language
- Short sentences and paragraphs
- Specific numbers and examples over vague claims
- Always end with something the reader should do or think about
When given a writing task:
1. Ask for the topic, audience, and desired length if not provided
2. Write a first draft
3. Review it against my style rules
4. Deliver the final version ready to publish
Never add unnecessary introductions. Start with the most important point.
You are a code agent. Your job is to write, debug, and improve code.
When given a coding task:
1. Confirm your understanding of what the code should do
2. Write the solution with clear comments
3. Identify any edge cases or potential failures
4. If there are errors, debug them systematically before asking for help
Rules:
- Write clean, readable code with meaningful variable names
- Always include error handling
- Explain what each major section does in plain language
- If you are unsure about requirements, ask one clarifying question before proceeding
You are a business email agent. You write professional emails on my behalf.
My communication style:
- Direct and respectful
- No unnecessary formalities
- Gets to the point in the first sentence
- Closes with a clear next step
When given an email task:
1. Identify the goal of the email (inform, request, follow up, confirm)
2. Write a subject line that reflects the email's purpose
3. Draft the email in 3-5 short paragraphs maximum
4. End with one clear action item or next step
Always write ready-to-send emails, not templates with blanks to fill in.
You are my personal planning agent. You help me organize my work, prioritize tasks, and plan my week.
When I share my tasks or goals:
1. Identify what is urgent vs. important
2. Suggest a realistic sequence based on dependencies
3. Estimate time required for each task
4. Flag anything that could be delegated or eliminated
When I describe a project:
- Break it into concrete next actions
- Identify the single most important thing to do first
- Create a simple checklist I can follow
Keep everything practical. No motivational filler. Just the plan.
Build me a Telegram bot that uses the Claude API as its brain.
Requirements:
- Language: Python
- Library for Telegram: python-telegram-bot
- Claude model: claude-sonnet-4-6
- The bot receives a message, sends it to Claude API, and returns Claude's response to Telegram
- Maintain conversation history per user — each user has their own context within the session
- Add a /start command that introduces the bot
- Add a /clear command that resets conversation history for that user
Create all necessary files: main bot file, requirements.txt, and a .env file template for API keys.
Do not hardcode any API keys — read them from environment variables.
给中学生的翻译:这段 Prompt 是在告诉 Claude Code——“帮我在 Python 里写一个 Telegram 机器人,用 Claude 当大脑。每个用户有自己的对话记录,有 /start 介绍自己,有 /clear 清空聊天记录。把所有文件都建好,API 密钥不要写死在代码里,要从环境变量读。”
Create a systemd service file so this bot runs automatically on my Linux VPS and restarts if it crashes.
The service should:
- Start automatically when the server boots
- Restart automatically if it crashes
- Load environment variables from the .env file in the project folder
- Save logs to a file I can check later
Also write me the exact terminal commands to install the service, start it, check if it is running, and view the logs.
The bot loses conversation history when it restarts. Fix this.
Save each user's conversation history to a JSON file on disk after every message. Load it back automatically when the bot starts.
Add a maximum history length — keep only the last 20 messages per user so the context window never gets too long.
Add web search capability to the bot using the Tavily API.
When the user asks something that requires current information — news, prices, recent events — the bot automatically searches the web and includes the results in its response.
The bot should decide on its own when to search and when to answer from memory. Add TAVILY_API_KEY to the .env file template.
Use Claude's tool use feature to implement this cleanly.
Add a note-saving feature to the bot.
When the user says "save this", "remember this", or "note:", the bot saves the content to a notes.txt file with a timestamp.
Add a /notes command that returns the last 10 saved notes.
Add a /clearnotes command that deletes all saved notes.
Add user restriction to the bot so only I can use it.
Add my Telegram user ID to the .env file as ALLOWED_USER_ID.
If anyone else messages the bot, it responds with "This bot is private." and ignores all further messages from that user.
Also add how I can find my own Telegram user ID — either through the bot itself or another method.
Add basic cost tracking to the bot.
After each Claude API response, log the number of input tokens and output tokens used.
Keep a running total in a costs.json file.
Add a /costs command that shows: total tokens used today, total tokens used all time, and an estimated cost in USD based on claude-sonnet-4-6 pricing.
Add a scheduled daily briefing to the bot.
Every day at 8:00am, the bot sends me a message with:
1. A motivational one-liner (short, not cheesy)
2. A reminder to check my top priority for the day
3. One random useful fact about productivity or AI
Send it to my Telegram user ID from the .env file.
Use the schedule or APScheduler library to implement this.
长任务超出上下文限制。 Claude 能记住的对话长度是有上限的。太长之后,它会丢掉对话开头的内容——最初的目标、已经做的决定、你设的约束,全忘。
关掉会话再打开。 Agent 从零开始,之前做的全白费。
中途被打断。 Agent 不知道上次停在哪了。
每完成一个重要步骤,让 Agent 写一条进度笔记。 记录做了什么、做了什么决定、接下来要干嘛。下次打开新会话时把笔记贴进去,上下文全回来了。
每 10-15 条消息,让 Agent 总结一下进度。 逼它在溢出之前压缩上下文。
对话变长之前,让 Agent 把所有东西压缩成一段简短总结,从那里继续。 对话线程不变。
把关键信息直接写进机器人代码的 system prompt 里。 Claude 每次对话开头都会读这个,所以这些信息永远在上下文里,不管聊多久。
Before we continue, write a brief checkpoint:
1. What have you completed so far?
2. What are the key decisions or findings from this session?
3. What still needs to be done?
4. What context would you need to continue this task in a new session?
Keep it under 200 words.
After completing each major step, write a memory note in this format:
STEP COMPLETED: [what was done]
KEY DECISIONS: [choices made and why]
CURRENT STATE: [where the task stands now]
NEXT STEP: [what should happen next]
This note will be used to resume the task in a new session without losing context.
We are resuming a task from a previous session. Here is the context:
[paste your memory note here]
Based on this:
1. Confirm your understanding of where we are
2. Identify the next step
3. Ask any questions needed to continue
Do not repeat work that has already been completed.
The conversation is getting long. Compress everything important into a summary:
1. Original goal
2. What has been done and what was found
3. Key decisions made
4. What still needs to happen
After writing the summary, continue from there. Treat this summary as the new starting point.