codebase-exploration
Explore and understand codebases using SocratiCode semantic search, dependency graphs, and context artifacts. Use when exploring…
Set up, index, and manage SocratiCode codebase indexing. Use when the user wants to index a project, check infrastructure health, start/stop file watching, configure context artifacts, troubleshoot indexing issues, manage the code graph, or any SocratiCode administrative task.
Claude Code
$ npx -y skills add giancarloerra/SocratiCode --skill codebase-management --agent claude-code
Codex
$ npx skills add giancarloerra/SocratiCode --skill codebase-management -a codex -y
Cursor
$ npx skills add giancarloerra/SocratiCode --skill codebase-management -a cursor -y
Gemini CLI
$ npx skills add giancarloerra/SocratiCode --skill codebase-management -a gemini-cli -y
GitHub Copilot
$ npx skills add giancarloerra/SocratiCode --skill codebase-management -a github-copilot -y
OpenCode
$ npx skills add giancarloerra/SocratiCode --skill codebase-management -a opencode -y
Windsurf
$ npx skills add giancarloerra/SocratiCode --skill codebase-management -a windsurf -y
name: codebase-management description: >- Set up, index, and manage SocratiCode codebase indexing. Use when the user wants to index a project, check infrastructure health, start/stop file watching, configure context artifacts, troubleshoot indexing issues, manage the code graph, or any SocratiCode administrative task. Activates when the user mentions indexing, setting up search, SocratiCode infrastructure, or managing the codebase index.
Set up, index, and manage SocratiCode codebase indexing, file watching, code graphs, and context artifacts.
1. **Check infrastructure**: `codebase_health` — verifies Docker, Qdrant, Ollama/embedding provider, and embedding model 2. **Start indexing**: `codebase_index` — runs in background, returns immediately 3. **Poll progress**: `codebase_status` — call every ~60 seconds until 100% complete
4. **Done**: Graph auto-builds after indexing. In the default watcher mode, the file watcher auto-starts. Ready to search.
On first use, SocratiCode automatically pulls Docker images, starts containers, and downloads the embedding model (~5 min one-time setup).
The file watcher keeps the index automatically updated in the default `SOCRATICODE_WATCHER=auto` mode.
For a deliberate code-index snapshot, configure every MCP process that uses the checkout with `SOCRATICODE_WATCHER=off` and `SOCRATICODE_AUTO_RESUME=off`. Search and graph tools keep reading the existing index and graph; run `codebase_update` and `codebase_graph_build` only when a refresh is wanted. Use watcher mode `manual` instead when explicit `codebase_watch { action: "start" }` should remain available. Never try to restart a watcher whose status says disabled.
With `SOCRATICODE_WATCHER=git`, active indexed checkouts refresh on checked-out ref/HEAD changes, checked every 10 seconds and on search/status/graph requests. No native file watcher starts. Pending or failed refreshes are not current results. Git triggers the update, but the working tree is indexed, including uncommitted edits. Use `codebase_update` for file saves that do not change ref/HEAD. Selecting Git mode does not create a first index. `SOCRATICODE_AUTO_RESUME=off` suppresses startup catch-up, not later Git-triggered updates. A Git diagnostic must not be bypassed by starting a watcher.
The dependency graph is auto-built after indexing. In watcher modes `manual` and `off`, graph queries read an existing graph but will ask for an explicit build instead of creating a missing graph as a side effect.
To index non-code knowledge, create `.socraticodecontextartifacts.json` in the project root:
{
"artifacts": [
{
"name": "database-schema",
"path": "./docs/schema.sql",
"description": "PostgreSQL schema — all tables, indexes, constraints, foreign keys."
}
]
}Supported types: SQL schemas, OpenAPI/Protobuf API specs, Terraform/CloudFormation configs, Kubernetes manifests, architecture docs, environment configs — any text-based file or directory.
| Problem | Solution | |---------|----------| | Docker not available | Install Docker Desktop from https://docker.com, ensure it's running | | Slow indexing on macOS/Windows | Docker can't use GPU. Install native Ollama from https://ollama.com/download for Metal/CUDA acceleration. Or use cloud embeddings. | | Want cloud embeddings instead | Set `EMBEDDING_PROVIDER=openai` + `OPENAI_API_KEY`, or `EMBEDDING_PROVIDER=google` + `GOOGLE_API_KEY` | | Search returns no results | Check `codebase_status` — project may not be indexed. Run `codebase_index`. | | Stale results | Check `codebase_status`. Run `codebase_update`; start the watcher only when status does not say it is disabled. | | Indexing was interrupted | Run `codebase_index` again — it resumes from the last checkpoint automatically. | | Another process is indexing | `codebase_status` detects cross-process indexing. Wait for it, or use `codebase_stop`. |
| Variable | Default | Description | |----------|---------|-------------| | `QDRANT_MODE` | `managed` | `managed` (Docker) or `external` (remote/cloud Qdrant) | | `QDRANT_URL` | — | Full URL for remote Qdrant (e.g. `https://xyz.cloud.qdrant.io:6333`) | | `QDRANT_API_KEY` | — | API key for remote Qdrant | | `EMBEDDING_PROVIDER` | `ollama` | `ollama`, `openai`, or `
= 18.17"> "There is only one good, knowledge, and one evil, ignorance." — Socrates Your AI reads code. SocratiCode understands it.
Explore and understand codebases using SocratiCode semantic search, dependency graphs, and context artifacts. Use when exploring…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.