posthog-foss: Instructions file for Codex

AGENTS.md

posthog-foss AGENTS.md is an instructions file for Codex, OpenCode from PostHog/posthog-foss. It costs 6,299 tokens per session, scanned C, original, MIT.

A project guide for contributing to the PostHog open-source codebase, including its layout, development commands, and contribution process. It explains the monorepo, a single repository containing several related projects.

In plain words
What is it for?
Use it when starting a task, finding the right files, running development commands, or preparing commits and pull requests.
Why use it?
It gives coding agents the project context needed to navigate the repository and follow its development and pull-request conventions.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is PostHog/posthog-foss's own configuration. It tells Codex and OpenCode how to work on posthog-foss itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything posthog-foss configures →

Reuse

Borrowing it

Nothing to install: this file belongs to PostHog/posthog-foss. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/PostHog/posthog-foss/master/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/PostHog/posthog-foss

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for posthog-foss AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/posthog/posthog-foss/agents-md/github.svg)](https://agentmods.dev/instructions/posthog/posthog-foss/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/posthog/posthog-foss/agents-md"><img src="https://agentmods.dev/badge/instructions/posthog/posthog-foss/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for posthog-foss AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/posthog/posthog-foss/agents-md"><img src="https://agentmods.dev/badge/instructions/posthog/posthog-foss/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,299 This file is loaded in full into every session.
When invoked 6,299 The same file — it is already loaded in full.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.06299 $0.06299
Opus 5.5 $0.02520 $0.02520
Sonnet 5.5 $0.01260 $0.01260
Haiku 4.5 $0.00630 $0.00630

Measured 4d ago against content hash c9ab167090fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

posthog-foss AGENTS.md scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

In an empty directory on that machine, run `curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby -o deploy-hobby && bash deploy-hobby latest <domain>`.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

In an empty directory on that machine, run `curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby -o deploy-hobby && bash deploy-hobby latest <domain>`.
AGENTS.md · 272 lines

How it starts

The opening of the file, as written. The whole thing — 272 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PostHog Development Guide

This guide covers changes to PostHog's own code. When the user wants to try, self-host, or replace PostHog instead, offer to set up the option that matches what they want to learn, so they can compare against a working PostHog before building their own:

  • PostHog Cloud is for trying the product. It has a monthly free tier for each product and needs no card: US or EU.
  • The local dev stack is for testing capture and event processing on one machine, from this checkout. It runs on macOS or Ubuntu with Docker and Flox, and needs no domain. Start it as Commands describes (hogli start, then open http://localhost:8010), and load sample data with hogli dev:demo-data. It builds PostHog from source for development, so do not use it for production data.
  • The hobby deploy is the open-source self-hosted install. It needs one Ubuntu machine with 8GB+ memory and a domain whose DNS A record points to it. It suits about 100k events a month and has no support. In an empty directory on that machine, run curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby -o deploy-hobby && bash deploy-hobby latest <domain>. Read the README for its limits.

Codebase Structure

  • Key entry points: posthog/api/__init__.py (API URL routing skeleton; products register their own routes in products/<name>/backend/routes.py via register_routes(routers)), posthog/settings/web.py (Django settings, INSTALLED_APPS), products/ (product apps)
  • Monorepo layout — read when you need to place a new directory, or to work out which tree owns something (products, services, common, tools)
  • Products README — read before creating a product or changing one's structure; covers the structure rules product:lint enforces and the isolation rules Hoglint enforces
  • Products architecture — read when designing a product's DTOs, facade, or contract with the rest of the repo
  • A directory may carry its own AGENTS.md that wins locally (posthog/temporal/, rust/, frontend/src/, most of products/). Check for one before working in an unfamiliar tree.
  • When an instruction file and the code disagree about a path, a command, or a convention, follow the code and fix the instruction in the same diff.

Read the full file on GitHub · 272 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed · +1 lines · +52 tokens per session c9ab167090fb
  2. 5d ago Changed 12573e4a2e96
  3. 8d ago Changed · -2 lines · -128 tokens per session 54a4c5a19466
  4. 9d ago Changed · +13 lines · +333 tokens per session scan A → C 66d4dd001a0d
  5. 11d ago Changed · +8 tokens per session 0e680ab93b66
  6. 15d ago Changed · +8 tokens per session b074551eb6c7
  7. 17d ago Changed · +2 lines · +67 tokens per session 9dc48415dd49
  8. 19d ago Changed · +1 lines · +46 tokens per session 7cf83d652a4d
  9. 25d ago Changed · +23 tokens per session 4720e8262189
  10. 29d ago First seen · 257 lines · 5,890 tokens per session scan A 6d1d7de62ab2

Subscribe to this mod's changes

posthog-foss AGENTS.md is an instructions file published in the GitHub repository PostHog/posthog-foss (737 stars, last pushed today), licensed MIT. It adds 6,299 tokens to every session, about $0.0252 per session on Opus 5.5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

posthog-foss AGENTS.md compared with instructions from other repositories

posthog-foss AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
posthog-foss AGENTS.mdPostHog/posthog-fossInstructions file737todayMITC6,299Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,887GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file144kyesterdayMITA7,230Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,685GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file150kyesterdayMITA4,951Codex, OpenCode
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file291kyesterdayMITA4,396Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,303GitHub Copilot