🌿
DevOpsGo

Worktree Switching

by marcus

Worktree Switching is a DevOps skill for Claude Code, published by marcus in sidecar.

1K stars79 forkson marcus/sidecarAdded 2026/08/21Repository updated 2026/08/21
agentic-aiagentic-workflowsclaude-codetui
Install in seconds
Install Worktree Switching
Copy Worktree Switching into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/marcus/sidecar/tree/main/.claude/skills/worktree-switching ~/.claude/skills/worktree-switching

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/marcus/sidecar.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
.claude/skills/worktree-switching/SKILL.md in marcus/sidecar
Installs to
~/.claude/skills/worktree-switching
Collection
One of 16 skills cataloged from this repository
Category
DevOps798 skills

What Worktree Switching does

Worktree Switching supports changing Sidecar’s active git worktree, reinitializing plugins, and restoring per-worktree state. Use it when implementing worktree-aware behavior or handling deleted worktrees and fallback to main.

Worktree Switching is cataloged under DevOps on DirSkills. Worktree Switching comes from a repository tagged agentic-ai, agentic-workflows, claude-code and tui.

Documentation

README

Worktree Switching

Sidecar supports seamless switching between git worktrees. When switching:

  1. All plugins are stopped, reinitialized with the new WorkDir, and restarted
  2. Per-worktree state (active plugin, sidebar selections) is saved/restored
  3. Project-specific themes are applied
  4. If a worktree is deleted externally, sidecar gracefully falls back to main

Core Mechanism

Project Switching

Worktree switching uses Model.switchProject() in internal/app/model.go:

m.switchProject(worktreePath)

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Worktree Switching

  • What else does marcus publish alongside Worktree Switching?

    Worktree Switching is one of 16 skills that DirSkills catalogs from marcus/sidecar, the repository it ships in. Its siblings there include Create Adapter, Create Modal and Create Plugin. Each one is a separate skill with its own page in this directory, installs the same way Worktree Switching does, and is maintained by marcus in that same repository. The rest of the collection is listed on the marcus/sidecar page.

  • How does Worktree Switching compare to other DevOps skills?

    Worktree Switching ranks #430 by stars among the 798 DevOps skills in this catalog. The most-starred ones next to it are Backend Patterns, API Connector Builder and Migration. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Worktree Switching against them. Open each page to compare what they document and how they install.

More from marcus/sidecar

Worktree Switching is one of 16 skills cataloged on DirSkills from marcus/sidecar.

See all 16 skills
🔌
1w ago

Create Adapter

Create Adapter covers building conversation adapters that import AI chat history from tools like Claude Code, Cursor, Warp, and Codex. Use it when creating or debugging an adapter’s parsing, caching, watch handling, or performance behavior.
AI Engineering
1K79
🪟
1w ago

Create Modal

Create Modal builds declarative dialogs with the internal/modal library, including confirm, input, select, form, and custom sections. Use it when adding modals or dialogs that need built-in keyboard, mouse, and overlay handling.
Frontend
1K79
🧩
1w ago

Create Plugin

Create Plugin explains how to build Sidecar plugins that implement the plugin interface, render Bubble Tea views, and wire keyboard input, footer hints, event bus, and lifecycle hooks. Use it when adding a plugin or debugging plugin rendering and init/stop behavior.
AI Engineering
1K79
🎨
1w ago

Create Theme

Create Theme configures Sidecar color themes, including base theme selection, color overrides, gradient borders, tab styles, and syntax themes. Use it when creating or adjusting UI appearance or troubleshooting color and style issues.
Frontend
1K79
🪟
1w ago

Drag Pane

Drag Pane implements drag-to-resize behavior for two-pane layouts. Use it when adding or fixing divider dragging, width clamping, mouse hit regions, or saved pane widths.
Frontend
1K79
🚩
1w ago

Feature Flags

Feature Flags gates experimental functionality in Sidecar with user-configurable settings. Use it to register flags, check them in code, and manage config or CLI overrides with clear priority rules.
DevOps
1K79