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

에이전트는 코드를 어떻게 보아야 하는가? 에이전트 기반 소프트웨어 공학을 위한 코드 표현 재고

Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati · arXiv · 2026년 11월 5일

- **연구 문제** LLM 에이전트가 저장소에서 코드를 찾을 때 원시 파일과 검색 명령에 의존하면 탐색 비용이 커지며, 코드 표현 방식이 성능과 비용에 주는 영향은 체계적으로 비교되지 않았습니다.
- **연구 방법** AST, 호출 그래프, 의존 그래프, 문서 검색, 이들의 Hybrid 맵을 MCP 도구로 노출하고, 같은 Claude Code와 Haiku 4.5 스택에서 MCP 없는 baseline과 비교합니다.
- **주요 결과** fault localization에서는 다섯 워크플로우가 recall@10을 높이고 토큰을 줄였으며, program repair에서는 토큰을 줄이면서 resolution을 대체로 유지했습니다. SecBench에서는 Callgraph가 패치 해결률을 높였고, SWT-bench에서는 성공 차이가 작고 토큰 사용이 늘었습니다.

## 저장소 탐색 비용의 문제

LLM 에이전트는 저장소 수준의 소프트웨어 공학 과제를 수행할 때 먼저 올바른 코드 맥락을 찾아야 합니다. 그러나 대부분의 에이전트는 원시 파일, 어휘 검색, 셸 명령을 통해 저장소에 접근하며 코드를 주로 텍스트로 다룹니다. 이 방식은 유연하지만 정의 위치, 호출자, 모듈 의존 관계를 알아내기 위해 같은 파일을 반복해서 검색하고 읽어야 하는 부담을 남깁니다.

이 논문은 코드 표현을 에이전트 워크플로우의 설계 변수로 보고, 같은 에이전트 스택에서 저장소 뷰가 검색 행동, 과제 성공, 토큰 사용량, 지연 시간을 어떻게 바꾸는지 비교합니다. 비교 대상은 추상 구문 트리(AST), 호출 그래프(Callgraph), 의존 그래프(Deps), 문서 기반 검색(Docs), 이들을 결합한 Hybrid입니다. 각 표현은 에이전트가 과제 도중 질의할 수 있는 온디맨드 저장소 맵으로 노출됩니다.

![Figure 1: Overview of the proposed study](https://refivu.com/papers/a030cfdc-f4fa-4334-a174-8b6cfc1a2460/figures/figure-1e1be0389b7a0e48093317eb8574fdb9.png?thumb=512)

**Fig. 1** : Overview of the proposed study.

[원문](https://arxiv.org/abs/2611.07286v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati · How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering · 원문 그림 인용 · 원본 PDF 2쪽에서 그림 영역을 추출했습니다.

## 다섯 가지 코드 표현과 MCP 서버 구현

AST 서버는 파일에서 최상위 정의와 중첩 정의로 이어지는 포함 관계를 노드와 간선으로 나타냅니다. Callgraph는 함수와 메서드를 노드로 두고 해석된 호출 관계를 caller에서 callee로 향하는 간선으로 둡니다. Deps는 파일을 노드로 두고 import 관계를 간선으로 사용하며, Docs는 그래프 간선 없이 문서화된 심볼을 전문 검색으로 직접 순위화합니다. Hybrid는 호출 그래프와 의존 그래프를 하나의 맵으로 합치고 포함, 호출, import 간선을 함께 둡니다.

![TABLE I: MCP tools exposed for each code-representation.](https://refivu.com/papers/a030cfdc-f4fa-4334-a174-8b6cfc1a2460/figures/figure-649b76ecf2fbca1965739de6371f287b.png?thumb=512)

**원문 그림** TABLE I: MCP tools exposed for each code-representation.

[원문](https://arxiv.org/abs/2611.07286v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati · How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering · 원문 그림 인용 · 원본 PDF 3쪽에서 그림 영역을 추출했습니다.

모든 서버는 실행 전에 저장소를 tree-sitter로 파싱하고 SQLite FTS5 인덱스에 저장합니다. 질의 과정에서는 먼저 BM25로 seed 노드를 찾고, 구조적 서버는 이를 그래프 관계로 확장한 뒤 random-walk-with-restart 중심성으로 이웃을 순위화합니다. Docs 서버는 확장 단계를 건너뛰고 BM25 순위의 문서화된 심볼을 직접 반환합니다. 모든 서버는 explore와 node라는 공통 진입점을 제공하며, 에이전트는 Claude Code에서 이 도구들을 필요할 때 직접 호출합니다.

## 실험 설정과 과제별 지표

실험은 같은 Claude Code 스택과 claude-haiku-4-5 설정에서 MCP 표현을 붙이지 않은 baseline과 다섯 표현 워크플로우를 비교합니다. baseline은 파일 읽기와 쓰기, glob, grep, 셸 실행 같은 기본 도구만 사용하므로 저장소 구조를 일반 소스 탐색으로 추론해야 합니다. 평가 과제는 LinuxFLBench의 fault localization, SWE-bench Pro의 program repair, SWT-bench의 test generation, SecBench의 security patching이며, 샘플 수는 각각 152, 253, 161, 166개입니다.

지표는 과제마다 다릅니다. fault localization은 상위 10개 예측에 정답 파일이 있는지 보는 recall@k이고, program repair는 숨겨진 테스트를 통과하는 resolution rate, test generation은 버그 버전에서 실패하고 수정 후 통과하는 reproducing-test rate, security patching은 harness가 수용하는 patch-resolution rate입니다. 비용은 전체 토큰 사용량과 wall-clock time으로 측정됩니다. 샘플은 무작위 시드로 정해졌고 같은 task ID를 모든 워크플로우에 사용하며, 각 인스턴스는 워크플로우당 한 번씩 실행됩니다(k=1).

![TABLE II: Benchmarks and task-success metrics used in our evaluation.](https://refivu.com/papers/a030cfdc-f4fa-4334-a174-8b6cfc1a2460/figures/figure-24035c22fcf3db7c23163d5ffc5d4831.png?thumb=512)

**원문 그림** TABLE II: Benchmarks and task-success metrics used in our evaluation.

[원문](https://arxiv.org/abs/2611.07286v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati · How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.

## 과제별 결과: 위치 찾기에서의 이득과 패치·테스트에서의 제한

LinuxFLBench에서 다섯 워크플로우는 모두 baseline의 recall@10 0.717을 넘었고, 값은 0.757에서 0.829 사이였습니다. Hybrid가 0.829로 가장 높았으며, 평균 토큰 사용량은 baseline보다 25에서 39퍼센트 줄었습니다. 다만 wall time은 늘었습니다. 이 결과는 representation이 토큰 절감에 기여하면서도 후보 목록의 상위 10개를 개선한다는 관찰로 읽어야 합니다.

![TABLE III: LinuxFLBench: file-localization recall and behavior/cost metrics per workflow](https://refivu.com/papers/a030cfdc-f4fa-4334-a174-8b6cfc1a2460/figures/figure-2dc18ad1e5c0175712614922425272db.png?thumb=512)

**원문 그림** TABLE III: LinuxFLBench: file-localization recall and behavior/cost metrics per workflow

[원문](https://arxiv.org/abs/2611.07286v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati · How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.

SWE-bench Pro에서는 토큰 사용량이 17에서 26퍼센트 줄었지만 resolution rate는 44.3에서 50.6퍼센트로 baseline 49.0퍼센트 근처에 머물렀습니다. SecBench에서는 Callgraph가 34.3퍼센트의 patch-resolution rate로 baseline의 28.9퍼센트보다 높았고 토큰 사용량도 614K로 baseline의 684K보다 낮았습니다. 반면 SWT-bench에서 Hybrid와 Docs는 reproducing-test rate 47.8퍼센트와 47.2퍼센트로 baseline 44.7퍼센트보다 높았지만, 모든 워크플로우가 더 많은 토큰을 사용했습니다.

이 차이는 작아서 k=1 실행의 변동일 수 있습니다.

![TABLE IV: SWE-bench Pro: patch-resolution rate and behavior/cost metrics per workflow.](https://refivu.com/papers/a030cfdc-f4fa-4334-a174-8b6cfc1a2460/figures/figure-937e8af133dd86410f873d4e5181c2fd.png?thumb=512)

**원문 그림** TABLE IV: SWE-bench Pro: patch-resolution rate and behavior/cost metrics per workflow.

[원문](https://arxiv.org/abs/2611.07286v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati · How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.

![TABLE V: SWT-bench: reproducing-test rate and behavior/cost metrics per workflow.](https://refivu.com/papers/a030cfdc-f4fa-4334-a174-8b6cfc1a2460/figures/figure-e7d9fa54e23d699e20d42a2d1fb7752f.png?thumb=512)

**원문 그림** TABLE V: SWT-bench: reproducing-test rate and behavior/cost metrics per workflow.

[원문](https://arxiv.org/abs/2611.07286v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati · How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.

![TABLE VI: SecBench: security-patch resolution rate and behavior/cost metrics per workflow.](https://refivu.com/papers/a030cfdc-f4fa-4334-a174-8b6cfc1a2460/figures/figure-ca18470551a4ba005c7ef0fb1603bbc7.png?thumb=512)

**원문 그림** TABLE VI: SecBench: security-patch resolution rate and behavior/cost metrics per workflow.

[원문](https://arxiv.org/abs/2611.07286v1) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati · How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.

## 궤적 분석이 밝힌 이득과 오버헤드의 원인

RQ2의 궤적 분석은 baseline과 representation이 갈린 인스턴스를 읽어 원인을 분류합니다. LinuxFLBench에서는 맵이 관련 소스 본문을 인라인으로 반환해 에이전트가 원본 파일을 덜 읽는 read displacement가 토큰 절감의 주된 원인으로 나타났습니다. 반대로 쉬운 과제에서 맵 호출이 추가로 쌓이는 map overhead는 토큰을 늘리는 주요 원인이었습니다.

성능 측면에서 AST와 Callgraph는 각각 이름이 명시된 파일 내부 결함과 호출로 연결된 교차 파일 결함에서 이득을 보였습니다. Callgraph는 SecBench에서 스택 트레이스의 호출 경로를 따라 수정 지점으로 이어지는 흐름 위치 찾기에서 이득을 보였지만, 원문은 이것이 Callgraph의 보편적 우월성을 뜻하지 않는다고 제한합니다. SWE-bench Pro와 SWT-bench의 실패는 상당 부분 패치나 테스트 작성 단계의 정답 위치 찾기 이후 실패였으며, 이 분석은 저자들이 궤적 패턴으로 해석한 결과입니다.

## 해석 범위와 한계

저자들은 agent 실행이 완전히 결정적이지 않으므로 같은 모델과 프롬프트도 다른 경로와 패치를 낼 수 있다고 밝힙니다. 또한 representation 워크플로우는 usage steering과 repair의 pre-tool-use hook을 함께 사용하므로, 측정된 행동 변화 전체를 데이터 구조만의 효과로 볼 수 없습니다. 실험은 하나의 주 에이전트 스택과 네 개의 저장소 수준 벤치마크에 한정되므로 다른 모델, 에이전트, 언어, 저장소에 그대로 일반화할 수 없습니다.

지표 측면에서도 벤치마크 성공률은 패치 품질이나 개발자의 실제 유용성을 완전히 포착하지 않습니다. 토큰과 도구 호출 수는 맵 구축, 로컬 계산, 설정, 채점 같은 비용을 빼고 있습니다. 또한 샘플별 실행이 한 번씩이므로 SWT-bench와 SecBench의 작은 성공 차이는 일회성 생성 변동을 반영할 수 있습니다.

## 논문 정보

- **저자**: Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2026년 11월 5일
- **등록일**: 2026년 11월 6일
- **수정일**: 2026년 11월 5일
- **버전**: v1
- **arXiv**: 2611.07286
- **분류**: cs.SE · cs.AI
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2611.07286v1) · [원문 PDF ↗](https://arxiv.org/pdf/2611.07286v1)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

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.

## 원문 인용

Melika Sepidband, Jiho Shin, Song Wang, Hadi Hemmati (2026). How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering. arXiv:2611.07286v1. https://arxiv.org/abs/2611.07286v1

**BibTeX**

```
@misc{sepidband2026should,
  title = {{How Should Agents See Code? Rethinking Code Representations for Agentic Software Engineering}},
  author = {Melika Sepidband and Jiho Shin and Song Wang and Hadi Hemmati},
  year = {2026},
  eprint = {2611.07286},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.07286v1}
}
```

## 이 논문의 용어

- [BM25](https://refivu.com/terms/64437f95755a-bm25)
- [Claude Code](https://refivu.com/terms/140ee6d8eb01-claude-code)
- [Model Context Protocol](https://refivu.com/terms/ea3bda424741-model-context-protocol)
- [recall@10](https://refivu.com/terms/c6b52eb76739-recall-10)
- [SWE-bench Pro](https://refivu.com/terms/0dcbb0cff5a3-swe-bench-pro)
- [Hybrid](https://refivu.com/terms/1ec5604a4f0d-hybrid)
- [Abstract syntax tree](https://refivu.com/terms/10d0e8dd6559-abstract-syntax-tree)
- [fault localization](https://refivu.com/terms/29a460e52acd-fault-localization)
- [Program repair](https://refivu.com/terms/6f6f52e65e18-program-repair)
- [wall-clock time](https://refivu.com/terms/baa16792d227-wall-clock-time)

## 다른 논문 해설

- [More Agents, More Reliable? System-Level Reliability of Multi-Agent LLMs under Operational-Profile Uncertainty](https://refivu.com/papers/7fe8b88e-f386-49bf-8e3c-4db4c1641a1b-more-agents-more-reliable-system-level-reliability-of.md)
- [τ-bench-LILT: Evaluating Conversational Agents on Realistic Multilingual Tool-Use Tasks](https://refivu.com/papers/18631827-6e8d-44e8-9d01-74fdd2e225df-bench-lilt-evaluating-conversational-agents-on-realistic.md)
- [Multi-step SWE: Can Coding Agents Keep Building on Their Own Code Over Long Horizons?](https://refivu.com/papers/511fe30c-d341-4cb6-8e73-d0dbbbec3008-multi-step-swe-can-coding-agents-keep-building.md)
- [Autonomous AI Agents Systematically Diverge From Human Preferences in Proof Formalization](https://refivu.com/papers/0667f312-1b91-4e84-840b-2ee875dac6ae-autonomous-ai-agents-systematically-diverge-from-human.md)
- [Global Convergence of Localized Policy Iteration in Networked Multi-Agent Reinforcement Learning](https://refivu.com/papers/21d4d9a9-fbce-4002-a711-7e5b8c2e327d-global-convergence-of-localized-policy-iteration-in.md)
- [Effective control of two-dimensional Rayleigh--Bénard convection: invariant multi-agent reinforcement learning is all you need](https://refivu.com/papers/8c115337-dd73-4ba8-8cd4-a40d43d59b37-effective-control-of-two-dimensional-rayleigh-benard.md)
- [Efficient Closure Learning in Dynamical Systems: A Comparison of Data-Assimilated and Embedded Approaches](https://refivu.com/papers/1111e81a-ea62-4c7c-95b6-311134d3988f-efficient-closure-learning-in-dynamical-systems-a-comparison.md)
- [Backbone-Informed Adaptation after EEG Pretraining: A Capacity-Controlled Study](https://refivu.com/papers/31570445-e4b4-4d33-a465-7ec7f9b97789-backbone-informed-adaptation-after-eeg-pretraining-a.md)
- [Reweighting is not Harmless: Understanding the Role of Dataset Characteristics](https://refivu.com/papers/71263ac3-7fa7-4051-8ca5-dad7bde65ff6-reweighting-is-not-harmless-understanding-the-role-of.md)
- [Synthesizing symbolic models of human and machine reasoning at scale](https://refivu.com/papers/7b1b6913-eebf-4257-98a8-11e51ae19376-synthesizing-symbolic-models-of-human-and-machine-reasoning.md)
- [Recursive Sparse Attention: Million-Token Length Extrapolation at Logarithmic Cost](https://refivu.com/papers/52b7aea9-2772-4644-a4cb-a6d6ac47343e-recursive-sparse-attention-million-token-length.md)
- [Structured Visual Landscape: Generating Preferred Representations in Biological and Artificial Neural Networks](https://refivu.com/papers/8bf36892-81fc-4fd2-881e-ba96fef719f1-structured-visual-landscape-generating-preferred.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/a030cfdc-f4fa-4334-a174-8b6cfc1a2460-how-should-agents-see-code-rethinking-code-representations)
