Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Quick Start Guide

Get Coraline running on your project in under 5 minutes.

1. Initialize a Project

Navigate to your project directory and initialize Coraline:

cd your-project
coraline init -i

The -i flag runs indexing immediately after initialization.

You’ll see output like:

Initializing Coraline in /path/to/your-project
Created .coraline/ directory
Created database at .coraline/coraline.db
Created config at .coraline/config.toml
Installed git post-commit hook

Would you like to download the embedding model (~137 MB)? [y/N]:

You can decline the embedding model for now - all other features work without it.

2. Verify the Index

Check the indexing results:

coraline stats

Output:

Coraline Statistics

Files:     128
Nodes:     4201
Edges:     9872
Unresolved refs: 153

3. Search for Symbols

Try searching for a function or class:

coraline query "authenticate"
coraline query "User" --kind class

4. Find Relationships

Get the node ID from the query output, then explore relationships:

# Find what calls a function
coraline callers <node-id>

# Find what a function calls
coraline callees <node-id>

# Analyze impact of changing a symbol
coraline impact <node-id>

5. Build Context for AI

Generate context for a coding task:

coraline context "add authentication middleware"
coraline context "how does the database layer work"

This outputs a Markdown document with relevant code snippets ready to paste into an AI assistant.

Common Workflows

Daily Development

With git hooks installed, Coraline automatically syncs after each commit:

git add .
git commit -m "Add feature"
# Coraline syncs automatically

Or manually sync changes:

coraline sync

Exploring a New Codebase

# Index the project
coraline init -i

# Get overview
coraline stats

# Search for entry points
coraline query "main" --kind function

# Find what main calls
coraline callees <main-node-id>

# Build context for understanding a feature
coraline context "how does the authentication system work"

Refactoring

# Find a symbol to refactor
coraline query "old_function_name"

# Check impact
coraline impact <node-id>

# Find all callers
coraline callers <node-id>

# After making changes, sync
coraline sync

Code Review

# Sync to latest
coraline sync

# Check impact of changed symbols
coraline impact <changed-node-id>

# Find test coverage
coraline query "test_authentication" --kind function
coraline callees <test-node-id>

Incremental vs Full Indexing

Incremental sync (fast, recommended):

coraline sync

Uses git to detect changes and only re-indexes modified files.

Full reindex (slower, comprehensive):

coraline index

Re-parses all files. Use when:

  • Switching branches with many changes
  • After updating configuration
  • If sync results seem incorrect

Download the embedding model and generate vectors:

coraline model download
coraline embed

This enables natural language search:

# Via CLI (when MCP tools are used)
coraline serve --mcp
# Then use coraline_semantic_search tool

Semantic search is most useful in MCP integration - see MCP Integration.

Configuration

Customize indexing behavior by editing .coraline/config.toml:

[indexing]
include_patterns = [
  "src/**/*.rs",
  "lib/**/*.ts",
]
exclude_patterns = [
  "**/test/**",
  "**/node_modules/**",
]

[context]
max_nodes = 30
max_code_blocks = 10

See Configuration Guide for all options.

Project Memories

Store persistent context about your project:

# Via MCP tools (recommended)
# Use coraline_write_memory, coraline_read_memory, etc.

# Or manually create files in .coraline/memories/
echo "# Project Overview" > .coraline/memories/overview.md

Memories help AI assistants maintain context across sessions.

Next Steps

For CLI Usage

For AI Assistant Integration

Troubleshooting

“Project not initialized”

Run coraline init first.

“No results found”

Ensure files match include_patterns in .coraline/config.toml. Check:

coraline status

Slow indexing

For large projects (10,000+ files):

  1. Use more specific include_patterns
  2. Increase batch_size in config
  3. Exclude test/fixture directories

Out-of-date results

Run a full reindex:

coraline index --force

Git hooks not working

Reinstall hooks:

coraline hooks install

Or check hook status:

coraline hooks status