version unknown

Delphi Lookup

@JavierusTk⭐ 35 stars· last commit 6mo ago· 0 open issues

Fast Delphi/Pascal symbol search for AI coding agents — 75ms lookups across 672K+ symbols with AST-aware parsing, FTS5 search, and optional LSP server for concurrent sessions.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

7.9/10
Verified
Apr 29, 2026

// RATINGS

⭐GitHub Stars
⭐⭐ 35 on GitHubGitHub ↗

Growing

🟢ProSkills ScoreAI Verified
7.9/10
📍

Not yet listed on ClawHub or SkillsMP

// README

delphi-lookup - Fast Pascal Code Search for AI Agents

License: MIT + Commons Clause Platform: Windows x64 Delphi: 12+

High-performance source code search and navigation system for Pascal codebases, designed for AI coding agents like Claude Code.

Includes an LSP server that gives Claude Code native go-to-definition, hover, find-references, and document-symbols on .pas files — the same navigation experience you get in an IDE, but for AI agents.

Features

  • LSP Server - Native Claude Code integration: go-to-definition, hover, references, document symbols on .pas files
  • Fast CLI Search - ~75ms end-to-end for identifier lookups (short-circuit on exact match), ~75ms cached
  • Smart Search - 3-phase cascade: exact NOCASE → prefix → substring, then FTS5 + fuzzy
  • Declaration Priority - Declarations rank above implementations with [Decl] badges
  • Smart Caching - Content-hash based cache that survives reindexing
  • Incremental Indexing - Merkle-style change detection; no-change verification in <10ms
  • Parallel Processing - Multi-threaded AST parsing and folder scanning
  • Category Filtering - Separate user code, stdlib, third-party
  • Framework Detection - Multi-tier VCL/FMX/RTL classification (packages, uses clause, path)
  • Scalable - Tested with 672K+ symbols (3.2GB database)

Claude Code LSP Server

The LSP server gives Claude Code native IDE-like navigation on Pascal files — no prompts or skills needed, it just works as a tool:

LSP goToDefinition  →  Jump to where TMyClass is defined
LSP hover           →  See the full class declaration with docs
LSP documentSymbol  →  Get a structured outline of any .pas file
LSP findReferences  →  Find all files that reference a symbol

Note: workspaceSymbol is not functional — Claude Code sends an empty query string (#17149). Use delphi-lookup.exe for workspace-wide symbol search.

Setup: Install the plugin and point it to your indexed database. See claude-code/SETUP.md for step-by-step instructions (Windows and WSL).

Quick Start

Installation

  1. Download the latest release or build from source
  2. Ensure sqlite3.dll is in the bin/ folder (included)

Basic Usage

# 1. Build index from your Pascal source
delphi-indexer.exe "C:\Projects\MyDelphiApp\src" --category user

# 2. Search code
delphi-lookup.exe "TStringList" -n 5

# 3. List indexed folders
delphi-indexer.exe --list-folders

Documentation

For using the tools:

  • USER-GUIDE.md - Complete usage guide, all options, examples
  • CLAUDE.md - AI agent reference (configuration, architecture, code patterns)

For maintaining/extending:

Architecture

Pascal Source Files → delphi-indexer → SQLite Database (FTS5)
                                                 ↓
                                    ┌─── delphi-lookup ──→ CLI Results
                                    └─── delphi-lsp-server ──→ Claude Code LSP

Components:

  • delphi-indexer - Indexes Pascal code with AST parsing (parallel, incremental)
  • delphi-lookup - Fast identifier lookup with short-circuit + hybrid search (fuzzy + FTS5) with caching
  • delphi-lsp-server - Language Server Protocol server for Claude Code (definition, hover, references, symbols)
  • Database - SQLite with WAL mode, FTS5 full-text search, optional vector embeddings

System Requirements

Platform: Windows x64

Runtime Dependencies:

  • sqlite3.dll (FTS5-enabled, included)
  • vec0.dll (sqlite-vec extension, included)

Note: Vector embedding support (via Ollama) is included but not recommended for AI agent workflows. FTS5-only is the default and recommended mode — agents iterate fast and achieve similar quality with multiple searches while being 17x faster. See CLAUDE.md for details.

Compilation Dependencies (Delphi):

  • mORMot 2
  • FireDAC (included with RAD Studio)
  • DelphiAST (included)

Performance

End-to-end wall-clock time (exe startup + DB connection + search + formatting):

OperationEnd-to-endInternal searchDetails
Identifier lookup (cold)~75ms~12msExact name match with short-circuit
Identifier lookup (cached)~75ms~10msFrom query_cache
Full search (cold)~1.0-1.7s~950-1700msFTS5 + fuzzy (no short-circuit)
No-change reindex~10ms—Merkle-style detection
Indexing~43 chunks/sec—Parallel AST parsing

Exe startup overhead is ~65ms (process creation + DB connection + FTS5 detection). 83% of production queries are single-word Pascal identifiers that hit the short-circuit path.

Scalability: Tested with 672K+ symbols, 3.2GB database

Examples

# Basic usage
delphi-lookup.exe "TStringList" -n 5

# Search user code only
delphi-lookup.exe "TCustomForm" --category user

# Boost user code in results
delphi-lookup.exe "TForm" --prefer user -n 10

# Filter by framework
delphi-lookup.exe "TButton" --framework VCL -n 5

# Full-text search
delphi-lookup.exe "JSON serialization" -n 5

# Find constants
delphi-lookup.exe "MAX_BUFFER" --symbol const

# Indexing
delphi-indexer.exe "C:\Projects\MyLib" --category user
delphi-indexer.exe "C:\Projects\MyLib" --force        # Full reindex
delphi-indexer.exe --list-folders                      # Show indexed folders

Output Format

Compact format optimized for AI agent context windows (2-3 lines per result):

// Context for query: "CrearQuery"

Found 5 result(s) for "CrearQuery":

1. [Decl] function CrearQuery(const pSQL:string='';const pPrepare:boolean=false):TQueryMAX; overload;
   → TableMax.Query.pas [unit: TableMax.Query] (user, RTL)

2. [Decl] function CrearQuery(const pQuery:string): TDataset; virtual; abstract;
   → gmcSincronizarSQL.Tipos.Origen.pas [unit: gmcSincronizarSQL.Tipos.Origen] (user, RTL)

// Search completed in 12 ms

Declarations are tagged with [Decl]. Use --full for verbose output with code snippets.

Configuration

delphi-lookup can be configured via JSON file, environment variables, or command-line parameters.

Configuration File (recommended)

Copy delphi-lookup.example.json to delphi-lookup.json and customize:

{
  "database": "delphi_symbols.db",
  "category": "user",
  "num_results": 5
}

Key settings:

  • database: SQLite database file path
  • category: Default source category for indexing
  • num_results: Default number of search results
  • Command-line parameters override config file settings

See CLAUDE.md for full configuration reference.

AI Tool Integration

Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

Security

For security considerations and vulnerability reporting, see SECURITY.md.

Support

For AI Coding Agents:

For developers:

  • Check TESTS.md for test suite
  • See [DATABASE-SCHE

// REPO STATS

35 stars
0 open issues
Last commit: 6mo ago