A framework for building desktop applications with Chromium, Node.js, and web technologies.
On this page
Overview
Electron's CLAUDE.md explains its multi-repository build and patch process, garbage-collected C++ objects, and release maintenance. Several familiar commands are forbidden because the repository has safer or cheaper alternatives.
For patch conflicts on an existing PR, the guide first checks the failed Apply Patches run for an exported resolution. A local three-way sync is the fallback when the artifact is absent.
Source excerpt starting at line 141.
141If asked to fix a patch conflict on a branch that already has an open PR, check the PR's failed **Apply Patches** CI run for an `update-patches.patch` artifact before running `e sync` locally. CI has already performed the 3-way merge and exported the resolved patch diff — applying it is much faster than a full local sync.
02 / Hard prohibitions
Give a prohibition a concrete replacement
The file bans npx because it may fetch and execute an uninstalled package. It offers a direct node_modules binary or Yarn invocation instead, applying the same restriction to commands and authored scripts.
Source excerpt starting at line 5.
5**Never use `npx`.** It is considered dangerous because it can silently fetch and execute arbitrary packages from the registry. Always run binaries through one of these safer mechanisms instead:
03 / Architecture as narrative
Explain ownership constraints in the garbage collector
The C++ guidance distinguishes heap edges, roots, and native stack locals. It connects tracing omissions to use-after-free and explains why destructors cannot inspect other managed objects.
Source excerpt starting at line 228.
228- Destructors must not access other GC managed objects: sweeping has no object229 destruction order or timing guarantee.
04 / Scope layering
Apply release labels only to users with write access
Only contributors with write access receive labeling guidance. It separates ordinary backports from security fixes and derives active branches from label metadata rather than a copied list.
Source excerpt starting at line 195.
195When the user has write access to `electron/electron`, add these labels when creating PRs:
05 / Router files
Select upgrade skills from the active branch
Chromium and Node.js upgrades have separate named skills and branch triggers. The branch is the concrete signal for which specialized workflow to load.
Source excerpt starting at line 183.
183When working on the `roller/chromium/main` branch to upgrade Chromium activate the "Electron Chromium Upgrade" skill.
Ideas for your repo
01Check whether CI already produced the expensive local operation's result.
02Pair forbidden commands with approved alternatives and a reason.
03Explain ownership and destruction-order assumptions near memory rules.
04State which release actions require repository permissions.
Sponsored by
Give your agents the whole story.
These instructions explain how to work in Electron. Modem shows your agents what customers said, who is affected, and what changed.