Smarter Week

How to automate it

How to automate “debug failing builds and production bugs”

Here are 2 ways to spend less time on this, best first. Each comes with steps you can follow today and, for AI fixes, a prompt to copy.

60 min
typically, every day
40%
of the time can be automated
Easy
to set up

Fix 1 of 2

AIBest fix

Debug with AI by giving it the error, the code and what you tried

AI is fast at reading stack traces and logs and suggesting likely causes. A coding agent can also reproduce the failure and try fixes in the repo.

Typically saves about 30% of the time5 min to set up
  1. 1Collect the error message, stack trace, relevant logs and the code involved.
  2. 2Paste them into your coding assistant, or run a coding agent in the repo so it can read the code itself.
  3. 3Ask for ranked hypotheses before asking for a fix.
  4. 4Confirm the root cause with a failing test before you accept the fix.
Prompt to copy
I am debugging [SHORT DESCRIPTION]. Expected: [WHAT SHOULD HAPPEN]. Actual: [WHAT HAPPENS]. Here is the error and stack trace, the relevant code, and what I have already tried. Give me the three most likely causes ranked by probability, how to confirm each one, and then the smallest fix for the most likely cause. Do not rewrite unrelated code.

Error and logs:
[PASTE]

Code:
[PASTE]

Already tried:
[PASTE]

Tools: Claude Code, OpenAI Codex, Cursor, GitHub Copilot agent mode or Devin Desktop (ex-Windsurf) · ChatGPT, Claude, Gemini or Microsoft Copilot

Fix 2 of 2

AI

Hand well-scoped tasks to a coding agent and review its pull request

Coding agents like Claude Code, OpenAI Codex, Cursor's agent and GitHub Copilot's coding agent can read the repo, make multi-file changes and run the tests. They do best on clear, bounded tasks you can review quickly.

Typically saves about 30% of the time30 min to set up
  1. 1Check which coding agent your company approves and that it has access to the repo.
  2. 2Add a short instructions file to the repo (CLAUDE.md, AGENTS.md or .cursor/rules) with how to build, test and the conventions to follow.
  3. 3Give it a ticket-sized task with acceptance criteria, using the prompt below.
  4. 4Let it run the tests; read the diff as carefully as a colleague's PR.
  5. 5Start with tests, refactors, small features and config changes before larger work.
Prompt to copy
Task: [WHAT TO BUILD OR CHANGE]. Context: [RELEVANT FILES OR MODULES]. Acceptance criteria: [LIST]. Constraints: follow the existing patterns in [EXAMPLE FILE], do not add new dependencies, do not change public APIs unless needed. First read the relevant code and give me a short plan. After I approve, make the change, add or update tests, run the test suite and linter, and summarize what you changed and anything you were unsure about.

Tools: Claude Code, OpenAI Codex, Cursor, GitHub Copilot agent mode or Devin Desktop (ex-Windsurf)

Who does this task

Roles in our library that list this as one of their common tasks. Each guide covers the rest of that role’s week.

HourLeak · the 8-minute work audit

How many hours does this cost you?

The free 8-minute check works out where your week goes and gives you your top fixes. The team scan does the same for everyone and adds it up, so you know which leaks to fix first.

Answers are anonymous. Leaders only see team totals.

Other common tasks for Software engineers