Skip to main content
We welcome contributions to PostHog. This guide explains how to contribute effectively, what to expect during review, and how we work with external contributors.

Getting Started

1

Find or Create an Issue

Before writing code, check if an issue exists:
  • Browse existing issues
  • Create a new issue if needed
  • Discuss the approach in the issue
We don’t assign issues to individuals. If you want to work on something, just create a pull request and link the issue.
2

Set Up Your Environment

Follow the Local Development Setup guide to get PostHog running locally.
3

Create a Branch

Commit Message Convention

PostHog uses Conventional Commits for all commit messages and PR titles.

Format

Commit Types

Use for any change that touches production code and adds functionality.
Use for any change that fixes a bug in production code.
Use for:
  • Documentation updates
  • Test changes
  • Config updates
  • CI/CD changes
  • Refactoring without behavior changes
  • Agent instructions updates

Scope Convention

Rules

  • Scope is optional but encouraged
  • Description must be lowercase
  • No period at the end
  • Keep first line under 72 characters

Creating a Pull Request

Before Submitting

Ensure your PR is ready for review:
1

Run Tests Locally

2

Format Code

3

Resolve Merge Conflicts

PR Description

Write a clear description:

PR Checklist

  • ✅ Tests pass locally
  • ✅ Code is formatted (ruff/oxfmt)
  • ✅ No merge conflicts
  • ✅ Conventional commit format
  • ✅ Added tests for new functionality
  • ✅ Updated docs if needed
  • ✅ Followed existing patterns

Review Process

What to Expect

External PRs are triaged via CODEOWNERS. The current week’s Support Hero for the owning team is usually the first point of contact.Customer support takes priority, so reviews can be delayed when support load is high. Expect acknowledgement when we have bandwidth; thorough reviews may come later.
Timeline expectations:
  • Initial acknowledgement: Few days to 2 weeks
  • Full review: Depends on complexity and support load
  • Merge: After approval and CI passes

Before Full Review

Please ensure:
  • Tests pass locally and merge conflicts are resolved
  • You’ve responded to automated review feedback (e.g., Greptile comments)
  • The change is focused and includes tests where appropriate
  • You’ve followed existing patterns and conventions

Review Outcomes

Your PR is approved and merged to master. Changes deploy to PostHog Cloud automatically.
Reviewers may ask for:
  • Code changes or refactoring
  • Additional tests
  • Documentation updates
  • Explanation of approach
Address feedback and push new commits.
For security-sensitive or critical paths, unclear product impact, or during high support load, another engineer may pick it up later.
We sometimes close PRs that are:
  • Out of scope for PostHog
  • Would add long-term maintenance burden
  • Stale (no activity for extended period)
You’re always welcome to reopen with updates.
We sometimes reward helpful contributions with merch even if a PR doesn’t merge.

Contribution Guidelines

Code Style

Architecture Guidelines

  • New features → Create in products/ directory
  • API views → Declare request/response schemas with @validated_request or @extend_schema
  • Team filtering → Always filter querysets by team_id
  • Team extensions → Don’t add domain fields to Team model, use extension pattern
See Architecture Overview and Product Architecture for detailed patterns.

Testing Requirements

  • Add tests for new functionality
  • Prefer parameterized tests over multiple assertions
  • Test team isolation for security
  • No doc comments in Python tests
  • Single top-level describe block in Jest tests

Security

SQL Safety:
HogQL Safety:
See AGENTS.md for full security guidelines.

Working with Products

Creating a New Product

Then:
  1. Register in posthog/settings/web.py under PRODUCTS_APPS
  2. Update tach.toml with import boundaries
  3. Add API routes in posthog/api/__init__.py
  4. Verify with bin/hogli product:lint your_product_name
See Product Architecture for details.

Migrations

Moving models from posthog/ to products/? Use migrations.SeparateDatabaseAndState to avoid dropping tables. See examples in the codebase.
We prefer not to accept external contributions for paid features.
If you don’t see the feature on your local build, it’s most likely paid. Ask in the issue before working on it.

Getting Help

GitHub Issues

Report bugs or request features

Community

Ask questions and get help

Handbook

How we review PRs

Roadmap

See what we’re building

Additional Resources

Thank You

We appreciate every contribution, whether it’s code, bug reports, feature requests, or documentation improvements. Thank you for helping make PostHog better!