Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>CodePenNew to Visual Studio Code? Get it now.
CodePen

CodePen

CodePen

|
4 installs
| (0) | Free
Work on a CodePen Pen as files on your own machine.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CodePen VS Code Extension

Create and edit your CodePen Pens as real files on your own machine. The power of CodePen in the comfort of your own editor!

You can start a new Pen, or pull down an existing Pen from the sidebar or by ID/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.

Works in VS Code and editors built on it, such as Cursor, Devin, and Antigravity.

A Pen open in the editor: the CodePen sidebar with the Current Pen and Your Pens, the Pen's files, and its live preview beside the code

Features

  • Open any of your Pens as a folder. Real files on disk, so your tools and agents can see all of them.
  • Your Pens in the sidebar. Browse, search and sort your Pens and your Teams' Pens, with screenshots, and start a new one in a click.
  • Saves itself. Any change to a file is saved to CodePen. Several changes close together go up as one save.
  • Follows the build. CodePen builds your Pen on every save. If the build changes your files, for example a formatter, those changes come back to your folder.
  • Errors where you work. Build errors and warnings appear in the Problems panel and as underlines in the file.
  • Live preview beside your code, refreshed after every successful build, with a DevTools button for the console and inspector. Requires CodePen PRO.
  • Safe with the web editor. If the Pen was also changed on CodePen, you choose which version to keep. Nothing is overwritten without asking.

Getting Started

You need a CodePen account. To work on a Pen you already have, it must be one made in the CodePen 2.0 editor.

  1. Sign In. Open the Command Palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on 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.
  2. Open a Pen. Run CodePen: Open Pen and paste the Pen's URL. The Pen is saved to a CodePen folder 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 a new one instead, run CodePen: Make New Pen and give it a title.
  3. Edit and save. Watch the CodePen item in the status bar: it shows when your changes are being pushed and built. Click it for more actions.
  4. See it run. Run CodePen: Show Preview.

Open the folder to come back to a Pen later. It stays linked to the Pen.

Opening a Pen from codepen.io

Where CodePen offers an Open in link for your editor, choosing it opens the Pen here directly. The editor asks once whether the CodePen extension may handle the link. 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 vscode://CodePen-Official.codepen/open?pen=<id> (cursor://… in Cursor).

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 is nothing more to set up: open a Team's Pen like any other, pick whose Pens to browse at the top of the CodePen view, and say whose a new Pen is to be when you make one. Changes you push to a Team's Pen are yours, as they are in the editor on codepen.io.

The CodePen Sidebar

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

The CodePen sidebar: a New Pen button, search and sort, and a list of Pens with screenshots, descriptions and tags
  • Current Pen appears when the window has a Pen open: 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, newest first, with screenshots. 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. If you belong to PRO Teams, choose whose Pens to show at the top.
  • New Pen makes a Pen (in the Team you are browsing, if any) and opens it.

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 are not being sent.
CodePen: conflict The Pen changed on CodePen too. Click to choose which version to keep.
CodePen: waiting to retry CodePen could not be reached, or a limit was hit. It will try 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.

Commands

Command What it does
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. Also the pencil beside its title in the sidebar.
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.
CodePen: Sign In / Sign Out Connect this editor to your CodePen account, or disconnect it.

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_Store and similar system files
  • editor settings such as .vscode and .idea
  • files for coding agents, such as CLAUDE.md, AGENTS.md, .cursor and .cursorrules

To keep other files out of the Pen, create a file named .codepenignore in the folder and list them, one pattern per line, the same way as a .gitignore:

notes/
*.log

Creating a file adds it to the Pen. Deleting a file removes it from the Pen.

The folder also contains .codepen-sync.json. It is how the folder remembers which Pen it belongs to, and whether that Pen is yours or a Team's. Leave it in place; it is never sent to CodePen. It is hidden from the editor's file list, along with .codepen-status.json, unless codepen.agentInstructions is turned off.

Working with AI agents

CodePen builds the Pen on every save, so an agent working in the folder (Cursor, Copilot, Claude Code, Windsurf, Antigravity) does not need to build it or run a server to check its work. The extension tells agents so, in rule files of its own:

  • .cursor/rules/codepen.mdc
  • .github/instructions/codepen.instructions.md
  • .claude/rules/codepen.md
  • .windsurf/rules/codepen.md
  • .agents/rules/codepen.md (Antigravity)

They tell agents to edit the folder rather than change the Pen through CodePen's API or MCP tools, which would cause a conflict, and 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. .codepen-status.json 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.

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, so they can change a Pen's title, description, tags and privacy 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.

These files are hidden from the editor's file list (through files.exclude in the folder's .vscode/settings.json), so they stay out of your way. Folders you already had, like your own .cursor, stay visible. Your own AGENTS.md, CLAUDE.md and the like are never touched. None of these files are sent to CodePen. Turn them off with the codepen.agentInstructions setting.

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 are told.
  • If you have changes of your own as well, you are asked what to do: Review each file side by side, Keep Mine, or Take Theirs.

It does not watch CodePen in between. If you know 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 does not have are removed. If the folder has changes that were never pushed, it lists them and asks before replacing them.

Tip: close the Pen's tab on codepen.io while you work on it here. A browser tab left open can save its older copy of your code over what you pushed. If that happens, you will see a conflict; choose Keep Mine to put your code back.

Settings

Setting Default What it does
codepen.folder CodePen in your home folder 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 notes for AI agents saying where the built preview is and whether the last save has been built.

Where Pens are saved

To keep your Pens somewhere other than ~/CodePen, open your editor's Settings (Cmd+, on Mac, Ctrl+, on Windows and Linux), search for CodePen: Folder and enter the folder you want, such as ~/Projects/pens. A ~ at the start means your home folder. Leave it empty to go back to ~/CodePen.

Only Pens you open from then on go to the new folder. Pens you already have stay where they are and still work when you open their folders. But opening one of them again with CodePen: Open Pen saves a new copy in the new folder, so move your existing Pen folders over yourself if you want them all in one place.

Good to know

  • Your own Pens and your Teams' only. The extension can open Pens that belong to you or to a PRO Team you are a member of. Being a collaborator on someone else's Pen is not enough.

  • Signing out elsewhere signs you out here. Disconnecting the extension under Connected apps in your CodePen settings, 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.

  • 2.0 Pens only. Pens made in the Classic Editor cannot be opened.

  • The preview needs PRO. On a free plan, use CodePen: Open on CodePen to see your Pen run.

  • Plan limits apply. The extension works through CodePen's API, which has these limits (details). If a save is refused, the status bar says why.

    Free PRO
    Files per Pen 3 50, 150 or 300, by plan
    Requests an hour 100 3,000
    Reads a day 1,000 10,000
    New Pens a day 3 50

    Only files you write or upload count toward the files per Pen. Folders, config files such as package.json, and what the build produces do not (details). Deleting a Pen does not give back a new one for that day. Work on a Team's Pens counts against the Team's limits, not yours.

  • One Pen per window.

  • Not available yet: forking Pens, making a Pen from a folder you already have, and changing a Pen's privacy from the extension's own commands. Do those on codepen.io.

Help

Click the CodePen status bar item and choose Show Log to see what the extension has been doing. Include that log when you report a problem to CodePen Support.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft