SWE-Adept: An LLM-Based Agentic Framework for Deep Codebase Analysis and Structured Issue Resolution
Organizations: Electrical and Computer Engineering, Purdue University
Abstract
Large language models (LLMs) exhibit strong performance on self-contained programming tasks. However, they still struggle with repository-level software engineering (SWE), which demands (1) deep codebase navigation with effective context management for accurate localization, and (2) systematic approaches for iterative, test-driven code modification to resolve issues. To address these challenges, we propose SWE-Adept, an LLM-based two-agent framework where a localization agent identifies issue-relevant code locations and a resolution agent implements the corresponding fixes. For issue localization, we introduce agent-directed depth-first search that selectively traverses code dependencies. This minimizes issue-irrelevant content in the agent's context window and improves localization accuracy. For issue resolution, we employ adaptive planning and structured problem solving. We equip the agent with specialized tools for progress tracking and Git-based version control. These tools interface with a shared working memory that stores code-state checkpoints indexed by execution steps, facilitating precise checkpoint retrieval. This design enables reliable agent-driven version-control operations for systematic issue resolution, including branching to explore alternative solutions and reverting failed edits. Experiments on SWE-Bench Lite and SWE-Bench Pro demonstrate that SWE-Adept consistently outperforms prior approaches in both issue localization and resolution, improving the end-to-end resolve rate by up to 4.3%.
Figures & tables
| Framework | Model | SWE-Bench Lite | SWE-Bench Pro | ||||
| File Acc@3 | Func Acc@5 | # Tokens | File Acc@3 | Func Acc@5 | # Tokens | ||
| Embedding | CodeSage-Large | 71.2% | 40.1% | N/A | 54.0% | 26.5% | N/A |
| Embedding | CodeRankEmbed | 76.6% | 50.0% | N/A | 61.0% | 33.0% | N/A |
| SWE-agent | GPT-5.2 | 84.3% | 60.0% | 78k | 71.0% | 37.8% | 125k |
| Claude-4.5 | 90.5% | 78.6% | 298k | 78.0% | 55.0% | 340k | |
| RepoGraph | GPT-5.2 | 86.8% | 60.6% | 150k | 71.5% | 40.0% | 272k |
| Framework | Model | SWE-Bench Lite | SWE-Bench Pro | ||
| Resolve Rate | # Tokens | Resolve Rate | # Tokens | ||
| SWE-agent | GPT-5.2 | 52.5% | 260k | 30.3% | 338k |
| Claude-4.5 | 66.0% | 2640k | 39.5% | 3320k | |
| RepoGraph | GPT-5.2 | 50.3% | 272k | 30.0% | 431k |
| Claude-4.5 | 66.2% | 2968k | 38.0% | 3815k | |
| OpenHands | GPT-5.2 | 51.5% | 275k | 29.5% | 365k |
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
| Framework | Model | Python | JavaScript | Go | TypeScript | ||||
| Localize | Resolve | Localize | Resolve | Localize | Resolve | Localize | Resolve | ||
| SWE-agent | GPT-5.2 | 43.3% | 38.3% | 40.0% | 29.2% | 30.8% | 24.2% | 35.0% | 27.5% |
| Claude-4.5 | 61.7% | 51.7% | 54.2% | 37.5% | 50.8% | 30.8% | 50.0% | 35.0% | |
| OrcaLoca | GPT-5.2 | 50.0% | 42.5% | 45.8% | 34.2% | 34.2% | 25.0% | 40.0% | 30.0% |
| Claude-4.5 | 64.2% | 53.3% | 56.7% | 40.0% | 53.3% | 31.7% | 52.5% | 37.5% | |
| SWE-Adept | GPT-5.2 | 55.0% | 48.3% | 47.5% | 37.5% | 36.7% | 26.7% | 42.5% | 40.0% |
| Framework | SWE-Bench Lite | SWE-Bench Pro |
| SWE-agent | 66.0% | 39.5% |
| SWE-Adept | 71.3% | 45.0% |
| - w/o designed issue localization | 69.0% | 43.3% |
| - w/o designed issue resolution | 68.7% | 41.5% |
| SWE-Bench Lite | SWE-Bench Pro | |||
| Func Acc@5 | # Tokens | Func Acc@5 | # Tokens | |
| • GPT-5.2 | ||||
| Search returns full code content | 69.3% | 218k | 45.0% | 316k |
| Search returns code preview + specialized filtering | 70.8% | 197k | 46.0% | 252k |
| • Claude-Sonnet-4.5 | ||||
| Search returns full code content | 87.2% | 393k | 62.0% | 502k |
| Framework | SWE-Bench Lite | SWE-Bench Pro |
| SWE-agent | 66.0% | 39.5% |
| SWE-agent + raw Git commands (prompted) | 67.0% | 37.0% |
| SWE-Adept | 71.3% | 45.0% |
| SWE-Adept + raw Git commands (no hypothesis_git , no memory) | 69.0% | 41.5% |
| Framework | SWE-Bench Lite | SWE-Bench Pro | ||
| Localize | Resolve | Localize | Resolve | |
| mini-SWE-Agent | 75.9% | 64.2% | 50.5% | 36.8% |
| Claude Code | 85.4% | 70.2% | 59.5% | 42.5% |
| SWE-Adept | 87.8% | 71.3% | 63.3% | 45.0% |
| Framework | Model | SWE-Bench Lite | SWE-Bench Pro | ||
| Localize | Resolve | Localize | Resolve | ||
| SWE-agent | GLM-4.7-Flash (30B) | 55.5% | 43.3% | 35.0% | 26.5% |
| SWE-agent | Qwen3.5-27B | 67.3% | 56.8% | 43.5% | 33.8% |
| SWE-Adept | GLM-4.7-Flash (30B) | 63.3% | 48.2% | 42.0% | 30.3% |
| SWE-Adept | Qwen3.5-27B | 75.4% | 62.7% | 51.0% | 38.3% |
| Tool | Description | Input Parameters | Output (Agent Observation) |
| find_file | Search file by exact file-name or glob pattern. Enumerate files within codebase (optionally restricted to a specified directory). | file_name † dir_path ‡ | Matched file paths; for each file, a skeleton listing the signatures of classes and functions defined in that file. |
| find_code_def | Search class/function definition via exact matching, with fallback to regex matching and fuzzy matching ranked by a weighted sum of character-level similarity metrics (n-gram, Jaro–Winkler distance, and longest common subsequence). Enumerate indexed code units (optionally restricted to a file). | definition_name † file_path ‡ | Ranked retrieved code definitions with file path, line span, child-unit identifiers, and a concise code preview (definition signature + child-unit invocation context). |
| find_code_content | Search variable name (robust to camel-case/snake-case variants) or an exact code snippet . Enumerate code lines (optionally restricted to a file or a line span). | content † file_path ‡ start_line ‡ end_line ‡ | Retrieved matches, each associated to a containing code unit (function/class/code chunk), with the unit name, file path, line span, child-unit identifiers, and a concise code preview (unit signature + matched lines). |
| find_child_unit | Search class/function definition via exact matching given its name and file path (specified by a child-unit identifier). Enumerate indexed code units restricted to a file. | definition_name † file_path † | Exact-match class/function definition with file path, line span, child-unit identifiers, and a concise code preview (definition signature + child-unit invocation context). |
| finish_search | Signal completion of the search and trigger subsequent filtering/ranking over the collected candidates. | None | None |
| Tool Family | Command (CLI-Based) | Description | Output (Agent Observation) |
| hypothesis_plan | update_hypothesis – hypotheses_markdown | • Create, progress-track, and update hypotheses (i.e., alternative solutions) sorted by agent-estimated confidence, and annotate with status tags: [ ] (pending) [-] (in-progress) [v] (successful) [!] (failed) Support dynamic expansion for adaptive planning. • Store each hypothesis’s content and status in working memory. | Hypothesis overview with current status and ordering. |
| update_todo – current_hypothesis – todos_markdown | • Create, progress-track and update a to-do list for the current hypothesis, and annotate with status tags: [ ] (pending) [-] (in-progress) [v] (successful) [!] (failed) Support dynamic expansion for adaptive planning. • Store each to-do’s content and status in working memory. | Hypothesis-corresponded to-do list with current status. | |
| log_insight – insight | • Generate insights for the current hypothesis based on execution feedback, which inform reflection-driven actions (e.g., revert) and final cross-hypothesis comparison. • Store the insights in working memory. | Insights attached to the current hypothesis. |
| Tool Family | Command (CLI-Based) | Description | Output (Agent Observation) |
| hypothesis_git | init_base (internally executes) git config git rev-parse HEAD git add -A git commit -m git rev-parse HEAD | • Obtain the Git hashes of (i) the original code state and (ii) a shared common working base git_hash_base (including issue reproduction code) for subsequent hypothesis branches. • Store the Git hashes in working memory. | Confirmation of saved original code state and common working base. |
| start_hypothesis – branch_name (internally executes) git stash push -m git checkout git checkout -b | • Checkout a new hypothesis branch from the common working base. • Retrieve the Git hash of the common working base from working memory. • Store the branch name for the corresponding hypothesis in working memory. | Confirmation of branch creation and checkout; workspace moves to the hypothesis branch. | |
| commit_todo – todo_content – commit_message (internally executes) git add -A git commit -m git rev-parse HEAD | • Commit code changes for one completed to-do step and obtain its checkpoint metadata (Git hash and commit message). • Store the Git hash and commit message for the corresponding to-do in working memory. | Confirmation of to-do commit. | |
| revert_to – source_hypothesis – source_todo – new_branch_name (internally executes) git stash push -m git checkout git checkout -b | • Checkout the specified to-do checkpoint and create a new branch from that state, then switch the workspace to the new branch and continue exploration under the new hypothesis branch. • Retrieve the Git hash of the specified to-do from working memory. • Store the new hypothesis’s branch name in working memory. | Confirmation of revert and new-branch creation. | |
| compare_hypotheses (internally executes) git diff --shortstat git diff --numstat | Retrieve records from working memory and compare implemented hypotheses. | Hypothesis comparison report - branch name - hypothesis content and status - to-dos content and status - commit messages - insights - code diff statistics (against the original state) | |
| merge_solution – branch_name (internally executes) git checkout --detach git merge | • Retrieve the selected hypothesis branch and the Git hash of the original code state from working memory. • Check out the original code state, then apply the selected branch’s changes to produce a clean, patch-ready state for submission. | Confirmation that changes are applied onto the original code state. |