Skip to content
cidx logo

CIDX - Semantic Code Search and Intelligence

cidx

Code search and intelligence using CIDX. Use when searching codebases, finding implementations, tracing call graphs, analyzing dependencies, or searching git history. Preferred over grep/find for all code exploration.

SKILL.md

Full skill instructions

CIDX - Semantic Code Search and Intelligence

Comprehensive CIDX (Code Indexer) documentation for AI coding assistants.

INDEX MANAGEMENT - CRITICAL FIRST STEP

Before querying, verify indexes exist. Queries fail or return empty results without proper indexes.

Check Index Status

cidx status                  # Semantic/​FTS index status (shows indexed files, last update)
cidx scip status             # SCIP indexes per project (shows SUCCESS/​FAILED/​PENDING)
cidx scip status -v          # Detailed status with error messages

Status interpretation:

  • Semantic/​FTS: Shows file count, languages, last indexed time
  • SCIP SUCCESS: Project indexed successfully, queries will work
  • SCIP FAILED: Generation failed (check -v for errors, fix issues, rebuild)
  • SCIP PENDING: Not yet generated (run cidx scip generate)
  • SCIP LIMBO: Partial success (some projects succeeded, some failed)

Create Indexes

# Semantic + FTS indexes (required for cidx query)
cidx init                    # Initialize .code-indexer/ in project
cidx index                   # Index current codebase
cidx index --index-commits   # Also index git history (enables temporal search)

# SCIP indexes (required for cidx scip commands)
cidx scip generate           # Generate SCIP indexes for all discovered projects
cidx scip generate --project backend/  # Generate only for specific project

Re-index / Update Indexes

# Semantic/​FTS re-indexing
cidx index                   # Re-indexes changed files (incremental)
cidx index --force           # Full re-index (ignores cache)

# SCIP re-indexing
cidx scip rebuild PROJECT    # Rebuild specific project
cidx scip rebuild --failed   # Rebuild all failed projects
cidx scip rebuild --force PROJECT  # Force rebuild even if succeeded

Supported Languages

Semantic/​FTS: All text-based source files (auto-detected)

SCIP (requires language-specific tooling):

LanguageProject MarkerRequirement
Javapom.xmlMaven
TypeScriptpackage.jsonnpm/​yarn
Pythonpyproject.tomlPoetry
Kotlinbuild.gradle.ktsGradle
C#*.sln, *.csproj.NET SDK 8.0+
Gogo.modGo SDK 1.18+

SEMANTIC SEARCH - MANDATORY FIRST ACTION

CIDX FIRST: Always use cidx query before grep/​find/​rg for semantic searches.

Decision Rule:

  • "What code does", "Where is X implemented" → CIDX semantic (default)
  • Exact text (identifiers, function names) → --fts
  • Pattern matching (regex) → --fts --regex (10-50x faster than grep)
  • CIDX unavailable → grep/​find (fallback only)

Key Flags: --limit N (default 10, start with 5-10 to conserve context) | --language python | --path-filter */​tests/​* | --exclude-path PATTERN | --exclude-language LANG | --min-score 0.8 | --accuracy high | --quiet

Context Conservation: Start with low --limit values (5-10) on initial queries. High limits consume context window rapidly when results contain large code files.

Example: cidx query "authentication" --language python --exclude-path "*/​tests/​*" --limit 5 --quiet


FULL-TEXT SEARCH (FTS)

Use For: Exact names, identifiers, TODO comments, typo debugging.

Flags: --fts | --case-sensitive | --fuzzy | --edit-distance N | --snippet-lines N

Example: cidx query "authenticate_user" --fts --case-sensitive --quiet

Hybrid: --fts --semantic runs both in parallel.


REGEX MODE (Grep Replacement)

Flags: --fts --regex | Incompatible with --semantic and --fuzzy

Token-Based: Matches individual tokens only.

  • Works: def, login.*, test_.*
  • Doesn't work: def\s+\w+ (whitespace removed)

Example: cidx query "def.*auth" --fts --regex --language python --quiet

Fallback: Use grep only when CIDX unavailable.


TEMPORAL SEARCH (Git History)

Use For: Code archaeology, commit message search, bug history, feature evolution.

Prerequisite: cidx index --index-commits (indexes git history)

Flags: --time-range-all | --time-range YYYY-MM-DD..YYYY-MM-DD | --chunk-type commit_message | --chunk-type commit_diff | --author EMAIL

Examples:

  • When added: cidx query "JWT auth" --time-range-all --quiet
  • Bug history: cidx query "database bug" --time-range-all --chunk-type commit_message --quiet
  • Author work: cidx query "refactor" --time-range-all --author "[email protected]" --quiet

Indexing Options: --all-branches | --max-commits N | --since-date YYYY-MM-DD


SCIP CALL GRAPH AND DEPENDENCY ANALYSIS

CIDX provides precise code intelligence via SCIP (Source Code Intelligence Protocol) indexes.

Prerequisite: cidx scip generate (generates SCIP indexes)

For complete SCIP documentation: See reference/​scip-intelligence.md

Quick reference - SCIP commands:

  • cidx scip definition SYMBOL - Find where a symbol is defined
  • cidx scip references SYMBOL - Find all references to a symbol
  • cidx scip dependencies SYMBOL - Get symbols this symbol depends on
  • cidx scip dependents SYMBOL - Get symbols that depend on this symbol
  • cidx scip callchain FROM TO - Trace call chains between symbols
  • cidx scip context SYMBOL - Get smart context (curated file list)
  • cidx scip impact SYMBOL - Analyze change impact

Common options: --limit N | --exact | --project PATH | --depth N


REFERENCE DOCUMENTATION

Detailed documentation available in reference/ directory:

  • reference/​semantic-search.md - Semantic search flags and patterns
  • reference/​fts-search.md - Full-text search, regex, fuzzy modes
  • reference/​temporal-search.md - Git history search guide
  • reference/​scip-intelligence.md - Complete SCIP call graph and dependency analysis guide

More skills from majiayu000

xiaohongshu logo
majiayu000/claude-arsenal

xiaohongshu

xiaohongshu

286 148
View
agent-task-conductor logo
majiayu000/claude-skill-registry

agent-task-conductor

Conduct multi-agent task orchestration and workflow coordination.

663 1
View
conductor-setup logo
majiayu000/claude-skill-registry

conductor-setup

Initialize project with Conductor artifacts (product definition,

663 1
View
animation-designer logo
majiayu000/claude-skill-registry

animation-designer

Expert in web animations, transitions, and motion design using Framer Motion and CSS

663 1
View
diagramming logo
majiayu000/claude-skill-registry

diagramming

Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...

663 1
View
h3-pg logo
majiayu000/claude-skill-registry-data

h3-pg

PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.

23 1
View
conductor-development logo
majiayu000/claude-skill-registry

conductor-development

Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...

663 1
View
conductor-status logo
majiayu000/claude-skill-registry

conductor-status

Display project status, active tracks, and next actions

663 1
View
dockerization logo
majiayu000/claude-skill-registry

dockerization

Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.

663 1
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View