Skip to content
OPQAI.
Sourced intermediate / 💻 Coding

Fix a bug and ship the pull request with Claude Code

Job to be done: Fix a software bug and open a pull request without leaving the terminal

🇳🇬 Ways to use this in Nigeria

Ideas to get you started, adapt to your situation.

  • 9-5 employee

    As a software developer at a Nigerian fintech company, use Claude Code to quickly resolve a bug in the mobile banking app's transaction history module, meeting your sprint deadline.

  • Entrepreneur

    As a tech founder, quickly resolve a critical bug in your e-commerce platform's checkout process using Claude Code, ensuring smooth transactions before your product launch.

  • Student

    As a university student building a client's e-commerce site for your side hustle, use the free Gemini CLI to quickly fix a payment gateway bug blocking orders, so you can get paid.

What you’ll get

A repeatable loop for fixing bugs with an AI coding agent: you hand it the error, it finds the cause, proposes fixes, applies the one you pick, verifies with tests, and opens the pull request. The whole cycle happens in your terminal.

Tools you need

  • Claude Code: Anthropic’s terminal coding agent. Requires a Claude Pro/Max plan or API credits (paid).
  • Git: free; the PR step assumes your project is on GitHub.

Steps

  1. Open your project and start the agent:
cd /path/to/project
claude
  1. Share the error exactly as you see it. Tell it the command that reproduces the issue so it can get a stack trace itself:
I'm seeing an error when I run npm test
  1. Ask for options before letting it edit anything:
suggest a few ways to fix the @ts-ignore in user.ts
  1. Apply the fix you prefer:
update user.ts to add the null check you suggested
  1. Verify, make the agent prove the fix:
run the new tests and fix any failures
  1. Ship it:
create a pr

Original source

This workflow comes straight from Anthropic’s official “Common workflows” documentation for Claude Code (living document, accessed June 2026). The source covers more recipes: understanding new codebases, refactoring, writing tests, and generating docs.

Notes & variations

  • Mention whether the error is intermittent or consistent, it changes how the agent investigates.
  • Free-tier variation: Gemini CLI (free) and other open-source agents accept the same prompt pattern: reproduce, suggest fixes, apply, verify, PR.
  • For changes you want to review before they touch disk, run in plan mode first (claude --permission-mode plan).

Keep going

More Coding workflows