Manuscript Offprint

arXiv:2610.32338

From Faulty Claims to Incorrect Patches: An Empirical Study of Task-Grounded Reasoning in Coding Agents

You Wang, Jinjun Huang, Zhonghao Jiang, Jialun Cao, Jiachi Chen, Zhongxin Liu

YOU WANG, Zhejiang University, China

JINJUN HUANG, Zhejiang University, China

ZHONGHAO JIANG, Zhejiang University, China

JIALUN CAO, The Hong Kong University of Science and Technology, Hong Kong

JIACHI CHEN, Zhejiang University, China

ZHONGXIN LIU ⊗^{\otimes}, Zhejiang University, China

Large language model (LLM)-based coding agents increasingly resolve real-world software engineering tasks, yet they still fail on many of them. Prior trajectory studies characterize these failures through task-agnostic patterns of agent behavior, such as repeated actions. However, incorrect patches can also stem from task-specific errors: an agent may follow a sound workflow yet act on a faulty understanding of the existing code, the task requirements, or a candidate fix. Reasoning models, which power most state-of-the-art coding agents, reveal their understanding through their native chain-of-thought (CoT). The CoT thus serves as an artifact for analyzing whether agents understand the task correctly, by checking whether its claims about the task are consistent with the facts. Yet it remains unclear how many such checkable claims the CoT contains, how many of them are faulty, and whether faulty claims actually cause incorrect patches. We present the first empirical study of such claims, which we term task-grounded reasoning, analyzing 400 trajectories of four open-weight reasoning models on SWE-bench Pro. We extract atomic claims from the CoT with an LLM, assess them against evidence gathered by an LLM agent, and manually trace the defects of incorrect patches back to faulty claims, confirming each link with a claim-corrected replay. Our results show that task-grounded reasoning covers only 18.5% of the CoT tokens, yet yields 191 atomic claims per trajectory. At least 9.6% of these claims are faulty. Faulty claims also occur in 96.7% of the resolved trajectories, so their mere presence is a weak signal of failure. Yet two thirds of the 188 incorrect patches trace back to faulty claims. Correcting such a claim makes the agent fix the linked defect in 89.0% of the cases, and correcting all such claims resolves 11.7% of the failed tasks. Our findings show that the CoT carries task-specific signals for diagnosing and repairing agent failures, but exploiting them requires pinpointing the few faulty claims that actually cause patch defects.

ACM Reference Format:

You Wang, Jinjun Huang, Zhonghao Jiang, Jialun Cao, Jiachi Chen, and Zhongxin Liu. 2026. From Faulty Claims to Incorrect Patches: An Empirical Study of Task-Grounded Reasoning in Coding Agents. 1, 1 (October 2026), 21 pages. https://doi.org/10.1145/nnnnnnn.nnnnnnn

Authors' Contact Information: You Wang, Zhejiang University, College of Computer Science and Technology and the State Key Laboratory of Blockchain and Data Security, Hangzhou, China, prinzywang@zju.edu.cn; Jinjun Huang, Zhejiang University, College of Computer Science and Technology and the State Key Laboratory of Blockchain and Data Security, Hangzhou, China, huanghuanghuang@zju.edu.cn; Zhonghao Jiang, Zhejiang University, College of Computer Science and Technology and the State Key Laboratory of Blockchain and Data Security, Hangzhou, China, zhonghao.j@zju.edu.cn; Jialun Cao, The Hong Kong University of Science and Technology, Department of Computer Science and Engineering, Hong Kong, Hong Kong, jialuncao@ust.hk; Jiachi Chen, Zhejiang University, College of Computer Science and Technology and the State Key Laboratory of Blockchain and Data Security, Hangzhou, China, chenjiachi@zju.edu.cn; Zhongxin Liu, Zhejiang University, College of Computer Science and Technology and the State Key Laboratory of Blockchain and Data Security, Hangzhou, China, liu_zx@zju.edu.cn.

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.

© 2026 Copyright held by the owner/author(s). Publication rights licensed to ACM.

ACM XXXX-XXXX/2026/10-ART

https://doi.org/10.1145/nnnnnnn.nnnnnnn

You Wang, Jinjun Huang, Zhonghao Jiang, Jialun Cao, Jiachi Chen, and Zhongxin Liu

Figure

Fig. 1. No task-agnostic failure pattern occurs, yet a faulty claim in the CoT leads to an incorrect patch.

1 Introduction

Coding agents are increasingly capable of resolving real-world software engineering tasks[16, 41, 47] and now solve a large share of the issues in issue-solving benchmarks [10, 15, 17]. Yet they still fail on many of them, often silently, submitting plausible-looking patches that pass their own validation but do not implement the intended behavior [42]. Improving agents therefore requires understanding not only how often they fail, but how their issue resolution goes wrong.

To understand how agents fail, prior studies analyze their trajectories through properties such as action patterns and the semantic coherence among thoughts, actions, and observations [6, 25], identifying failure patterns such as repeated actions or untested fixes. Such patterns are task-agnostic: they describe how an agent behaves, independent of what the task requires. Yet an agent may follow an exemplary workflow free of such patterns and still produce an incorrect patch by acting on a faulty task understanding, such as an incorrect belief about how the existing code behaves, what the task requires, or how the requirements can be realized. Detecting such failures requires checking this understanding against the task itself.

