ck - Semantic Grep by Embedding ck (seek) is a semantic grep tool designed for developers, AI agents, and teams to find code by meaning rather than just keywords. It acts as a drop-in replacement for grep with enhanced capabilities to understand concepts and code behavior. --- Features Semantic Search Finds code by concept, understanding synonyms, related terms, and conceptual similarity. Examples of semantic queries: ck --sem "retry logic" finds backoff and circuit breakers. ck --sem "user authentication" finds login, auth, and credentials code. ck --sem --full-section "error handling" returns complete functions containing error handling logic. Drop-In grep Compatibility Supports the same flags and behavior as grep. Examples: Case insensitive: ck -i "warning" .log Context lines with line numbers: ck -n -A 3 -B 1 "error" src/ List matching files: ck -l "error" src/ Recursive search with exclusions: ck -r --exclude ".test.js" "bug" Hybrid Search Combines regex and semantic search with intelligent ranking using Reciprocal Rank Fusion. Can filter results by threshold, e.g., ck --hybrid --threshold 0.02 query Agent-Friendly Output JSON output perfect for integration with LLMs, scripts, and automation. Example: ck --json --sem "error handling" src/ | jq '.file' Smart File Filtering Automatically excludes common directories such as .git, nodemodules, target, .fastembedcache, pycache. Users can override defaults or add custom exclusions. --- How It Works Index Once, Search Many Build a semantic index once with ck index /path/to/project. Search instantly by meaning with the semantic flags. Three Search Modes --regex (default): classic grep without indexing. --sem: pure semantic embedding-based search requiring indexing. --hybrid: combines regex and semantic search. Relevance Scoring Returns results with confidence scores. Example: ck --sem --scores "machine learning" docs/ --- Advanced Usage Search specific files or multiple files: ck --sem "authentication" .py .js .rs ck --sem "error handling" src/auth.rs src/db.rs Threshold filtering for high-confidence results: ck --sem --threshold 0.7 "query" Get complete code sections: ck --sem --full-section "database queries" ck --full-section "class.Error" src/ Directory management commands: ck status . ck clean . ck add new_file.rs --- File Support Languages with full indexing, parsing, and semantic chunking: Python (functions, classes) JavaScript (functions, classes, methods) TypeScript (functions, classes, methods) Haskell (functions, types, instances) Supports plain text formats like Markdown, JSON, YAML, TOML, XML, HTML, CSS, shell scripts, SQL. --- Installation From Source Planned Package Manager Support brew install ck-search apt install ck-search --- Architecture The project is a modular Rust workspace comprising: ck-cli: CLI and argument parsing ck-core: shared types and utilities ck-search: search engine implementations ck-index: file indexing and sidecar management ck-embed: text embedding providers ck-ann: approximate nearest neighbor indices ck-chunk: text segmentation and parsing ck-models: model registry and config management Indexes are stored in .ck/ directories alongside source code. This cache can be safely deleted and rebuilt. --- Performance Indexes ~1 million lines of code within 2 minutes. Sub-500ms search queries on typical codebases. Index size typically 1-3x the size of source code. Efficient streaming and automatic exclusion of unnecessary files. Reliable stdout/stderr separation for scripting. --- ##