AI keeps repeating failed debugging attempts

One of the most expensive context failures is not losing code. It is losing the list of things that already failed.

Short version: Keep the lesson. Drop the dead branch.

Why this hurts.

When the next chat lacks failed attempts and known constraints, it burns time rediscovering the same non-solution.

How ShardStitch solves it.

01 / ShardStitch

Record the exact failed condition

Record the exact failed command, output, and whether the same condition recurred on each attempt.

02 / ShardStitch

Keep the observed output

Keep the observed output with each rejected approach so the next AI knows what did not work and why.

03 / ShardStitch

Choose a test that separates causes

Choose one small test that would distinguish the remaining hypotheses; point it at relevant files and constraints.

04 / ShardStitch

Avoid replaying a destructive attempt

Mark any destructive or state-changing retry as unsafe until the checkout and prior result are reviewed.

What the next AI receives.

  • Failed attempts that matter
  • What not to retry
  • Constraints learned from failures
  • Next smallest test

What stays out.

  • Full logs unless needed
  • Failed branches with no lesson
  • Speculation loops
  • Old patch attempts

Make the next debugging attempt meaningfully different

For each failed attempt, capture the command or change, relevant environment, and the symptom it targeted. A vague note such as "tried cache" is hard to use.
Keep the exact error or test output and what changed afterward. This shows whether the attempt ruled out a cause or simply did not finish.
Pick the smallest read-only check that can distinguish the remaining explanations. State what result would change the next decision.
Before retrying a mutating command, inspect its side effects and current files. Do not repeat an operation just because the new session lacks its transcript.

FAQ.

Do I need to preserve every failed attempt?

Preserve attempts that rule out a cause, change the project, or constrain the next test. Omit repeated dead ends that add no evidence, but keep the reason an approach should not be retried.

Can ShardStitch diagnose the underlying bug?

No. It helps carry project evidence and prior attempts into a new session; diagnosis still requires inspecting the code and validating a new test.

Related pages.