Skip to content

feat: add codegraph clone command for copying indexes to worktrees - #1609

Open
Lint111 wants to merge 1 commit into
colbymchenry:mainfrom
Lint111:feat/clone-command
Open

feat: add codegraph clone command for copying indexes to worktrees#1609
Lint111 wants to merge 1 commit into
colbymchenry:mainfrom
Lint111:feat/clone-command

Conversation

@Lint111

@Lint111 Lint111 commented Aug 24, 2026

Copy link
Copy Markdown

Summary

  • Adds a codegraph clone [target] CLI command that copies a CodeGraph index (codegraph.db) from one project/worktree to another
  • Supports --source <path> for explicit source, --auto for git worktree parent auto-detection, and -f/--force to overwrite
  • Only copies the db file (no WAL/SHM), creates the .codegraph/ directory and .gitignore in the target

Motivation

Git worktrees don't inherit the parent repo's .codegraph/ index. Dispatched CI/agent workers in fresh worktrees have no code intelligence until they run a full codegraph init (30–120s). This command copies the parent's db instantly (~186MB, sub-second), giving worktrees immediate code intelligence since the db uses relative paths.

Usage

# Explicit source
codegraph clone --source /path/to/main-repo

# Auto-detect from git worktree parent
codegraph clone --auto

# With explicit target and force overwrite
codegraph clone --auto /path/to/worktree --force

Test plan

  • codegraph clone --source <initialized-repo> <empty-dir> copies the db and reports size
  • codegraph clone --auto from a linked git worktree finds the main worktree's index
  • Target with existing index skips without --force, overwrites with --force
  • No source and no --auto prints usage error
  • tsc --noEmit passes

🤖 Generated with Claude Code

Git worktrees don't inherit the parent repo's .codegraph/ index, leaving
dispatched agents without code intelligence. `codegraph clone` copies just
the codegraph.db (no WAL/SHM) from a source project to a target, with
--auto to detect the parent worktree automatically.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 24, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants