🧱 claude-village

Development

A guide for contributors working on claude-village itself. For install and user docs see docs/install.md and docs/usage.md.

Stack

Architecture

Two processes talk over a typed IPC bridge:

For the full design see docs/design/2026-04-20-claude-village-design.md. For the task-by-task plan see docs/plans/2026-04-20-claude-village-plan.md. Current status is tracked in docs/progress.md.

Prerequisites

Clone and install

git clone https://github.com/haimadrian/claude-village.git
cd claude-village
pnpm install

pnpm install does not run any postinstall or rebuild step. There are no native modules to rebuild.

Dev loop

pnpm dev

This launches Electron (via electron-vite dev) with Vite HMR on the renderer. Renderer edits reload instantly; main-process edits trigger a rebuild and restart.

Code layout

Quality gates

Run before every commit:

pnpm typecheck   # tsc for node and web projects
pnpm lint        # ESLint + Prettier check
pnpm test        # Vitest unit suite
pnpm e2e         # Playwright (requires a prior `pnpm build`)

pnpm lint:fix auto-fixes what it can.

Test reports

Vitest emits reports under reports/ whenever CI=true is set (CI exports it; locally just prefix with CI=true):

Playwright always writes reports under playwright-report/:

On failure Playwright also retains traces and videos under test-results/.

Running e2e alongside a live app

The hook server binds to a fixed port (127.0.0.1:49251) so the ~/.claude/settings.json snippet never has to change and a second running copy of claude-village hard-fails on launch instead of silently drifting to a random port. Tests bypass that by setting CV_HOOK_PORT=0 in the spawn env, which picks a random free port for the test-run only. The e2e spec already does this; if you add new specs that launch Electron, make sure to set CV_HOOK_PORT: "0" in the env passed to electron.launch.

Build and package

pnpm build       # emits main (ESM) + preload (CJS) + renderer into out/
pnpm package     # runs electron-builder --mac, emits a DMG into release/

Output: release/claude-village-<version>-arm64.dmg. No native modules are compiled in either step. To test the packaged build, follow the install steps in docs/install.md. The app's only persistent state is a tiny JSON file at {userData}/pinned.json holding pinned session ids.

Known quirks

CI

Two GitHub Actions workflows live in .github/workflows/:

Both jobs run on macos-latest. Artifacts are retained for 14 days.

Docs

Contributing