New to Claude Skills? Learn how to install them →

Pposthog on GitHub

PostHog Desktop

Free

Streamline your workflow for PostHog's Electron app.

by posthog37.6k stars on posthog/posthog
1 views
Updated Aug 11, 2026
Get this skill

Free · Opens the source repo

What PostHog Desktop does

The PostHog Desktop skill is designed specifically for developers working on the PostHog desktop application, which is built using Electron and the agent framework. This skill provides a scoped environment that pins the working directory to products/desktop, ensuring that all commands are executed within the context of the desktop application. This is crucial for maintaining the integrity of the workspace as it operates independently from the root monorepo, which includes various other components of PostHog.

When using this skill, developers will benefit from a tailored toolchain that replaces the standard monorepo tools with those specific to the desktop application. This includes commands for installation, development, building, type-checking, linting, and testing, all of which are designed to work seamlessly within the products/desktop directory. The skill also emphasizes the importance of adhering to the unique architecture and style guidelines outlined in the AGENTS.md document, which serves as the primary reference for development practices in this workspace.

One of the key features of this skill is its strict scope contract, which prevents developers from inadvertently accessing or modifying files outside of the designated directory unless explicitly instructed. This minimizes the risk of introducing errors or inconsistencies that could arise from mixing conventions or dependencies from other parts of the PostHog codebase. Additionally, the skill includes guidance on how to handle interactions with the Django API, ensuring that any necessary changes are managed correctly and efficiently.

Overall, the PostHog Desktop skill is an essential tool for developers focused on enhancing the PostHog desktop application. It provides a structured environment that fosters best practices and maintains the integrity of the codebase, making it easier to contribute effectively to the project.

When to use it

Use this skill when developing or testing features for the PostHog desktop application, ensuring that you are working within the correct environment.

When not to use it

This skill is not suitable for general PostHog development outside of the desktop application, as it is specifically tailored for that context.

What you can build with it

Developing New Features

When adding new features to the PostHog desktop app, use this skill to ensure you are working within the correct environment.

Testing Desktop Functionality

Utilize this skill to run tests specific to the PostHog desktop application without interference from other components.

Integrating Backend Changes

When backend API changes are required, this skill helps manage the necessary adjustments while keeping the desktop app's integrity intact.

How to install PostHog Desktop

View source

1. Install with the skills CLI

npx skills add posthog/posthog/posthog-desktop --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by posthog

Working in products/desktop

products/desktop/ is the PostHog desktop app (Electron + agent framework), imported from PostHog/code and kept as a nested standalone workspace: own pnpm-workspace.yaml, own lockfile, own Biome config, Node 22. It is excluded from the root pnpm-workspace.yaml, from ruff/mypy, from root Jest, from oxlint/oxfmt, from stylelint and from pytest.

Read products/desktop/AGENTS.md before writing code in this tree. It is the source of truth for architecture, layer boundaries, DI, and style. This skill only covers the scoping contract around it.

Scope contract

Default: everything you read, edit, run and test lives under products/desktop/. Run all commands with that as cwd. Do not go fishing in frontend/, posthog/, or other products/* for patterns — the desktop tree has its own, and copying monorepo idioms in is a defect.

Step outside only when one of these is true:

  1. The user explicitly tells you to.
  2. A backend API the app calls needs to change. The client is packages/api-client/; the endpoints it hits live in the Django monorepo (see below).
  3. Desktop CI / config that lives at the root by design. The list is fixed — see products/desktop/MIGRATION.md "Root-repo changes (outside products/desktop/)": .github/workflows/desktop-*.yml, .github/actions/desktop-*/, .github/scripts/products/desktop/, and the exclusion entries in pnpm-workspace.yaml, pyproject.toml, pytest.ini, package.json (lint:css), frontend/jest.config.ts, .dockerignore, .oxlintrc.json, .oxfmtrc.json, .config/.markdownlint-cli2.jsonc, .github/workflows/ci-{frontend,storybook,backend}.yml (+ .depot/workflows/ci-backend.yml). Touch these only to keep an exclusion correct; say so when you do.

