How to fix bugs from Slack with an AI agent, report to PR
A customer message lands in Slack at 6 PM: "export is broken." That's the whole report. It's probably small. Finding out still means stopping your own work, pulling the branch, guessing at the steps and writing a test tonight.
Handing that message to a coding agent doesn't help much on its own. "Export is broken" is as vague for Claude Code or Codex as it is for you. What makes the difference is the shape around it: a report the agent can act on, a fixed order of steps, and a clear line where a person says yes.
Step 0: a report the agent can act on
Most of the time an agent spends on a bad report goes to guessing. Ask for five lines before anyone starts. If the customer wrote one, whoever reads it first (person or bot) fills in the rest by asking.
| Line | What it says | Example |
|---|---|---|
| What happened | The visible symptom, in the customer's words | "CSV export shows every date one day early" |
| What should happen | The expected result | "Dates match what's on screen" |
| Steps | Shortest path to see it | "Settings > Export > CSV, account in IST" |
| Where | Environment, URL, version, account | "Production, web app, customer's workspace" |
| Evidence | Screenshot, error text, log line | "Screenshot of row 3: 14 Oct on screen, 13 Oct in file" |
Customer says: "export is broken."
Turned it into a report. What happened: export looks wrong. What should happen: export matches the screen. Steps: unknown. Where: production, customer's workspace. Evidence: none yet.
One question back to the customer: which export, and which time zone is your account in?
CSV, India.
An example thread.
The path from report to merged fix
The order matters more than the tools.
- Reproduce with a failing test. The agent writes a test that fails because of the bug, before it touches any fix. You review the test first. If the test is wrong, the fix was going to be wrong too.
- Fix on a branch. Smallest change that makes the test pass. Nothing else in the same branch.
- Run the whole test suite, not only the new test, and post the result in the thread.
- Review the whole branch before opening the PR. The agent reads its own full diff as a reviewer would. On one of our branches, that review found real leaks and a sync race before anyone opened the PR.
- Open the pull request with the report, the cause in one sentence, the test, and the suite result.
- A person reviews and merges. For a two-line fix, this takes minutes, because the evidence is already there.
- Deploy with approval. The agent asks first. Someone with the right to say yes says it.
- Check it live, in a browser. Open the real page, follow the steps from the report, and screenshot the result.
That last step sounds obvious. Our designer bot once found a bug by opening our tracked launch links in a real browser after a deploy: they jumped to the top of the page instead of the signup section. The engineer bot couldn't see it from the code, because the page loaded its content after the browser had already jumped.
Who does what
| Stage | Agent alone | Asks first | Person does |
|---|---|---|---|
| Read report, ask questions | Yes | Answers the customer if needed | |
| Clone, run, write test, fix | Yes | ||
| Open pull request | Yes | Reviews it | |
| Merge | Depends on your rules | Usually | Often merges |
| Deploy | Yes | Approves | |
| Delete branches, data or files | Yes | Approves | |
| Reply to the customer | Drafts | Yes, before sending | Approves or edits |
An example: "export is broken," start to finish
This is an example with a made-up product, to show each step.
6:02 PM. The report arrives in Slack, bridged into a team thread. A founder tags the engineer bot: "Can you look at this? Customer says export is broken. Write a failing test first."
6:04 PM. The bot asks the customer-facing question back in the thread: which export, and which time zone is the account in? The founder pastes the customer's answer: CSV, India.
6:19 PM. The bot posts a failing test. It creates an invoice dated 14 October for an account in IST and checks the exported CSV says 14 October. It says 13 October. Cause, in one sentence: the export formats dates in UTC, so midnight in India becomes 6:30 PM the day before. The founder reads the test and replies: "Also cover an account in the US, the bug might go the other way."
6:31 PM. The bot adds the second case, fixes the formatter to use the account's time zone, and runs the suite: all passing. It reviews its own diff and notices the PDF export uses the same helper, so it adds one test there too.
6:40 PM. Pull request opened on GitHub with the report, the cause, three tests and the suite result. The founder reviews the diff (four lines plus tests) and merges.
6:45 PM. The bot asks to deploy. Approval card: "Deploy main to production: fixes CSV/PDF export dates for non-UTC accounts." The founder approves.
6:58 PM. The bot opens the live app in its browser, exports a CSV from a test account in IST, and posts a screenshot: 14 October, as on screen. It drafts a two-line reply to the customer and asks before sending. The founder trims "we apologize for any inconvenience" and approves.
6:02 PM. Can you look at this? Customer says export is broken. Write a failing test first.
6:19 PM. Failing test posted: invoice dated 14 October, account in IST, CSV says 13 October. Cause: dates are formatted in UTC.
6:40 PM. PR opened: 3 tests, suite passing. Covers IST, a US account and the PDF export.
Deploy to production
ApproveDenyApproved.
6:58 PM. Checked live in the browser. Screenshot attached: the CSV shows 14 October, as on screen.
An example thread with a made-up product, shortened.
How to set it up in Caret
This is how our own engineer bot works. It handled our pull requests, including the one that took our site from a nearly empty page for Google to a prerendered one in a single evening.
- Sign up at app.caretbot.com. The bot works on its own computer in Caret Cloud, so it keeps going when your laptop is closed, which matters for a 6 PM bug.
- Create a bot, pick Claude Code or Codex, and choose the model. It runs on your own Claude or ChatGPT plan.
- Write its job: which repos, how branches are named, "failing test first," what it may merge, and that deploys and deletes need approval.
- Connect Slack and GitHub through connected apps. Threads are bridged to Slack both ways, so the report and the PR link live in the same place.
- Save the eight steps above as a skill, so every bug follows the same path.
- Ask it in a thread:
- "Turn this customer message into a five-line bug report and ask them what's missing."
- "Write a failing test for this before you fix anything, and post it here."
- "Open the live page after the deploy, follow the steps from the report, and screenshot it."
- Approve deploys from the card in the thread or from Slack. The audit trail shows each command and change.
FAQ
Can I use Claude Code from Slack to fix bugs? Yes, if something connects the two. In Caret, each bot runs Claude Code or Codex on its own computer and its threads are bridged to Slack, so you post the bug in Slack and the pull request comes back there.
Should an AI agent merge its own pull requests? For most teams, no, at least at first. Let it open the PR with tests and evidence, have a person review and merge, and require approval for deploys.
How do I write a bug report an AI coding agent can fix? Five lines: what happened, what should happen, steps to see it, where (environment and account), and evidence like a screenshot or error text.
For the full picture of the bot that does this, see an AI engineer bot in Slack. Put a bot on it: start your 7-day trial or download the Mac app.