DEV Community

Cover image for Stop Rebuilding Your Workspace: One-Click Project Switching in VS Code with CtxShift
Hannah Redmond
Hannah Redmond

Posted on Edited on AI-assisted

Stop Rebuilding Your Workspace: One-Click Project Switching in VS Code with CtxShift

You know the feeling. You're deep in one repo: six tabs open, a split editor with the test next to the implementation, a terminal sitting in the right folder, a breakpoint with a condition you spent ten minutes getting right.

Then a teammate pings you about a bug in a different project.

You switch. Ten minutes later you switch back, and your workspace is gone. You reopen files, rebuild the split, cd into the right directory, find the branch you were on, and re-create that breakpoint. None of it is hard, but all of it is friction, and it lands exactly when you're trying to rebuild your mental context too.

That's the problem CtxShift is built to solve: switch between project folders in one click and get each one back exactly as you left it.

Hi, I'm CodeMaman 👋

I'm a coder and a mother, and I'm increasingly conscious of how much time matters. When your hours are limited, the small losses add up: ten minutes rebuilding a workspace here, five minutes finding your place again there. Saving that time gives it back to the things that matter more.

That's why I enjoy putting my experience to work building tools that make everyday tasks a little faster and a little less annoying. CtxShift is one of them.

The cost of a context switch isn't the switch

Most project switchers answer "how do I open another folder quickly?" That's the easy half. The expensive half is everything your editor knew about that project that it forgot the moment you left.

Your editor state is part of your thinking. Which files you had open, where your cursor was, how you laid out the screen: these are cues that let you pick the thread back up. Losing them turns a "resume" into a "restart."

CtxShift treats that state as something worth saving. It remembers your tabs and layout, your terminals, your git branch and your breakpoints, and it keeps them up to date as you work, so they survive closing VS Code as well as switching.

The Saved Context view listing editors, terminals and breakpoints

Designed not to surprise you

Restoring state is only useful if you can trust it. A few choices I made with that in mind:

  • Terminals come back, processes don't. You get your terminal in the right folder, but it won't relaunch a dev server or a deploy script behind your back.
  • Your uncommitted work is safe. Branch restore never touches a working tree with uncommitted changes.
  • You can see what's stored. The Saved Context view shows exactly what will come back, so there's no guessing.
  • You choose what's restored. Don't want branches switched automatically? Turn that one off and leave the rest.
{
  "ctxshift.restore.branch": false
}
Enter fullscreen mode Exit fullscreen mode

Getting started

Install from the Marketplace, or from the command line:

code --install-extension CodeMaman.ctxshift
Enter fullscreen mode Exit fullscreen mode

Open the CtxShift icon in the activity bar, add your projects, and click one. If you keep everything under one directory like ~/code, Find Projects in Folder… scans it and imports every repo in one go. From then on, CtxShift saves the project you're leaving, opens the next one in the same window, and restores it.

The Projects view with the current project in the status bar

Keyboard-first switching

If you switch often, the mouse is too slow. Two shortcuts do most of the work:

  • Cmd+Alt+P / Ctrl+Alt+P opens a searchable project switcher.
  • Cmd+Alt+O / Ctrl+Alt+O jumps back to the previous project. That second one is the habit-changer. It works like Alt+Tab for your whole workspace: bounce between a feature and the service it depends on without thinking about it. Pin your most-used projects as favourites and you can jump straight to them with Cmd+Alt+1…9.

The project switcher with favourites, recent projects, groups and quick actions

Three features that earn their keep

Per-project settings. This is the one I'd reach for first on a team with mixed codebases. Add a settings object to a project in projects.json and it applies only while that project is open:

{
  "name": "legacy-api",
  "folders": ["/Users/you/code/legacy-api"],
  "group": "Work",
  "settings": {
    "editor.tabSize": 4,
    "editor.formatOnSave": false
  }
}
Enter fullscreen mode Exit fullscreen mode

No more flipping a global setting because one old repo uses tabs and the rest use spaces.

Multi-folder projects. Group several folders into one project and CtxShift opens them as a multi-root workspace, which suits a frontend and backend that live in separate repos but get worked on together.

Sync across machines. Point ctxshift.projectsFile at a synced folder (Dropbox, iCloud, a dotfiles repo) and your project list follows you. If you're coming from the Project Manager extension, import reads its projects.json too.

Honest limitations

  • VS Code doesn't let extensions see which sidebar view is showing, so that's a per-project choice rather than captured automatically.
  • Dirty working trees skip branch restore, so commit or stash first if you want the branch switched.
  • It's an early release (version 0.0.6), so expect it to keep evolving. ## Who it's for

CtxShift is a good fit if you work across several repos in a day, get interrupted and need to resume without re-assembling your setup, debug with breakpoints you'd hate to recreate, or are tired of juggling multiple VS Code windows. If you only ever work in one repo, you won't need it.

Want the full details?

I've kept this post to the ideas behind it. The full feature list, every setting and the complete shortcut reference live on the Marketplace page, so head there if you'd like to dig in:


I'm CodeMaman, a coder and mother who builds small tools to give developers their time back. You can find my other extensions, including the OAuth token generator, Branch Viewer and Ai Coauthoring Tracker, on my Marketplace publisher page.

Top comments (0)