MCP Code Graph & Token Savings · 7 min read

Turn-1 Cold-Start Codebase Indexing: Seeding Rules & 150+ Symbols With bootstrap_project

Bootstrap AI agent memory on Turn 1 of an unindexed repository using bootstrap_project to extract CLAUDE.md rules and 150+ code symbols in a single deterministic MCP handshake.

Direct Answer (TL;DR) Self-Contained GEO Passage

Starting a new AI coding session on an unindexed codebase usually leads to hallucinations and wasted discovery turns. Memoreal's Turn-1 cold-start protocol detects when memories_used === 0, triggers a bootstrap_hint, and executes bootstrap_project to ingest project guidelines (CLAUDE.md, AGENTS.md, .cursorrules) and up to 150 key code symbols in a single deterministic handshake.

1 Turn
Number of agent turns required to fully index rules and symbols
Memoreal Cold-Start Benchmarks
150 Symbols
Top-level AST functions, classes, and interfaces seeded initially
Memoreal bootstrap_project Specification
<2.5s
Total onboarding handshake latency on fresh git clone
Claude Code Session Telemetry
Table of Contents ↓

Cold-Start Onboarding: Ad-Hoc Discovery vs Turn-1 bootstrap_project

Cold-Start Onboarding: Ad-Hoc Discovery vs Turn-1 bootstrap_project
Onboarding StrategyInitial Turn CountToken ConsumptionRule Adherence FidelitySymbol Discovery
Ad-Hoc Manual Prompting4 to 8 turns of exploratory questions40,000+ tokens burned reading filesLow (agent forgets early rules as context grows)Hit-or-miss keyword searching
Static Memory File (MEMORY.md)1 turn reading raw markdown file5,000 to 15,000 tokensMedium (static text without AST linking)Zero (stores raw prose only, no code symbols)
Memoreal bootstrap_project Handshake1 deterministic turn on session start<1,500 tokens structured context payload100% (rules anchored as high-salience memories)150+ core symbols and relationships seeded

The Cold-Start Dilemma in Fresh Coding Sessions

Every time a developer opens a new Claude Code, Cursor, or Codex CLI session in a recently cloned repository, the agent starts with complete amnesia. It possesses no awareness of team conventions, architectural boundaries, or core module entrypoints.

To compensate, developers typically spend the first several turns manually explaining the project structure, reminding the model not to use prohibited libraries, and directing it to specific configuration files. If the developer forgets to mention a critical invariant, the agent quickly introduces code that violates team standards.

  • Fresh sessions lack context, leading to repetitive manual developer orientation.
  • Agents invent patterns that violate unmentioned team engineering standards.
  • Manual orientation prompts waste valuable context window space and developer time.

The Deterministic Turn-1 Handshake Protocol

Memoreal solves the cold-start problem through an automated Turn-1 handshake protocol. At session start, the agent invokes build_context to retrieve established facts and recent context for the workspace namespace. If the response indicates memories_used === 0, the server returns a bootstrap_hint.

Upon receiving the hint, the agent reads the repository's rule files (such as CLAUDE.md, AGENTS.md, or .cursorrules) along with key entrypoint source files, and dispatches them to bootstrap_project in a single MCP tool call.

Instant Ingestion of Rules and 150+ Core Symbols

Within under 2.5 seconds, bootstrap_project parses the rule headings into durable semantic memories with high salience (0.9), ensuring they remain pinned in subsequent memory retrievals. Concurrently, the engine parses up to 150 top-level functions, classes, and interfaces into the AST graph.

By Turn 2, the agent operates with full institutional memory and architectural grounding. It knows the exact database version, architectural rules, and entrypoint signatures, ready to deliver production-grade code immediately.

Bootstrapping a Repository Namespace on Turn 1

json
{
  "jsonrpc": "2.0",
  "id": 10,
  "method": "tools/call",
  "params": {
    "name": "bootstrap_project",
    "arguments": {
      "namespace": "ecommerce-api",
      "files": [
        {"path": "CLAUDE.md", "content": "# Team Rules\n- Never git rebase\n- PostgreSQL 16 only"},
        {"path": "src/index.ts", "content": "export function startServer() {}"}
      ]
    }
  }
}

Frequently Asked Questions

When should an agent call bootstrap_project?

An agent should call bootstrap_project on Turn 1 when build_context returns memories_used === 0 or includes a bootstrap_hint.

What files should be included in the bootstrap payload?

Include project guideline files like CLAUDE.md, AGENTS.md, README.md, and primary entrypoint source files representing core interfaces.

Does bootstrap_project overwrite existing memories in the namespace?

No. It seeds initial rules and symbols cleanly, merging with existing records and deduplicating identical facts.

60-Second Setup

Install Persistent Memory for Your Coding Agent

Sub-15ms deterministic recall, AST symbol navigation, and 70%+ token savings across Claude Code, Cursor, Codex CLI, and Windsurf.

npx -y @kolivri/memoreal-mcp setup
Start Free (1,000 Calls · $0 LLM Tax) Compare All Alternatives →