Use this to quickly open and switch VS Code projects, and use AI assistant to analyze your code and chat with it instantly.
- use shortcut/tray (
Ctrl+Cmd+R
) menu to quickly launch a UI listing recent opened window with different project paths, then select one to open it in VS Code. - AI Assistant features. CodeV now includes a Code AI Assistant feature powered by Anthropic's Claude AI. This feature allows you to get detailed explanations of code snippets with a simple keyboard shortcut.
- Select the code or text you want to get analyzed insight in any editor or even on web page.
- Press
Cmd+C
to copy the selected code to your clipboard. - Press
Ctrl+Cmd+E
to open the Code AI Assistant window, which will:- Create a floating window with the code from your clipboard
- Generate an insight using Anthropic Claude
- The window will display your code and start generating an insight.
- You can use the input text field to continue the discussion.
- You can custom your prompt on the menu bar.
Note: For a smooth demonstration workflow, make sure to copy your code to the clipboard before triggering the Code AI Assistant with Ctrl+Cmd+E.
You can click the toggle on the top bar and switch to Insight Split view mode
.
When you customize the prompt as empty, you can still copy your code first, and trigger Ctrl+Cmd+E
, it would still navigate to the AI Assistant view without triggering insight generation, then you can input your follow-up message to discuss with AI.
Trigger Ctrl+Cmd+C
shortcut to launch pure AI chat mode, just like the Claude or ChatGPT desktop
- Syntax highlighting for various programming languages
- Streaming explanation that updates in real-time
- Automatic language detection
- Error handling
- The Code AI Assistant uses Claude API to generate explanations/insight.
- The API request is made from the main Electron process (not the renderer) for security.
- Explanations/Insights are streamed in real-time for a better user experience.
- The UI is a semi-transparent floating window that can be closed when not needed.
- (not needed anymore)
extension folder:
(for VS Code quick switcher feature) which is for old version (main branch, not the current develop branch, and we have migrated the implementation to use the vscode/cursor built-in sqlite instead)~~yarn install
- either
F5 debug
for debugging or- built it and install it. Firstly
- install vsce
yarn make
,yarn load
(first time) &yarn reload
to install.
electron (desktop app)we have moved the electron stuff in the root level, do following in theroot folder
:yarn install
- DB setup
- For the first time or every time db scheme changes, execute
yarn db:migrate
to generate SQLite DB file (./prisma/dev.db
) and generate TypeScript interface.yarn db:view
can be used to view DB data.db:migrate
will also automatically do this part,yarn install
will also include generated types in node_modules/.prisma/index.d.ts)
- For the first time or every time db scheme changes, execute
yarn start
(not set VS Code debugging yet)
-
Make sure you have an Anthropic API key. You can get one from Anthropic's website.
-
Set up your API key on the menu bar (-> Setting -> API key setting), or add your API key to the
.env
file in theelectron
directory:ANTHROPIC_API_KEY=your_api_key_here
In VS Code Run and Debug, choose Electron: Main Process
to launch and debug.
To debug render process, please directly set up breakpoints in the opened dev tool instead, which is what Electron official site recommends
Ref: https://www.electronjs.org/docs/latest/tutorial/application-debugging#renderer-process.
p.s. We had tried to use VS Code debugger setting for this, but it became invalid after migrating to the new version of Electron.
- package an mac app:
yarn make
. The app size is about 196MB. Then you can move/copy out/CodeV-darwin-arm64/CodeV.app to your application folder and use it daily.
- Follow Prepare provisioning profile section on https://www.electronjs.org/ to get
yourapp.provisionprofile
and save it toembedded.provisionprofile
in root path. - Prepare the deployment certificate, ref: https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds
- Execute
yarn make_mas
to generate the app. - Execute
sh ./sign.sh
to convert app to pkg. - Submit to app store.
ref:
- prisma/prisma#8449
vercel/pkg#1508(we had use vercel/pkg to package server but we have decided to embed server to electron)
- shared in the FOSSASIA 2025 summit talk https://slides.com/grimmer/fossasia-2025-switchv-streamlining-developer-workflow-with-an-open-source-vs-code-launcher
- On MacOS, the created Electron BrowserWindow object may be destroyed by the system automatically somehow due to the resource management (e.g. running in the background for a while and memory is tight), so we need to check if a windows
isDestroyed()
result when reusing them. - React UI takeaway
- Pay an attention to React closure trap. E.g. if we register some callback function in the
useEffect(()=>{ /*...*/}, []});
, it may always use some initial state value, even its implementation is outside this useEffect, the solution is to use the useRef version of that state. - Updating state may not take an effect immediately. If you have some logic which is checking the value as some condition, you may update
useRef
version of that state when you update the state.
- Pay an attention to React closure trap. E.g. if we register some callback function in the