arXiv:2611.07286cs.SENov 2026

Manuscript Offprint

arXiv:2611.07286

How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering

Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Melika Sepidband

York University

Toronto, Canada

melikasp@yorku.ca

Jiho Shin

York University

Toronto, Canada

shinjiho@yorku.ca

Song Wang

York University

Toronto, Canada

wangsong@yorku.ca

Hadi Hemmati

York University

Toronto, Canada

hemmati@yorku.ca

Abstract—LLM agents are increasingly used for repository-level software engineering tasks. These tasks require agents to retrieve the right code context before reasoning or editing. However, most agents still access repositories through raw files, lexical search, and shell commands, treating code primarily as text. This paper investigates map-based code-representation workflows as a design variable in agentic software engineering, examining how different repository views change agents' retrieval behavior, task success, token use, and latency.

In this paper, we study five code-representation workflows: abstract syntax trees, call graphs, module dependencies, documentation-enriched search, and a hybrid workflow that combines them. Each workflow exposes an on-demand repository map that the agent can query during a task. We evaluate Claude Code with Haiku 4.5 against a raw-tool baseline on four repository-level tasks: fault localization with LinuxFLBench, repository-level code generation and repair with SWE-bench Pro, test generation with SWT-bench, and security patching with SecBench. We measure task success together with representation-tool use, native tool use, token consumption, and wall-clock time.

The results show that representation workflows are most useful as token-saving tools when localization is the bottleneck, while their success gains narrow when the decisive step is patch or test authoring. On LinuxFLBench, all five workflows improve recall@10 over the baseline (0.757–0.829 vs. 0.717) and reduce token usage by 25–39%, but they also increase wall time. On SWE-bench Pro, resolution remains close to the baseline (44.3–50.6% vs. 49.0%) while token usage drops by 17–26%. On SecBench, Callgraph has the highest patch-resolution rate in this sample (34.3% vs. 28.9%) and uses fewer tokens, but all workflows increase latency. On SWT-bench, Hybrid and Docs have the highest reproducing-test rates in this sample (47.8% and 47.2% vs. 44.7%), but all workflows use more tokens and take longer. Overall, map-based workflows change both what the agent inspects and how much it spends, but their benefits are task-dependent rather than universal.

Index Terms—Agentic software engineering, Claude Code, Empirical study, Code representations

I. INTRODUCTION

LLM agents are increasingly used for repository-level software engineering (SE) tasks, such as fault localization, issue resolution, test generation, and security patching [1]–[3]. In these tasks, generating code is only one part of the process. The agent first needs to identify where the relevant behavior is implemented, which files and functions are related, and what evidence should be inspected before making a prediction or edit. If this localization step is weak, the agent may spend most of its budget reading irrelevant files or editing code that is only lexically related to the task.

Current coding agents, including Claude Code [4], SWE-agent [5], Agentless [6] and OpenHands [7], typically interact with repositories through lexical file search and shell-based exploration commands. This interface is flexible, but it gives the agent little structured information about the repository. For example, the agents may need to repeatedly search and read files to determine where a symbol is defined, which functions call it, which modules depend on it, or which documentation explains its intended behavior. These operations primarily serve to reconstruct the context required for the SE task.

Code representations naturally expose this context. Beyond source text, a repository can be viewed through abstract syntax trees, call graphs, dependency graphs, documentation linked to program symbols, or combinations of these views. Each view emphasizes different relations: abstract syntax trees expose definitions and containment; call graphs expose inter-procedural relationships; dependency graphs expose module-level coupling; and documentation connects natural-language descriptions to code intent. These views are commonly used in program analysis and code intelligence [8]–[12], but their role in LLM agent workflows remains poorly understood.

Prior work on SE agents has shown that repository navigation and context selection affect performance [5], [13]–[17]. However, representation is often bundled with the agent scaffold, retrieval method, or repair loop. This makes it difficult to determine whether an improvement comes from the model, the prompt, the agent policy, or the code view provided to the agent. As a result, we lack a systematic comparison of which representations help agents, for which tasks, and at what cost.

To bridge the gap, in this paper, we investigate how agents should access code representations during repository-level software engineering tasks. Figure 1 shows an overview of our study. We study four repository-level software engineering tasks that differ in the repository understanding they require: fault localization (finding the files or symbols responsible for a bug from its report), program repair (editing code across a repository to fix a reported problem), security patching (locating and repairing the code responsible for a vulnerability), and test generation (understanding the behavior to exercise and writing a test that captures it). We instantiate these tasks with established repository-level benchmarks: LinuxFLBench [18],

Figure

Fig. 1: Overview of the proposed study.

SWE-bench Pro [19], SecBench [20], and SWT-bench [21]. These tasks stress different bottlenecks: locating relevant code without editing, editing and validating a functional fix, repairing vulnerability-triggering behavior, and writing tests that expose a bug. We examine four representation families: abstract syntax trees (AST), call graphs (CG), dependency graphs (Deps), and documentation-enriched search (Docs). We also study a hybrid workflow that combines these four views in a single repository map. For our evaluation, we measure task success, tool-call behavior, token usage, wall-clock time, and per-instance trajectories.

Our central finding is that map-based representation workflows are most useful when the task bottleneck is finding relevant code. On fault localization, where the task is code search, they improve recall while cutting token usage, although they add latency. On program repair, the bottleneck is partly past localization, so they preserve resolution while reducing tokens by replacing repository browsing. On security patching, the strongest signal in this sample comes from Callgraph, which matches stack-centered prompts and exposes caller/callee context at lower token cost but higher latency. On test generation, where the decisive step is authoring a discriminating assertion, success changes are small, and several workflows add token overhead. Thus, the results support a task-dependent workflow claim rather than a universal claim that any fixed representation is better.

References (36)