Anything else outside the tree: stop and ask.

Toolchain — root CLAUDE.md does not apply here

Root monorepo saysIn products/desktop use
ruff / mypy / pytestnothing — no Python app code here
oxlint + Oxfmt, pnpm --filter=@posthog/frontend fixpnpm lint (Biome check --write), pnpm format
Jest, hogli testVitest (pnpm test), Playwright (pnpm test:e2e)
pnpm --filter=@posthog/frontend typescript:checkpnpm typecheck (turbo, all packages)
Kea logics, typegen:writeZustand stores + InversifyJS services; no kea, no typegen
LemonUI in frontend/ and products/*/frontend/@posthog/quill + Tailwind + Radix Themes
hogli build:openapi → generated frontend typespackages/api-client/src/generated.ts (hand-maintained here)
4-space / repo Prettier habitsBiome, 2-space, double quotes

Commands (from products/desktop/): pnpm install, pnpm dev, pnpm build, pnpm typecheck, pnpm lint, pnpm test, pnpm test:e2e, pnpm --filter <pkg> <task>, node scripts/check-host-boundaries.mjs.

Never run root-level pnpm install expecting it to cover desktop, and never let a desktop dependency change alter the root lockfile — the root install must stay byte-identical.

What still applies from the root

  • Conventional commits and PR titles; scope of desktop (e.g. fix(desktop/$feature): ...).
  • .github/pull_request_template.md structure, including the Agent context section.
  • Public-repo copy safety: no customer names, internal incidents, or Slack quotes.
  • Merging: gh pr merge <number> --squash into master. AGENTS.md "Merging PRs" and products/desktop/.claude/skills/merging-prs/ are stale — they describe the PostHog/code Trunk queue against main, which does not exist here. products/desktop/POST-MIGRATION.md has the correct flow.
  • hogli ci:preflight on push (pre-push hook) still runs repo-wide.

Cross-boundary: the Django API

packages/api-client/ calls monorepo endpoints — tasks (/api/projects/:id/tasks/...), signals, agent applications, environments/MCP installations, /api/users/. When a change needs the backend:

  • Read the Django side to get the contract right; that is in scope without asking.
  • Editing it is a separate, monorepo-side change: root CLAUDE.md rules apply again (/improving-drf-endpoints, /django-migrations, serializer help_text, hogli build:openapi).
  • Keep the two sides in one PR only if they must ship together; otherwise land the backend first.
  • Wiring the app at a local Django instance (OAuth app, RSA keys, flags) is products/desktop/docs/LOCAL-DEVELOPMENT.md.

Resync hazard

The tree is a verbatim copy of PostHog/code at a pinned SHA. A resync replaces it wholesale, so edits to imported files are lost unless they are upstreamed or listed as intentional drift. Before changing a file, consider whether the fix belongs upstream in PostHog/code. The drift list, the local security patches that must be reapplied, and the monorepo-only files (MIGRATION.md, POST-MIGRATION.md, product.yaml, docs/plan.md) are in products/desktop/MIGRATION.md. Do not delete or "clean up" monorepo-only files.

Desktop-local skills

products/desktop/.claude/skills/ ships its own: test-electron-app (drive the running app over CDP :9222), quill-code, storybook-stories, canvas-templates, merging-prs (stale, see above). Prefer these over monorepo equivalents while in this tree.

Before reporting done

  • pnpm typecheck and pnpm lint from products/desktop/, plus pnpm test for touched packages.
  • After touching packages/core: biome lint packages/core, zero noRestrictedImports.
  • After touching @posthog/platform: rebuild or typecheck its dist/.
  • After moving logic out of apps/code: node scripts/check-host-boundaries.mjs --prune.
  • Confirm the diff touches nothing outside products/desktop/ — or name what it touches and why.

Frequently asked questions about PostHog Desktop

Similar skills