Papers

五种代码表示工作流如何影响 Claude Code 智能体表现

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

Why we picked it

这篇论文用 Claude Code 实测了语法树、调用图等五种代码地图,发现主要价值在省 token,定位类任务最多省 39%,写补丁类就没啥优势了。

arXiv 论文将代码表示方式作为智能体软件工程的设计变量,测试了抽象语法树、调用图、模块依赖、文档增强搜索和混合五种工作流。实验用 Claude Code 搭配 Haiku 4.5,在 LinuxFLBench、SWE-bench Pro、SWT-bench、SecBench 四个基准上与原始工具基线对比。LinuxFLBench 上五种工作流 recall@10 从基线 0.717 提升到 0.757-0.829,token 用量降低 25-39%。SWE-bench Pro 上解决率基本持平(44.3-50.6% vs 49.0%),token 仍下降 17-26%,但所有工作流都增加了延迟。结论是这类地图式表示主要在定位是瓶颈时省 token,收益因任务而异。

Original · arXiv cs.AI

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

LLM agents are increasingly used for repository-level software engineering tasks. 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 a 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. 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%. 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.