feat: add branch-based plugin install for worktree workflows#395
Conversation
Adds a `plugin-path` subcommand that clones a specific branch to a stable, deterministic path under ~/.cache/compound-engineering/branches/. Designed for use with `claude --plugin-dir` to test plugin branches without mutating the local working tree.
…ranches New `plugin-path` command clones a branch to a deterministic cache path (~/.cache/compound-engineering/branches/) for use with `claude --plugin-dir`. Adds `--branch` flag to `install` for non-Claude targets (Codex, OpenCode, etc.). Designed for worktree-based workflows where the main checkout can't serve as a reliable plugin source.
Restructured README: Philosophy and Workflow first, then Install, Branch Install, Local Dev, and Sync. Added shell alias examples with argument forwarding. Documented the worktree motivation for branch-based installs.
CI runners may default to master instead of main. Explicitly set the default branch name to avoid pathspec errors on checkout.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 328cfa4953
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Use ~ as the slash separator in cache paths instead of naive character stripping. This is injective because ~ is illegal in git branch names (git-check-ref-format reserves it for reflog notation). Also fixes alias mismatch (cce -> claude-dev-ce), clarifies that --branch requires pushed branches, adds collision resistance test, and updates solution doc with cross-repo/same-repo scenarios.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3180cbbfb4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Replace the lossy catch-all strip with percent-encoding so every distinct branch name maps to a unique cache directory. Slash still uses ~ (illegal in git refs), all other unsafe chars get %XX encoding.
Adds the ability to install or test Compound Engineering plugin from a specific git branch — solving a pain point for worktree-based development where the main checkout can't serve as a reliable plugin source.
Why this exists: When you develop with worktrees,
./plugins/compound-engineeringalways points to whatever branch your main checkout is on — not the branch you actually want to test.feat/feature-2in your main checkout,feat/feature-1in a worktree. You want to test feature-1's plugin while continuing to develop feature-2. The main checkout can't serve both purposes.Two complementary features:
plugin-pathcommand (for Claude Code) — clones a branch to a deterministic cache path (~/.cache/compound-engineering/branches/<plugin>-<branch>/) and outputs it forclaude --plugin-dir. Re-running fetches the latest. Progress goes to stderr, path to stdout, so it composes cleanly in shell aliases.--branchflag oninstall(for Codex, OpenCode, and all other targets) — passes the branch through togit clone. Skips bundled plugin lookup when specified since the user explicitly wants a remote version.Shell alias example with argument forwarding:
Also restructures README to lead with Philosophy and Workflow before installation mechanics.
Test plan
tests/plugin-path.test.ts(clone, sanitization, update-on-rerun, error cases)tests/cli.test.tsforinstall --branch