M0X Docs
M0X Docs

Get Started

Quickstart GuideCore ConceptsAI ModelsPricing Plans

Core Features

Feature OverviewThe CoderX AgentOperating ModesReviewTerminal IntegrationBrowserSecurity

Customization

Lifecycle HooksContext ManagementRules & InstructionsCommandsSkills & Custom ToolsSub-Agents & Parallel OrchestrationSemantic Search@ Mentions

MCP

Model Context Protocol (MCP)MCP FeaturesMCP Tab

Tools

Cloud FeaturesCLIInline Edit (Ctrl+K)BugbotShared TranscriptsSlack IntegrationLinear IntegrationGitHub IntegrationGit SupportGitLab IntegrationDeep Links

Settings

ConfigurationIgnore FilesExtensionsKeyboard ShortcutsShell Commands

Advanced

Parallel AgentsBring Your Own Key (BYOK)Language SupportMigrations

Account

Account ManagementBilling & SubscriptionsUpdate AccessTeamsEnterprise

Guides

CookbookAgent WorkflowsWeb DevelopmentData ScienceLarge Codebases & MonoreposMermaid DiagramsBugbot Rules

Support

TroubleshootingCommon IssuesRequest IDTroubleshooting GuideDownload
Documentation

Large Codebases & Monorepos

Strategies for managing context and indexing in repositories with millions of lines of code.

Tackling large codebases or massive monorepos requires smart context management. Loading millions of lines of code directly into the LLM's prompt window would cause overflow errors. CoderX resolves this by using Partial Indexing, Semantic Vector Search, and Focus Mode to target only relevant subsets of your project.


Workspace Indexing Architecture

When you open a large codebase, CoderX processes it using a multi-layered search pipeline:

flowchart LR
    A[User Request] --> B{Semantic Query}
    B -->|Query Embeddings| C[Local Vector SQLite]
    B -->|Lookup References| D[AST Symbol Map]
    C -->|Fetch Diffs| E[Context Window]
    D -->|Fetch Imports| E

1. Codebase Indexing & Vector Search

CoderX indexes files in the background to build semantic embedding segments:

  • Embedding Generation: Chunks code files and computes high-dimensional vector representations.
  • Incremental Updates: Watches directories and updates the index only for modified files, ensuring minimal CPU overhead.
  • Search Retrieval: When you query the model, CoderX runs a local vector database query, fetching only the top 10 most relevant code sections.

2. Focus Mode

If you are working in a large monorepo, you can activate Focus Mode to restrict the search boundaries:

Open Focus Panel

Navigate to the Codebase Indexer tab in your sidebar.

Select Directory Target

Choose a specific folder path (e.g. /packages/auth-service/) to define your boundary.

Scope Search Bounds

The agent will restrict semantic searches, symbol lookups, and file modifications strictly inside this path boundary, saving token context space.


Monorepo Best Practices

[!TIP] To maintain high performance and low indexing memory usage in large codebases, follow these optimization guidelines:

1. Configure Excludes

Ensure node modules, logs, build folders, and third-party vendor directories are added to .m0xignore. Excluding vendor/ or node_modules/ can reduce indexing time by up to 90%.

2. Segment .m0xrules

Create directory-specific rules. For example, place one .m0xrules in the backend Go folder and another in the frontend Next.js folder. CoderX will inject only the rules matching the files the agent is currently modifying.

3. Use Workspace Roots Configuration

If you have multiple independent projects, open each project folder separately in the editor rather than opening the parent folder containing all of them. This keeps the index clean and limits vector search scopes.

Data Science

Jupyter notebooks and Python.

Mermaid Diagrams

Visualize your code.

On this page

Workspace Indexing Architecture1. Codebase Indexing & Vector Search2. Focus ModeOpen Focus PanelSelect Directory TargetScope Search BoundsMonorepo Best Practices1. Configure Excludes2. Segment .m0xrules3. Use Workspace Roots Configuration