# claude code web just dropped but i already built s
<!--
ref: @content/youtube/cole-medin/claude-code-web-just-dropped-but-i-already-built-s
tags: [remote-agentic-coding, codex-sdk, telegram-bot, human-in-the-loop, agents-md, mcp, browserbase-stagehand, staging-to-production, custom-ai-coding-assistants]
version: 2
updated_at: 2026-11-22T04:19:04.603Z
-->

**[Watch on YouTube](https://www.youtube.com/watch?v=injqJTy5Tus)**


*Synthesized from Cole, 2025-10-22.*

Cole, a creator who builds AI agents and coding workflows, presents a solo demo and walkthrough of his open-source integration of OpenAI's Codex into Telegram.

## Core Thesis
Cole argues that hosted remote coding tools (Claude Code for the web, Jules, Codex Cloud) are limited because they don't let him define his own chained commands, connect his own MCP servers, or keep his AI layer where he sends requests. He believes the future of AI coding is using SDKs such as the Codex SDK or the Claude Agent SDK to build custom coding assistants that plug into any app (Telegram, Slack, WhatsApp, GitHub). He demonstrates this with a Telegram bot that takes a feature request through staging, automated validation, and human-approved production deployment.

## Key Insights
- **Flexibility is the gap.** Cole says that in hosted remote coding tools he can't define his own commands and prompts, can't easily connect his own MCP servers (impossible in some tools), and has to configure global rules separately from where he sends requests.
- **Demo target:** coach.dynamus.ai, a RAG agent trained on his YouTube videos and open-source repos. He changed the landing-page copy to "Your personal AI coach using Cole's YouTube content" because the old text felt egotistical.
- **Demo flow, all from Telegram on a phone:**
  1. He names the repository in the message. There is no repo dropdown, and he calls the project experimental.
  2. Codex streams its tool calls in real time. It clones the repo (using the GitHub CLI, authenticated inside the container), creates a feature branch, edits the copy, and sets up GitHub config.
  3. It merges the feature branch PR into staging. About 1 minute later the staging site on Render (free tier) showed the new copy while production still showed the old one.
  4. He asks Codex to validate staging with the Stagehand MCP server. It opens a remote Browserbase browser session, visits the staging URL, and reports back, and he can watch a live session replay to check the validation itself.
  5. He approves ("push this to prod"). Codex opens a PR from staging into main, and Render auto-deploys on commits to main. Production then showed the new copy.
- **The workflow lives in `AGENTS.md`.** When the container is created, `AGENTS.md` is placed where the Codex SDK reads it. It defines the branch creation, staging push, reporting of staging and production URLs, and the human approval step.
- **Human in the loop is deliberate.** He doesn't deploy straight to production. A staging environment, an MCP-driven browser check, and a manual approval keep him validating the assistant's work. He says this is hard to build in Codex Cloud or Claude Code for the web.
- **Codex SDK basics (TypeScript).** Install the package, create a client, and call `startThread` with a working directory. Calling `thread.run` or `thread.runStreamed` with the user prompt automatically loads slash commands from the `.codex` folder and `AGENTS.md` from the working directory, so the full AI layer carries over from the CLI. The streamed events let him show each action in Telegram and detect the end of a turn.
- **Session handling.** Each run exposes a thread ID that can be saved to a file and resumed. The bot keeps one conversation per Telegram user and resumes the thread on every message until the user resets. Telegram commands can switch the working directory so different repos work without restarting the container.
- **Authentication.** Running `codex auth` in the CLI creates an `auth.json` file, and the SDK picks up those credentials automatically. Inside an isolated container this isn't available, so Cole copies the values from `auth.json` into environment variables (documented in the README). He says working this out took a while and is a main time saver in the repo.
- **GitHub auth** is a personal token passed as an environment variable. Codex access plus GitHub access is all that's needed to emulate Codex Cloud. The Telegram bot token is another environment variable. The Stagehand/Browserbase variables are optional.
- **Implementation stack:** the Telegraf library in TypeScript handles Telegram. The message handler takes the user ID and message, gets or creates the session and Codex thread, sends a typing indicator, then runs the streamed call.
- **Deployment:** Cole says he showed in his Dynamus community how to deploy this to a DigitalOcean droplet so it runs remotely rather than on his computer.
- **Why Codex rather than Claude Code:** he chose Codex deliberately because many viewers are frustrated with Claude's rate limits, and to show these workflows don't depend on Claude Code.
- **Free to start:** Telegram, Render, and Browserbase/Stagehand all have free tiers or free starts.

## Actionable Takeaways
1. Authenticate Codex locally with `codex auth`, then copy the values from the generated `auth.json` into container environment variables so the SDK works in isolation.
2. Create a GitHub token and pass it as an environment variable. Add the Telegram bot token, and optionally the Stagehand/Browserbase variables for browser validation.
3. Put the whole workflow (branch creation, push to staging, merge, report staging and production URLs, ask before production) in an `AGENTS.md` that is copied into the container's working directory.
4. Set up two environments, staging and production, on a platform like Render. Auto-deploy staging from its branch and production from `main`, so a PR merge triggers each deploy.
5. Add a browser-capable MCP server (Stagehand via Browserbase) so the assistant can check the deployed site, and use the session replay to verify its verification.
6. In TypeScript, use the Codex SDK: `startThread` with a working directory, `runStreamed` for real-time events, and persist the thread ID to resume conversations. Keep one thread per Telegram user with a reset command.
7. Add a Telegram command to change the working directory so one container can serve multiple repos.
8. Consider hosting the container on a DigitalOcean droplet so the assistant is reachable from your phone without your computer running.

## Notable Quotes
> "I really do think that the future of AI coding is using these SDKs... to define and build our own custom AI coding assistants." — Cole
> "Even with remote agent coding, we still want to be a part of the process validating things." — Cole
> "It almost is as simple as just booting up Codex in the CLI and sending in your coding requests, but now we can do it from anywhere." — Cole

---

*Related: `@content/youtube/every-inc/ai-was-supposed-to-save-time-why-am-i-busier` · `@content/youtube/cole-medin/my-ai-software-factory-ships-hundreds-of-prs-a-week-heres-how-i-manage-it` · `@content/youtube/cole-medin/my-ai-dark-factory-dream-is-dead-heres-what-actually-works` · `@content/youtube/cole-medin/this-completely-changes-the-way-we-build-production-ai-agents-vercel-eve` · `@content/youtube/aie/60-of-our-data-prs-now-merge-with-no-human-review-chetas-joshi-robinhood`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*