Skip to content

Improve init performance for large multi-module monorepos (20k+ files): support incremental/layered and parallel initialization #1449

Description

@Evolnoob

CodeGraph: v1.5.0 (latest, installed via npm i -g @colbymchenry/codegraph@latest)

Platform: [Windows]

I'm working with a large-scale multi-module codebase containing over 20,000 files (multiple languages, deeply nested directory structure). When running codegraph init (or codegraph init -i), the process experiences severe performance issues:

Extremely slow initialization – it takes an exceptionally long time to complete.

Frequent timeouts / freezing – the process often hangs indefinitely and eventually times out, especially when called via MCP clients (e.g., Claude Code) that have a default handshake timeout (~30s).

Unstable subsequent commands – even if init eventually finishes after a very long wait, subsequent ref (references) commands sometimes fail or return incomplete results, presumably due to incomplete/corrupted indexing.

Expected Behavior
For a 20k+ file repository, initialization should ideally:

Complete within a reasonable timeframe (e.g., < 60 minutes).

Avoid blocking the main MCP handshake, or support a "background indexing" mode that returns a partial graph immediately and updates it progressively.

Provide clear progress feedback (per-module or per-directory) so users know it's still alive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions