# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## What this is Web UI for a self-hosted music service (MCMA). Role: **control center** — library, downloads, storage, users/permissions. Playback exists (persistent player) but is secondary to a future mobile client. ## Commands - `npm run dev` — dev server at http://localhost:3000 - `npm run build` — production build - `npm run preview` — preview production build - `npm run lint` — rslint (`@rslint/core`, native-speed lint) - `npm run test` — rstest (run once); `npm run test:watch` — watch mode - `npm run format` — prettier - `npx tsc --noEmit` — typecheck (strict; this is the main correctness gate, lint does not type-check) Single test: `npx rstest tests/index.test.tsx` (path or `-t `). ## Stack (fixed — do not swap) React 19 + TypeScript strict · **rsbuild** (not Vite/CRA) · **RTK Query** for all server state · Redux Toolkit slices for client state · React Router · **modern-sk** UI kit. React Compiler is enabled via `babel-plugin-react-compiler` — do not hand-add `useMemo`/`useCallback` for render-identity reasons; the compiler handles memoization. ## Hard rules (architecture invariants) 1. **No hardcoded backend address** except the env default. Runtime override is mandatory (see base-URL resolution below). 2. **No `fetch` in components.** All backend access goes through RTK Query hooks. The entire API surface is isolated in `src/api/`. The one sanctioned exception is `useConnectionStatus` (health ping) and the audio `