Skip to main content

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

boolean
Skip confirmation prompt and delete immediately.
boolean
Clean all indexed repositories instead of just the current one.Requires --force for confirmation.

Usage Examples

Clean current repository (with prompt)

Output:

Clean current repository (skip prompt)

Output:

Clean all repositories (with prompt)

Output:

Clean all repositories (skip prompt)

Output:

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:
The MCP server and HTTP server will automatically discover the new index (no restart needed).