Skip to main content
The --fast-context flag searches your codebase for relevant code and adds it as context to the agentโ€™s prompt.

Quick Start

Fast Context Demo

Usage

Basic Fast Context

Expected Output:

Specify Search Path

Combine with Other Features

How It Works

  1. Query Analysis: Analyzes your prompt to understand what code is relevant
  2. Codebase Search: Searches the specified directory for matching files
  3. Relevance Ranking: Ranks files by relevance to your query
  4. Context Injection: Adds relevant code snippets to the agentโ€™s context
  5. Enhanced Response: Agent responds with full codebase awareness

Use Cases

Code Explanation

Bug Investigation

Expected Output:

Code Review

Feature Planning

Documentation Generation

Search Configuration

File Types Searched

By default, Fast Context searches common code files:

Ignored Paths

These directories are automatically excluded:
  • node_modules/
  • venv/, .venv/
  • __pycache__/
  • .git/
  • dist/, build/

Best Practices

Be specific with your search path. Searching a smaller, relevant directory produces better results than searching the entire project.
Large codebases may result in high token usage. Use --metrics to monitor costs.

Specific Paths

Target specific directories for better relevance

Clear Prompts

Use specific technical terms that match your code

Iterative Search

Start broad, then narrow down to specific modules

Monitor Tokens

Use --metrics to track context size and costs

Performance Tips