ATelegrambotinaweekend
Claude on the backend, webhook on Vercel, no server to maintain.
The shape of the build
A Telegram bot is the simplest interesting backend you can ship. Webhook in. Message processed. Reply out. No frontend, no auth flows, no design system.
The only piece worth thinking about is what happens between "received message" and "reply". For me that piece is Claude.
What I built
A bot I send voice notes to during walks. The webhook fires, the audio is transcribed, Claude reads my recent notes and decides whether the new note is a task, a journal entry, or a future-essay seed. It ends up in the right place automatically.
It took roughly four hours over two evenings. Three of those hours were Telegram's webhook setup and ngrok-versus-Vercel debugging. The Claude part was twenty minutes.
The skeleton
export async function POST(req: Request) {
const update = await req.json();
const text = update.message?.text;
if (!text) return new Response("ok");
const response = await fetch("https://api.anthropic.com/v1/messages", {
method: "POST",
headers: {
"x-api-key": process.env.ANTHROPIC_KEY!,
"content-type": "application/json",
"anthropic-version": "2023-06-01",
},
body: JSON.stringify({
model: "claude-opus-4-7",
max_tokens: 1024,
messages: [{ role: "user", content: text }],
}),
});
const reply = (await response.json()).content[0].text;
await sendTelegramMessage(update.message.chat.id, reply);
return new Response("ok");
}
That is the whole thing. Everything else is decoration.
Why it matters
The cost of "have a thought, capture it, sort it" used to be a friction-laden mobile app. Now it is a chat that's already on my home screen. The bot was the unlock — the AI was the easy part.
Like this? Get the next post in your inbox — two emails a week, every one shippable.
Why your agent keeps forgetting
Working memory, persistent memory, and the gap that quietly breaks every long-running agent.