AIToday
AI Coding AssistantsOpen-Source AIZenn AI/MLPublished: Nov 4, 2026, 06:00 JST

depgraph loads AI-written code into Neo4j to flag hidden debt

Send on LINE
depgraph loads AI-written code into Neo4j to flag hidden debt

3 Key Points

  1. What happened

    depgraph targets eight rules including unused-export, duplicate-code, import-cycle and god-package across Go, TypeScript, JavaScript and Python, and is a single cgo-free Go binary built on tree-sitter.

  2. Why it matters

    Existing linters only see inside a file or package, so debt left by AI agents that rewrite dozens of files a day slips past review, and depgraph checks the whole repository instead.

  3. What to watch

    The roadmap adds a local provider that starts an installed Neo4j as a child process, session-level time-series analysis of dependency growth, and an MCP server mode for direct graph queries.

WHO IT HITSThis lands on developers and reviewers running AI coding agents like Claude Code on repositories, who need to catch accumulating structural debt before it merges, and on teams that already operate Neo4j.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

The tool was built around a specific observation about AI coding agents: code they write compiles, type-checks, lints and passes tests, yet the repository gradually degrades. The patterns named are concrete — a function rewritten under a new name instead of being searched for, exports orphaned mid-refactor, lower layers importing upper ones, and a shared package everything depends on. None of these produce an error, because go vet, tsc --noUnusedLocals and eslint look inside a single file or package.

Choosing a graph database follows from the shape of the problem. Dependencies are nodes and relationships, so the rules become queries; the god-package rule, for instance, adds a condition that the package also depends on three or more in-repo packages, so stable domain models that many packages import but that import nothing are not flagged. The cycle rule was rewritten from enumerating all cycles of length 2 to 8, whose runtime grows exponentially on dense graphs, to finding one shortest return path per import edge, and the new query was checked against the old one on 25 random graphs.

Two design choices show how the tool is meant to be used. Neo4j is started and torn down by depgraph itself, with a watchdog child process that removes the container whether the parent exits normally, panics, or is killed with SIGKILL; integration tests verify this on real container runtimes in CI on both Docker and Podman. And through claude-hook-gate, depgraph fails a session that added findings compared with the session-start baseline, so an agent cannot finish while it has increased debt. The author reports that scanning depgraph's own repository surfaced a genuine duplicate between the import-resolution and parsing layers, which was extracted into a shared package.

FAQ
Do I need to install Neo4j to use depgraph?
No. depgraph starts Neo4j in a container itself, using Docker, Podman or nerdctl, and cleans it up on exit even after a crash or SIGKILL. If you already run Neo4j, setting NEO4J_URI makes depgraph connect without starting or deleting anything.
What is the difference from Serena MCP?
Serena gives an agent tools to search and edit code symbol by symbol through a language server. depgraph instead inspects the result of the agent's work for debt across the whole repository, and the two are meant to be used together.
How does it handle false positives?
depgraph treats false positives as bugs, so it collects many entry-point signals such as package.json bin, Next.js app/, Django models.py and dynamic imports. Anything still missed can be marked with a // depgraph:entry comment or entries in .depgraph.yml.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleDeepMind staff push to scrap lifetime non-disparagement clauses