# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Repository layout This is a **pnpm + Nx monorepo** (not Yarn — the older single-package layout is gone). Workspaces are defined in `pnpm-workspace.yaml`: - `apps/web` (`element-web`) — the browser client. **This is where almost all feature work happens.** Source is `apps/web/src/` (not a top-level `/src/`). - `apps/desktop` (`element-desktop`) — the Electron wrapper. Uses Vitest for unit tests and `hak` for native modules. - `packages/module-api` (`@element-hq/element-web-module-api`) — public API surface for runtime modules. - `packages/shared-components` (`@element-hq/web-shared-components`) — shared React components; home of Storybook. - `packages/playwright-common`, `packages/vite-common` — shared test/build helpers. Build orchestration is Nx (`nx.json`); most `apps/web` scripts (`build`, `start`, `test`, `lint:types`) delegate to Nx targets defined in `apps/web/project.json`, which handle prebuild steps (`prebuild:module_system`, `prebuild:rethemendex`) automatically. ## Prerequisites - Node.js: `.node-version` pins **24** (package.json `engines` allows `>=22.18`) - pnpm (the repo uses a `pnpm-lock.yaml` and a catalog for shared dependency versions) ## Commands Run package-scoped commands from inside the package dir (e.g. `cd apps/web`) or from the root with `pnpm --filter element-web