Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 8 min read How-to mediumAdept

The 3 Levels of Debugging With AI

AI-assisted debugging falls into three levels: pasting raw errors into an LLM ("lazy prompting"), writing structured bug-report-style prompts with code, environment, expected vs. actual behavior, and attempts so far, and agents that drive real debuggers. Lazy prompting suits shallow bugs with clear stack traces but risks generic or hallucinated fixes, while structured prompts reduce hallucinations and force you to reason about the bug. Microsoft's debug-gym lets agents set pdb breakpoints, inspect variables and write tests inside Docker sandboxes, lifting o1-preview from 10.7% to 30.2% and Claude 3.7 Sonnet from 37.2% to 48.4% on SWE-bench Lite. Recommended practices include time-boxing, verifying fixes, sandboxing agents, logging their actions and keeping humans in the review loop.

Assumes: LLM prompting basicsstack traces

Related posts

  • Debugging our AI search assistant with agent tracing

    Sentry mediumAdept

    Sentry's Search Query Assistant converts natural-language prompts into Sentry Search Syntax, and its team relies on evals plus agent tracing to debug wrong outputs. One bug made queries on custom numeric attributes return nothing. Tracing the conversation's system prompt, LLM generations and tool calls through to the backend API trace showed the prompt listed fields by bare name (e.g. bug__predictions_count) instead of the required tags[name, number] form. The team turned that finding into a new eval, fixed the bug, confirmed the fix in production traces, and now sends local eval runs to Sentry too.

  • Making Failure Diagnosis Reliable with Pensive AI

    Netflix TechBlog mediumAdept

    Netflix augmented Pensive, its rule-based failure diagnosis system for data and ML workloads, with LLM-based error extraction and on-demand debugging after roughly half of seven million failure classifications landed in an "unknown" bucket. Extraction numbers log lines and has the model return only start and end line indices, so cost stays bounded, hallucinated text is avoided, and calls fit under Maestro's 90-second deadline. On-demand debugging is cached per step attempt, using conditional writes to deduplicate concurrent requests, and streams full-snapshot SSE events that are republished over GraphQL WebSockets. Evals use frozen legacy regex rules as reference labels, logs archived to S3 as stable inputs, LLM judges for inclusion and precision, and noise and latency checks; AI extraction now covers 100% of failures.

  • Prompt Engineering as a Developer Discipline

    Neon mediumAdept

    Developers should treat prompts as modular, testable software components rather than guesswork, applying the same rigor they bring to code. Five prompting patterns are shown with before-and-after LLM outputs for coding tasks. Few-shot examples make the model mirror your docstring and type-hint style. Chain-of-thought instructions yield clearer logic and comments, and self-consistency prompts generate several approaches with complexity analysis before recommending one. Skeleton prompts constrain code structure, and explicit output schemas such as JSON make generated code easier to integrate with other systems.

  • Using Docker AI Tools for Devs to Provide Context for Better Code Fixes

    Docker mediumAdept

    LLMs fix lint violations far better when given the surrounding code, so Docker Labs built a prompt-driven pipeline where each step runs in a container: Pylint produces a violation report, violations are loaded into SQLite, and Tree-sitter parses the project into an AST whose top-level statement ranges are indexed alongside the source. The LLM then queries this database (writing its own SQL from the schema) to retrieve the enclosing function for a violation before proposing a fix. This sidesteps context-window limits of reading whole files, and the same pattern generalizes to any tool that maps code locations to issues.

  • You can’t vibe code a prompt

    incident.io mediumAdept

    Letting an LLM iteratively rewrite a prompt until evals pass produces overfitted, brittle prompts. In incident.io's Slack-message relevance classifier, Claude fixed one failing case but broke others. Given the whole eval suite, Claude Code hit 100% only by bloating the prompt 7× and hardcoding every test case, which reverted to the original failures once that section was removed. The recommended approach is to write prompts by hand with structurally similar but non-overlapping examples, and use LLMs for generating evals and examples, judging outputs, linting prompts for contradictions, and grading production interactions.

The quest for software engineering knowledge.

Look:
Layout: