clean command removes the .gitnexus/ index directory from a repository and unregisters it from the global registry.
Usage
Options
Skip confirmation prompt and delete immediately.Flag:
-f, --forceDelete indexes for all registered repositories (instead of just the current one).Flag:
--allExamples
Clean Current Repository
Run from within a git repository:Clean All Repositories
What Gets Deleted
Repository Index
The entire.gitnexus/ directory is removed:
Global Registry Entry
The repository is removed from~/.gitnexus/registry.json.
What Stays
- Source code (untouched)
.gitignoreentry (harmless if index is deleted)AGENTS.mdandCLAUDE.mdfiles (can be manually deleted)- Agent skills in
.claude/skills/(per-repo, can be manually deleted)
Use Cases
Free Disk Space
Indexes can grow to 100-500 MB for large repositories. Useclean to reclaim space:
Re-index After Corruption
If the index is corrupted:Remove All Indexes Before Uninstalling
Safety
Confirmation Required
By default,clean shows what will be deleted and requires --force to proceed.
No Impact on Source Code
Only the.gitnexus/ directory is deleted. Your source code is never touched.
Re-indexing
You can always re-index after cleaning:Troubleshooting
”No indexed repository found in this directory”
You’re not in a repository that has been indexed. Solution:--all to clean all indexed repos:
Permission Denied
The.gitnexus/ directory may be locked by another process.
Solution:
- Stop any running
gitnexus serveor MCP servers - Close your editor
- Retry:
Failed to Delete (Partial Deletion)
If deletion fails partway through:Impact on MCP
After cleaning a repository:- MCP tools will no longer see it in
list_repos - Queries targeting that repo will fail
- The web UI will not show it
gitnexus analyze to restore MCP access.
See Also
- gitnexus list — View all indexed repositories
- gitnexus analyze — Re-index after cleaning
- gitnexus status — Check index status