#1539·SWE-agent

feat(tools): add optional CodeGraph tool bundle

Author: guaonCreated Sep 5, 2026Updated Sep 5, 2026

Describe the feature

Motivation

SWE-agent relies heavily on grep, file search, and repeated file reads when exploring unfamiliar repositories. This becomes expensive for large codebases where the agent needs to understand symbol relationships and change impact.

CodeGraph provides a local code graph with commands such as:

bash
codegraph init
codegraph explore "<query>"
codegraph callers <symbol>
codegraph impact <symbol>

Proposed feature

Add an optional tools/codegraph bundle that exposes CodeGraph CLI commands through SWE-agent's existing tool-bundle and function-calling mechanisms.

The bundle could provide:

  • codegraph_explore
  • codegraph_callers
  • codegraph_callees
  • codegraph_impact

The integration should:

  • remain opt-in;
  • avoid adding CodeGraph as a required dependency;
  • work with user-provided installations or container images;
  • initialize the index only after the repository is available;
  • fall back to existing bash and file tools if CodeGraph is unavailable;
  • include documentation and tests using a fake codegraph executable.

This should not require a native MCP client or changes to the agent control loop. Existing SWE-agent configurations must remain unchanged.

Potential Solutions

Feature request

Summary

Add an optional tool bundle for integrating CodeGraph with SWE-agent.

CodeGraph builds a local .codegraph/ index and provides structural repository queries such as symbol exploration, callers, callees, and change impact.

Example commands:

bash
codegraph init
codegraph explore "How does request validation reach the database layer?"
codegraph callers validate_request
codegraph callees validate_request
codegraph impact validate_request