.claude
chore(skills): let merging-prs enqueue before approval (#3880)
.github
fix(ci): tolerate lockfile drift in vr-cli install (#4029)
.husky
feat: Auto-focus editor on typing and global Shift+Tab mode cycling (#987)
.stamphog
chore(stamphog): sync engine from upstream and raise line ceiling to 1200 (#3667)
.vscode
chore(app): Rename PostHog Code to PostHog (#3557)
apps
refactor(spaces): rework sidebar row status, pins and row menus (#4008)
docs
feat(mcp-gateway): team MCP gateway UI replacing the marketplace behind the mcp-gateway flag (#3643)
packages
feat(mcp-gateway): team MCP gateway UI replacing the marketplace behind the mcp-gateway flag (#3643)
patches
fix(shortcuts): match single-letter hotkeys by layout-aware key (#3525)
plugins
chore(app): Rename PostHog Code to PostHog (#3557)
scripts
chore(app): Rename PostHog Code to PostHog (#3557)
tooling
chore(app): Rename PostHog Code to PostHog (#3557)
tools
chore(stamphog): sync engine from upstream and raise line ceiling to 1200 (#3667)
.env.example
feat: UI polish and fixes (#952)
.gitignore
feat(storybook): add visual regression testing for stories (#3392)
.node-version
chore: set up biome and ci (#3)
.npmrc
chore: configure dependency minimum release age / cooldown (#2426)
AGENTS.md
fix(ui): stabilize chat scrolling (#3820)
biome.jsonc
fix(security): validate URL scheme before shell.openExternal (MCP-app sandbox escape) (#3416)
CLAUDE.md
docs: Create AGENTS.md (#2275)
CONTRIBUTING.md
chore(app): Rename PostHog Code to PostHog (#3557)
greptile.json
chore: Add config with AGENTS.md context and opt-out label for greptile (#2400)
knip.json
refactor(code): migrate build and dev to electron-vite (#2811)
LICENSE
chore: migrate license from BSL to MIT (#2035)
mprocs.yaml
feat(web): cloud-tasks browser host (#3447)
package.json
fix(ci): upgrade PostHog CLI for release races (#3952)
pnpm-lock.yaml
chore(harness): upgrade Pi to 0.83.0 (#4041)
pnpm-workspace.yaml
chore(harness): upgrade Pi to 0.83.0 (#4041)
README.md
docs: replace readme header with monorepo migration note (#4065)
turbo.json
feat: Implement Playwright e2e testing framework and CI/CD checks (#553)
vitest.config.base.ts
ci(tests): upload Vitest and Playwright JUnit reports to Trunk Flaky Tests (#2941)

IMPORTANT

This repository has migrated to the PostHog monorepo. Development, issues and pull requests now live there.

PostHog

This is the monorepo for the PostHog desktop and mobile apps and the agent framework that powers them.

Development

Prerequisites

  • Node.js 22+
  • pnpm 10.23.0

Setup

# Install pnpm if you haven't already
npm install -g pnpm

# Install dependencies for all packages
pnpm install

# Optional: copy environment config
# Only needed for code signing (APPLE_*) or PostHog analytics (VITE_POSTHOG_*).
# The app runs fine in dev without it.
cp .env.example .env

Running in Development

By default, pnpm dev uses phrocs (our custom process runner) to run the agent and code app in parallel. phrocs auto-installs and keeps itself up to date: on every pnpm install the local binary is checked against the latest phrocs-latest release checksums and re-downloaded if it differs (skipped when offline or in CI). pnpm dev only downloads it if it is missing entirely. It reads the mprocs.yaml config file. The binary lives at bin/phrocs and is git-ignored.

# Run both agent (watch mode) and code app in parallel
pnpm dev

# Or run them separately:
pnpm dev:agent  # Run agent in watch mode
pnpm dev:code   # Run code app


# Use mprocs instead of phrocs
pnpm dev:mprocs

Want to connect to a local PostHog instance? See docs/LOCAL-DEVELOPMENT.md for OAuth setup and connecting to localhost:8010.

Utility Scripts

Scripts in scripts/ for development and debugging:

ScriptDescription
scripts/clean-posthog-code-macos.shRemove all PostHog app data from macOS (caches, preferences, logs, saved state). Use --app flag to also delete PostHog.app from /Applications.
scripts/test-access-token.jsValidate a PostHog OAuth access token by testing API endpoints. Usage: node scripts/test-access-token.js <token> <project_id> [region]

Project Structure

posthog-code/
├── apps/
│   ├── code/            # Electron desktop app (React, Vite)
│   ├── mobile/          # React Native mobile app (Expo)
│   └── cli/             # CLI for stacked PRs
├── packages/
│   ├── agent/           # TypeScript agent framework
│   ├── core/            # Shared business logic
│   ├── electron-trpc/   # tRPC for Electron IPC
│   └── shared/          # Shared utilities (Saga pattern, etc.)

Documentation

FileDescription
apps/code/README.mdDesktop app: building, signing, distribution, and workspace configuration
apps/mobile/README.mdMobile app: Expo setup, EAS builds, and TestFlight deployment
apps/cli/README.mdCLI: stacked PR management with Jujutsu
AGENTS.mdArchitecture rules, code style, patterns, and testing guidelines (read by Claude Code, Codex, Cursor, Aider, etc.)
CONTRIBUTING.mdHow to contribute to PostHog
docs/LOCAL-DEVELOPMENT.mdConnecting the desktop app to a local PostHog instance
docs/UPDATES.mdRelease versioning and git tagging
docs/TROUBLESHOOTING.mdCommon issues and fixes
docs/DEEP-LINKS.mdposthog-code:// deep link schemes and parameters

Contributing

We love contributions big and small. See CONTRIBUTING.md to get started.

Troubleshooting

See docs/TROUBLESHOOTING.md for common issues (black screen, Electron install failures, native module crashes, Secretive commit signing, etc.).