DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to fix a bug with a diff review before each write with Agent 2

Have the agent debug code while you see every change computed before it is written.

Authorization notice. Agent 2 is dual-use. Only use it on software, sites and systems you own or have explicit permission to test.

Remote script. The agent can run shell commands on your machine, so check each command it proposes that touches your project or system.

Who it is forA developer with a failing test or broken feature who wants the agent to make the fix but wants to inspect each edit.

The problemLetting an agent edit files directly is risky when you cannot see what it is about to change.

The outcomeA bug fix in your project, with each file change shown as a diff before it is written.

What you need first

  • Python 3.9 or newer
  • A free Gemini API key from aistudio.google.com/apikey
  • A local project folder you want the agent to work in
  • For the security use case: Burp Suite or OWASP ZAP installed, and written permission to test the target

Steps

  1. Run python run.py --cli from the Agent 2 folder.
  2. Describe the bug and the command that reproduces it, and ask the agent to find the cause.
  3. Watch the inline diffs; they are computed before each write, so review them as they appear.
  4. Press Ctrl+B to open the full-screen diff viewer and check the whole session's changes.
  5. Run your test command again yourself to confirm the fix.

Prompt for your agent

Use the Agent-2 repo at <path-to-agent2> in CLI mode to fix the failing test in <path-to-project>. Expected output: the minimal code change and a list of files edited. Verify by rerunning the failing test command yourself and confirming it passes.

Caveat. Agent 2 can run commands and write files in your project, so keep the project under version control so you can revert any change.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page