Why I built cogent42 - a single-file Claude Code bot for Telegram
OpenClaw broke overnight due to an Anthropic policy change. Instead of fixing it, I replaced it with one file and three dependencies.
On April 4th, 2026, my AI agent stopped working.
I’d been running OpenClaw for months - a full-featured, multi-channel AI agent framework with plugins, adapters, YAML configs, and 17,000 open GitHub issues. It had done useful things. It had also broken in mysterious ways roughly once a week.
This time, it broke for a concrete reason: Anthropic changed a policy. “LLM request rejected: Third-party apps now draw from your extra usage.” OpenClaw, like most third-party Claude integrations, hadn’t been updated to handle it. There was an open issue. There were twelve PRs attempting to fix it. None merged.
I spent an hour trying to debug it before deciding I’d rather build something new.
The constraints I gave myself
- One file. The entire bot - Telegram handling, Claude integration, memory, scheduling - lives in one JavaScript file. If I can’t read it in one sitting, it’s too complex.
- Three dependencies. telegraf (Telegram), claude-agent-sdk (Claude), dotenv (env vars). That’s it. No plugin system, no adapters, no abstractions I didn’t write.
- Two-minute setup. Clone, run
node setup.js, answer five questions, done. If it takes longer than that, I’ve failed the design constraint.
What I learned building it
The most interesting discovery: constraints produce clarity.
When you decide you’re only allowed one file, a lot of architectural questions answer themselves. Do you need a plugin system? No - there’s nowhere to put one. Do you need multiple channels? No - pick one and do it well. Do you need a database? No - a JSON file is fine until it isn’t.
The second thing: simplicity isn’t about doing less. cogent42 has persistent memory, scheduled tasks, mid-task injection, live progress streaming, and smart model routing. It does a lot. It’s just not a framework for doing a lot - it’s a tool that does a specific thing.
The thing that surprised me
I assumed I’d miss the features I removed. I don’t.
Multi-channel support sounds useful until you realize you only actually use one channel. Plugin marketplaces sound useful until you spend three hours debugging a plugin version conflict. Complex configs sound useful until you can’t remember what half the fields mean six weeks later.
What I do use, every day: Bash execution, file editing, the knowledge base, scheduled tasks. The 20% of features that do 80% of the work. Those I kept. The rest I left out.
cogent42 is open source. If you’ve ever wanted full Claude Code access from your phone, it takes about two minutes to set up.