The CodePen extension for VS Code lets you create and edit your Pens as real files on your own machine. Start a new Pen, or pull down an existing one from the sidebar or by its URL. Edit the files however you like (in your editor, from a terminal, or with a coding agent), and every change is saved back to CodePen, built there, and shown in a live preview beside your code.
It works in VS Code and the editors built on it, such as Cursor, Devin Desktop (formerly Windsurf), and Antigravity.

Installing
Search for CodePen in your editor’s Extensions view and install the one published by CodePen-Official. It’s listed in two places, and your editor picks the right one for you:
- VS Code installs from the Visual Studio Marketplace.
- Cursor, Devin Desktop, Antigravity, VSCodium and most other VS Code–based editors install from Open VSX.
Or from a terminal:
code --install-extension CodePen-Official.codepen
cursor --install-extension CodePen-Official.codepenCode language: Bash (bash)
Updates arrive automatically, just like any other extension.
Getting Started
You need a CodePen account. The extension works on Pens made in the CodePen 2.0 editor.
- Sign in. Open the Command Palette (
Cmd+Shift+Pon Mac,Ctrl+Shift+Pon Windows and Linux) and run CodePen: Sign In. Your browser opens CodePen, where you sign in the way you usually do (GitHub, Google, or your password) and approve the extension. The browser then hands you back to your editor, which asks once whether the CodePen extension may handle the link. The sign-in is kept in your editor’s secure storage, not in a file, and there’s no API key to copy around. - Open a Pen. Click one in the CodePen sidebar, or run CodePen: Open Pen and paste the Pen’s URL. The Pen is saved to a
CodePenfolder in your home directory (you can change that) and opens in this window, or in a new window if this one already has a Pen open. To start from scratch, click New Pen in the sidebar or run CodePen: Make New Pen. - Edit. There’s no save-to-CodePen step: change a file, and it goes up. Watch the CodePen item in the status bar to see your changes being pushed and built.
- See it run. Run CodePen: Show Preview for a live preview beside your code.
To come back to a Pen later, open its folder. It stays linked to the Pen.
Opening a Pen from codepen.io
CodePen offers an Open in… menu for helping you open a Pen directly in your local editor of choice. A Pen you already have a folder for opens in that folder, and if a window already has it open, that window comes to the front. The link looks like this (with cursor:// and so on for other editors):
vscode://CodePen-Official.codepen/open?pen=<id>Code language: plaintext (plaintext)

The CodePen Sidebar
Click the CodePen icon in the activity bar to open it.

- Current Pen appears when the window has a Pen open, with its screenshot, title, description and tags. Hover the screenshot to show the preview, open the preview in your browser, or open the Pen on CodePen. Click the pencil beside the title to change the title, description and tags.
- Your Pens lists your Pens with screenshots, newest first. Search them, sort by last updated, date created or popularity, and page through them. Click a Pen to open it, or right-click it to open it in a new window or view it on CodePen.
- Pens of switches between your own Pens and those of any PRO Team you belong to.
- New Pen makes a Pen (in the Team you’re browsing, if any) and opens it.
How Syncing Works
- Every change is saved. When the folder has been quiet for a moment (750ms by default), the changes go up to CodePen as one new saved version. Creating a file adds it to the Pen; deleting a file removes it.
- CodePen builds it. Each save is built by the Pen’s Blocks, just as in the web editor, so there’s nothing to install or run locally. If the build changes your source files (a formatter, say), those changes come back into your folder.
- Errors show where you work. Build errors and warnings appear in the Problems panel and as underlines in the file.
- The preview follows the build. It refreshes after every successful build and has a DevTools button for the console and inspector. The preview inside the editor needs CodePen PRO; on a Free plan, use CodePen: Open on CodePen to see your Pen run.
When the Pen changes on CodePen too
The extension checks CodePen when you open a Pen’s folder and whenever it pushes.
- If only CodePen changed, those files are updated in your folder and you’re told.
- If you have changes of your own as well, you’re asked what to do: Review each file side by side, Keep Mine, or Take Theirs. Nothing is overwritten without asking.
It doesn’t watch CodePen in between. If you changed the Pen on CodePen and want those changes now, run CodePen: Pull from CodePen. It makes the folder match the Pen: files are replaced with CodePen’s version, and files CodePen doesn’t have are removed. If the folder has changes that were never pushed, it lists them and asks first.
Tip: close the Pen’s tab on codepen.io while you work on it in your editor. A browser tab left open can save its older copy of your code over what you pushed. If that happens you’ll see a conflict; choose Keep Mine to put your code back.
The status bar
| It shows | It means |
|---|---|
| ✓ CodePen | Your folder and CodePen match. |
| CodePen: pushing | Your changes are on their way. |
| CodePen: building | CodePen is building the Pen. |
| CodePen: paused | You paused syncing. Changes aren’t being sent. |
| CodePen: conflict | The Pen changed on CodePen too. Click to choose which version to keep. |
| CodePen: waiting to retry | CodePen couldn’t be reached, or a limit was hit. It tries again by itself. |
| CodePen: failed | Something needs your attention. Hover or click for the reason. |
Your local files are never changed or undone because of a failure. Click the status bar item for more actions.
Which Files Are Sent to CodePen
Everything in the folder is part of the Pen, except files that only matter on your computer. These are never sent:
.git,node_modules,.DS_Storeand similar system files- editor settings such as
.vscodeand.idea - files for coding agents, such as
CLAUDE.md,AGENTS.md,.cursor,.devinand.claude
To keep other files out of the Pen, create a .codepenignore file in the folder and list them one pattern per line, the same way as a .gitignore:
notes/
*.logCode language: plaintext (plaintext)
The folder also holds a .codepen-sync.json file. It’s how the folder remembers which Pen it belongs to, and whether that Pen is yours or a Team’s. Leave it in place; it’s never sent to CodePen.
Team Pens
Signing in also reaches the Pens of every Team you belong to, as long as the Team is on a PRO plan. There’s nothing more to set up: pick the Team under Pens of in the sidebar, open its Pens like any other, and new Pens you make there belong to the Team. Changes you push to a Team’s Pen are yours, as they are in the web editor.

Working with AI Agents
Because the Pen is real files on disk, any coding agent can work on it: Copilot, Claude Code, Codex, Cursor’s agent, and the rest. And because CodePen builds the Pen on every save, an agent doesn’t need to build it or run a server to check its work. The extension tells agents so, in rule files of its own:
| File | Read by |
|---|---|
.cursor/rules/codepen.mdc | Cursor |
.github/instructions/codepen.instructions.md | GitHub Copilot |
.claude/rules/codepen.md | Claude Code |
.windsurf/rules/codepen.md | Devin Desktop (formerly Windsurf) |
.agents/rules/codepen.md | Antigravity |
They tell agents to edit the files in the folder rather than change the Pen through CodePen’s API or MCP tools (which would cause a conflict), and explain how a Pen is built: Blocks switch on for the files they process, and pages link their own source files. They give the address of the Pen’s built preview, which agents can open with their browser tools, and point agents that have CodePen’s MCP tools at preview_pen for a screenshot and the console. A .codepen-status.json file says whether the last save has been pushed and built yet, and what went wrong if the build failed, so an agent knows when to look.
These files are hidden from the editor’s file list and never sent to CodePen. Your own AGENTS.md, CLAUDE.md and the like are never touched. Turn the rule files off with the codepen.agentInstructions setting.
The MCP server, built in
In VS Code 1.101 and later, the extension also gives Copilot and other agents in the editor CodePen’s MCP server, signed in as you, with no setup. It appears as CodePen (and CodePen (Team name) for each of your Teams) in the editor’s MCP server list, where it can be stopped or turned off. Cursor and older versions of VS Code don’t support this; add https://mcp.codepen.io/mcp yourself there, as the MCP docs describe.
Commands
All of these are in the Command Palette.
| Command | What it does |
|---|---|
| CodePen: Sign In / Sign Out | Connect this editor to your CodePen account, or disconnect it. |
| CodePen: Open Pen | Bring one of your Pens, or your Team’s, into a folder and open it. |
| CodePen: Browse Pens | Show the CodePen sidebar. |
| CodePen: Make New Pen | Make a Pen on CodePen and open it in a folder. |
| CodePen: Show Preview | Show the running Pen beside your code. |
| CodePen: Open on CodePen | Open the Pen on codepen.io. |
| CodePen: Edit Pen Details | Change the open Pen’s title, description and tags. |
| CodePen: Pause Sync / Resume Sync | Stop sending changes for a while. Resuming sends everything as one save. |
| CodePen: Push Now | Send changes right away. |
| CodePen: Pull from CodePen | Replace the folder with the Pen as it is on CodePen. Asks first if you have changes that would be lost. |
| CodePen: Resolve Conflict | Choose which version to keep when the Pen changed in both places. |
| CodePen: Show Sync Status | Show what syncing is doing, with more actions. The same as clicking the status bar item. |
Settings
| Setting | Default | What it does |
|---|---|---|
codepen.folder | ~/CodePen | Where opened Pens are saved. |
codepen.quietWindow | 750 | How long, in milliseconds, to wait after the last change before pushing. Raise it if you want fewer saves. |
codepen.agentInstructions | true | Write the rule files for AI agents described above. |
To keep your Pens somewhere other than ~/CodePen, open your editor’s Settings, search for CodePen: Folder and enter a folder such as ~/Projects/pens. Only Pens you open from then on go there. Pens you already have stay where they are and keep working, so move their folders over yourself if you want them all in one place.
Plans and Limits
The extension works on every plan. It goes through the CodePen API, so the API’s limits apply, and a Pen can hold as many files as your plan allows (3 on Free, and up to 300 on PRO). If a save is refused, the status bar says why.
PRO adds the live preview inside the editor, Team Pens, and higher limits.
Good to Know
- Your own Pens and your Teams’ only. Being a collaborator on someone else’s Pen isn’t enough to open it.
- 2.0 Pens only. Pens made in the classic editor can’t be opened.
- One Pen per window.
- Signing out elsewhere signs you out here. Disconnecting the extension under Connected apps at Settings → API, or changing your password, ends the sign-in. Syncing stops, your files stay as they are, and it picks up again when you sign in.
- Not available yet: forking Pens, making a Pen from a folder you already have, and changing a Pen’s privacy from the extension. Do those on codepen.io.