← All posts

An AI reviewer on a short leash: n8n, Telegram and Claude, with a human on the button
2026-11-16
The problem
On a busy team, the signals that matter are scattered. Pull requests wait for review, builds fail quietly in a CI tab nobody has open, and production errors pile up in an error tracker until a user complains. I wanted one place where the team hears about all of it, and a fast way to get a useful first pass on each item without giving an AI the keys.
The result is a set of small n8n workflows that talk to the team on Telegram, with Claude doing the first draft and a person deciding every time.
The shape of it
Every flow follows the same pattern:
- Something happens: a new pull request, a failed build, a production error.
- n8n notices and sends a short Telegram card with the facts and a few buttons.
- A person taps a button if they want help.
- Claude works in a restricted, read-only session and returns a draft.
- The person decides: post it, edit it, or throw it away.
The AI never acts on its own. It only ever produces a draft.
Flow 1: pull requests and builds
A scheduled watcher in n8n checks for new pull requests and CI runs every 15 minutes. For each one, it posts a card to Telegram: the title, the author, the build status, and a Review button. Failed builds get their own alert, so a red pipeline doesn't wait for someone to open the CI page.
Tapping Review does three things:
- fetches the pull request into a private ref, so the review sees exactly that code;
- starts a Claude session with read-only, restricted tools and a hard spending cap per run;
- sends the draft review back to Telegram with Post, Edit and Discard buttons.
Before anything is posted, the flow checks that the pull request hasn't changed since the review ran. If new commits arrived, the draft is stale and doesn't go out. Nothing reaches the repository without a tap.
Flow 2: production errors
Production errors start in the error tracker (GlitchTip, which speaks the Sentry protocol). When an issue repeats, an alert calls an n8n webhook. n8n turns it into a bug on the team's board, deduplicated by the issue id, so the same error raises a counter instead of filing ten bugs. Webhooks get missed sometimes, so a scheduled job reconciles every 30 minutes.
From there, the AI proposes a fix, and a developer reviews, edits or confirms it. As with pull requests, the proposal is a starting point, not a change.
The guardrails that matter
- A human on the button. Every action needs a tap. The AI writes drafts; people ship.
- Read-only by default. The session can read the code it needs and nothing else.
- A spending cap per run. A runaway session costs a few dollars at worst, not a surprise bill.
- Stale checks. A review of old code never gets posted on new code.
- Dedup and reconcile. Alerts stay one-per-problem, and missed webhooks get picked up.
One honest limit: the session runs under my own user, so the boundary is tool permissions, not a true sandbox. The next step is a separate service account in its own container, so the limits are enforced by the system and not just by configuration.
What I learned
- Noise kills alert channels. Start with the few alerts people will act on, and add more only when the first ones are trusted.
- Make the AI's output a draft, never an action. People adopt it quickly when they stay in control.
- Keep the human step to one tap. If approving takes longer than doing the review yourself, nobody will use it.
- Cap the cost from day one. It makes it safe to let anyone on the team press the button.
The result is a team that hears about problems in minutes, gets a solid first pass in one tap, and still owns every decision.