Precedent or Intent? What Coding Agents Follow When Evolving Existing Code
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Existing code reveals past implementation decisions but rarely explains the reasoning behind them. When coding agents implement new features or modify existing functionality, past decisions may conflict with new task instructions. This raises a fundamental question for agentic software evolution: when multiple implementations satisfy the same functional requirements, how do coding agents decide whether to follow existing code or new task instructions? We investigate this question through bidirectional, controlled experiments in purpose-built repositories, followed by validation in real-world open-source repositories. Our approach isolates three competing sources of guidance: (1) agents' default preferences, (2) repository precedents, and (3) explicit task instructions. We conduct 5,625 trials across four coding agents and six implementation pairs, with validation in four open-source repositories spanning three programming languages. We find that agents share the same default implementation choices, yet overwhelmingly follow repository precedent when it conflicts with those defaults (359/360 trials). Crucially, not all precedents carry equal influence: three supporting local files yield 96% adoption, compared with only 4% for sibling-resource files, and changing file placement alone can shift adoption from 0% to 100% at a fixed example count. When new task intent conflicts with existing code, written priority rules achieve substantially higher success than code examples alone (59/60 versus 38/60 joint successes for two agents on two implementation pairs). The effectiveness of explicit rules also extends to open-source repositories, where a harness-loaded rule raises joint success from 0/120 to 117/120. These findings motivate design-decision traceability that preserves not only implementation choices but also the rationale and priorities that should guide future changes.
Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 26 of its 37 references that are in the map. Submitted 28 Oct 2026.
Builds on
26 of 37 references.
Closest ancestors · 4
Same direction, newest first
- 2026Evaluating AGENTS.md: Are Repository-Level Context Files Helpful for Coding Agents?12 Feb
- 2026Comparing AI Coding Agents: A Task-Stratified Analysis of Pull Request Acceptance9 Feb
- 2025SWE-EVO: Benchmarking Coding Agents in Long-Horizon Software Evolution Scenarios20 Dec
- 2024OpenHands: An Open Platform for AI Software Developers as Generalist Agents23 Jul
Other references · 22
- 2021Evaluating Large Language Models Trained on Codecited by 8,938
- 2021Program Synthesis with Large Language Modelscited by 3,972
- 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,871
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,765
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,457
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,181
- 2024The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructionscited by 568
- 2023Adaptive Chameleon or Stubborn Sloth: Revealing the Behavior of Large Language Models in Knowledge Conflictscited by 410
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 387
- 2024Knowledge Conflicts for LLMs: A Surveycited by 320
- 2023CrossCodeEval: A Diverse and Multilingual Benchmark for Cross-File Code Completioncited by 193
- 2023CodePlan: Repository-level Coding using LLMs and Planningcited by 152
10 more
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 108
- 2023Mitigating Label Biases for In-context Learningcited by 98
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 59
- 2014Learning Natural Coding Conventionscited by 30
- 2025A Study of LLMs' Preferences for Libraries and Programming Languagescited by 23
- 2024Beyond Functional Correctness: Investigating Coding Style Inconsistencies in Large Language Modelscited by 17
- 2026SWE-Milestone: Evaluating AI Agents on Continuous Software Evolutioncited by 17
- 2025aiXcoder-7B-v2: Training LLMs to Fully Utilize the Long Context in Repository-level Code Completioncited by 10
- 2023A Qualitative Study on the Implementation Design Decisions of Developerscited by 8
- 2021Extracting Rationale for Open Source Software Development Decisions -- A Study of Python Email Archivescited by 3
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2026Self-Evolving Coding Agents
- 2026Agentic Coding Needs Proactivity, Not Just Autonomy
- 2026Coding Agents Don't Know When to Act
- 2026Do Coding Agents Reuse Existing Code or Reinvent the Wheel?
- 2026Govern the Repository, Not the Agent: Measuring Ecosystem-Level Risk in AI-Native Software
- 2025A Study of Library Usage in Agent-Authored Pull Requests
- 2026AI IDEs or Autonomous Agents? Measuring the Impact of Coding Agents on Software Development
- 2026How Do Developers Maintain and Evolve Their Agents' Instructions? An Empirical Study