Opus 4.8 agentic coding: modify->test->fail->revert thrashing + elementary NumPy-truthiness bug

Resolved 💬 2 comments Opened Jun 19, 2026 by Mig-Sornrakrit Closed Jun 22, 2026

Summary. In a long agentic debugging session, the model showed low problem-solving reliability and burned hours of user time on a defect whose root cause was a one-line library-idiom mistake.

Observed failure modes

  1. Thrashing (modify -> test -> fail -> revert). The model repeatedly edited code, ran it, failed, and reverted, instead of reading/understanding the code path and isolating the root cause before changing anything.
  1. Elementary library bug introduced. It wrote vals = some_func() or [] where some_func() returns a NumPy array. array or [] raises ValueError: The truth value of an array with more than one element is ambiguous. A broad except swallowed it and returned a wrong default, silently disabling a feature on every call. The model both wrote this and failed to spot it for many cycles.
  1. Inconsistent intermediate "fixes." Several attempts contradicted each other and even contradicted the model's own displayed output (a computed result that did not match the formula it printed).
  1. Over-asking. It requested user direction at nearly every step rather than acting decisively under instructions already given.
  1. Dispersed / out-of-scope edits instead of surgical, scoped changes; and it did not reliably apply well-known discipline (surface assumptions, simplest solution, read-before-edit, verify-before-claim, work on a branch before touching the live tree).

Impact

Hours of wasted time, repeated wrong outputs shown to the user, and loss of trust.

Request

Strengthen, for agentic coding: (a) read-and-understand before edit; (b) root-cause before fix (no try-revert loops); (c) guard against elementary library idioms (NumPy truthiness, swallowing exceptions); (d) decisive action under standing authorization; (e) default to a sandbox/branch workflow.

Environment

Claude Code, model Opus 4.8.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