An agent’s task understanding is not directly observable, but reasoning models, which power most state-of-the-art coding agents [1, 28], expose an observable proxy: their native chain of thought (CoT). Unlike the brief thoughts that agent frameworks record alongside actions [9, 44], the CoT contains extensive analysis of how the agent interprets the issue, what it believes the code does, and why it chooses a particular fix. Prior work shows that models tend to externalize their reasoning in the CoT on tasks that require multi-step reasoning [18], and that the CoT reveals substantially more about agent behavior than actions alone [4, 13]. The CoT records what the agent explicitly states about the task, making it a natural artifact for studying task understanding.

To study task understanding, we focus on the claims the CoT makes about the task: how the original implementation behaves, where it falls short of the task requirements, what the task specifically requires, and how a fix can meet those requirements. We refer to such content as task-grounded reasoning. Its defining property is that it is checkable: whether a claim holds can be determined from available and authoritative evidence, such as the task statement, the repository at its base commit, and the documentation of the libraries it uses. Identifying errors in this reasoning can thus be framed as fact verification [32, 38]: we decompose task-grounded reasoning into atomic reasoning units, each stating one claim, and call a unit refuted by evidence a faulty claim. For example, the agent in Figure 1 exhibits none of the task-agnostic failure patterns, yet submits an incorrect patch because its CoT claims that the code already maps every ITEMn. EMAIL field, whereas the code maps only the first two. Faulty claims thus enable task-specific diagnosis: a faulty claim pinpoints what the agent understands incorrectly, even when its behavior shows no sign of failure.

However, whether faulty claims can help explain why agents produce incorrect patches remains an open question. First, it is unclear how much of the CoT meets the definition of task-grounded

From Faulty Claims to Incorrect Patches: An Empirical Study of Task-Grounded Reasoning in Coding Agents

3

reasoning and how often faulty claims occur in it, which determines whether the CoT offers a basis for diagnosis at all. Second, even if they do occur, it is unclear whether they are actually linked to a patch’s defects, since CoT is not necessarily a faithful account of what a model computes [3, 39]. Answering these questions reveals whether the extensive reasoning that agents produce can help explain and repair their failures.

This paper presents the first empirical study of task-grounded reasoning in coding agents. We analyze 400 trajectories of four open-weight reasoning models from two model families, running in mini-swe-agent on 100 instances of SWE-bench Pro, and address three research questions:

• RQ1: How much of the reasoning of coding agents is task-grounded, and which aspects of the task do its claims describe?

• RQ2: How common are faulty claims, what do they get wrong, and how do they relate to the outcome of a task?

• RQ3: How many incorrect patches trace back to faulty claims, and does correcting these claims repair the patches?

For RQ1, an LLM extracts the reasoning units from the CoT of each step and classifies them into four types. For RQ2, an LLM-based assessment agent gathers evidence from the original repository and library documentation to judge each unit as supported, refuted, or unresolved. The refuted units are the faulty claims. We manually check samples of both steps to estimate their accuracy. For RQ3, we locate the concrete defects of each incorrect patch via corrective edits that make it pass the validation tests while meeting the task requirements, search for faulty claims in the reasoning that these defects trace back to, and replay the trajectory with such a claim corrected right before submission to check whether the agent fixes the linked defect.

Our study leads to the following key findings:

  • Task-grounded reasoning covers only 18.5% of the CoT tokens, yet amounts to 191 checkable claims per trajectory. Newer models make about twice as many claims as their predecessors.

  • At least 9.6% of the claims are faulty, and 97.8% of the trajectories contain at least one. Agents understand the task better than the code: 5.5% of the claims about the requirements are faulty, versus 13.5% about the original implementation and 14.7% about fix mechanisms. Rather than referring to nonexistent APIs or code, most faulty claims misstate how existing code behaves.

  • The number of faulty claims is a weak indicator of failure: 96.7% of the resolved trajectories also contain faulty claims, which often do no harm because the agent recovers from them or its patch does not depend on them. Yet some faulty claims leave defects that the validation tests miss, yielding plausible but incorrect patches.

  • Two-thirds of the incorrect patches (127 of 188) trace back to faulty claims, yet these claims account for only about one in 26 faulty claims in the failed trajectories. Correcting such a claim causes the agent to fix the linked defect in 89.0% of cases with a small revision, though only 11.5% resolve the task, as other defects remain or the tests miss the fixed behavior.

These findings show that faulty claims are a substantial cause of incorrect patches, but their mere presence is a weak signal of failure. Precise diagnosis of failed trajectories thus calls for failure attribution tools that establish accurate causal links between faulty claims and patch defects.

In summary, this paper contributes the following:

• Methodology. A claim-level methodology that combines LLM-based extraction and assessment of task-grounded reasoning with a manual tracing of patch defects to faulty claims, whose links are confirmed by claim-corrected trajectory replays.

• Empirical study. The first empirical study of task-grounded reasoning and its faulty claims across four reasoning models, from their prevalence to the patch defects they cause.

• Implications. Insights for using the reasoning of coding agents to diagnose, prioritize, and repair their failures, both at runtime and during training.

You Wang, Jinjun Huang, Zhonghao Jiang, Jialun Cao, Jiachi Chen, and Zhongxin Liu

Table 1. Overview of the collected trajectories.

ModelRelease DateResolvedTotal StepsTotal Reasoning Tokens
DeepSeek-V3.22025-12-0143/100 (43.0%)8,8341,219,334
DeepSeek-V4.1-Flash2026-09-1064/100 (64.0%)6,8254,616,470
Qwen3.6-27B2026-04-2244/100 (44.0%)5,440887,232
Qwen3.8-27B2026-08-1461/100 (61.0%)6,9023,190,453

References (29)