Syntax
Description
Removes the.gitnexus/ index from the current repository and unregisters it from the global registry.
By default, the command prompts for confirmation before deleting. Use --force to skip the prompt.
Options
Skip confirmation prompt and delete immediately.
Clean all indexed repositories instead of just the current one.Requires
--force for confirmation.Usage Examples
Clean current repository (with prompt)
Clean current repository (skip prompt)
Clean all repositories (with prompt)
Clean all repositories (skip prompt)
What Gets Deleted
.gitnexus/directory in the repository- KuzuDB database files
- Full-text search indexes
- Embedding data
- Wiki output
- Metadata files
- Entry in global registry (
~/.gitnexus/registry.json)
What Doesn’t Get Deleted
- Source code (only the index is removed)
- AI context files (
AGENTS.md,CLAUDE.md) — these are kept - Global skills in
~/.claude/skills/or~/.cursor/skills/ - MCP configuration files
Safety
The clean command is safe — it only deletes GitNexus’s own data. Your source code and git history are never touched. The.gitnexus/ directory is automatically gitignored by the analyze command, so indexes are never committed to version control.
When to Use
Free up disk space
Indexes can be large for big repositories (100MB+ for large codebases). Clean unused indexes:Reset corrupted index
If the index is corrupted or incomplete:Before archiving a repository
Clean all old indexes
Remove all indexes at once:After Cleaning
To re-index a repository:Related Commands
gitnexus analyze— Rebuild the indexgitnexus status— Check index statusgitnexus list— List all indexed repositories