Getting Started
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.
Set Up Your Environment
Follow the Local Development Setup guide to get PostHog running locally.
Commit Message Convention
PostHog uses Conventional Commits for all commit messages and PR titles.Format
Commit Types
feat - New features or functionality
feat - New features or functionality
fix - Bug fixes
fix - Bug fixes
chore - Non-production changes
chore - Non-production changes
- 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: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.
- 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
Approved and Merged
Approved and Merged
Your PR is approved and merged to master. Changes deploy to PostHog Cloud automatically.
Changes Requested
Changes Requested
Reviewers may ask for:
- Code changes or refactoring
- Additional tests
- Documentation updates
- Explanation of approach
Escalated or Deferred
Escalated or Deferred
For security-sensitive or critical paths, unclear product impact, or during high support load, another engineer may pick it up later.
Closed
Closed
We sometimes close PRs that are:
- Out of scope for PostHog
- Would add long-term maintenance burden
- Stale (no activity for extended period)
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_requestor@extend_schema - Team filtering → Always filter querysets by
team_id - Team extensions → Don’t add domain fields to
Teammodel, 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
describeblock in Jest tests
Security
SQL Safety:AGENTS.md for full security guidelines.
Working with Products
Creating a New Product
- Register in
posthog/settings/web.pyunderPRODUCTS_APPS - Update
tach.tomlwith import boundaries - Add API routes in
posthog/api/__init__.py - Verify with
bin/hogli product:lint your_product_name
Migrations
Moving models from
posthog/ to products/? Use migrations.SeparateDatabaseAndState to avoid dropping tables. See examples in the codebase.Paid Features
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
- Monorepo Structure - Understanding the codebase layout
- Development Setup - Local environment setup
- Testing Guide - How to write and run tests
- Developing Locally - Full handbook guide