posthog-foss: Instructions file for Claude Code

AGENTS.md

posthog-foss AGENTS.md is an instructions file for Claude Code, Codex, OpenCode from PostHog/posthog-foss. It costs 10,491 tokens per session, scanned B, 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 Claude CodeCodexOpenCode

Written for Claude Code and Codex and OpenCode: SessionStart hook event, but also the file is AGENTS.md. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions subagents.

This is PostHog/posthog-foss's own configuration. It tells Claude Code, 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: Claude Code, 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 10,491 This file is loaded in full into every session.
When invoked 10,491 The same file — it is already loaded in full.
Security scan B 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.10491 $0.10491
Opus 5.5 $0.04196 $0.04196
Sonnet 5.5 $0.02098 $0.02098
Haiku 4.5 $0.01049 $0.01049

Measured yesterday against content hash 29a5a71eb62b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

posthog-foss AGENTS.md scanned grade B 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 yesterday.

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.

Reads MCP configurationmediumAgent snooping

mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.

- CI uploads test results to Trunk Flaky Tests; the `trunk` MCP server in `.mcp.json` queries per-test flakiness on a PR or `master` (authenticate via `/mcp`, or a `TRUNK_API_TOKEN` bearer header when headless) — see `/d

Makes network callslowCapability

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

- **Every other call to those hosts goes through `posthog/egress/` too.** `[lint: github-api-calls-go-through-egress-wide, slack-api-calls-go-through-egress-wide]` The wide rules catch a URL bound to a variable or consta
AGENTS.md · 337 lines

How it starts

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

PostHog Development Guide

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 isolation rules product:lint 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.

Commands

  • Environment:
    • This is a full dev environment with node, pnpm, a package mirror and apt. A missing node_modules, browser binary or flox means setup has not run yet (pnpm install, npx playwright install --with-deps chromium), not that running things is impossible — install it and continue. Report "can't run" only for a specific, nameable failure (no network, no apt, out of memory), alongside whatever fallback you took.
    • Visual and UX work is not confirmed by reading the code. Render the affected surface (the running app, or Storybook via a headless browser) and compare before and after. Worth the setup cost. A story written only for this check is scratch: keep it out of the commit.
    • Use flox when available — prefer flox activate -- bash -c "<command>" if commands fail
      • Never use flox activate in interactive sessions (it hangs if you try)
  • Tests:
    • Universal: hogli test <file_or_directory> — auto-detects test type (Python, Jest, Playwright, Rust, Go)
    • Single test: hogli test path/to/test.py::TestClass::test_method
    • Watch mode: hogli test path/to/test.py --watch
    • Changed files only: hogli test --changed
  • Lint:
    • Python:
      • ruff check . --fix and ruff format .
    • Frontend: pnpm --filter=@posthog/frontend fix (safe Oxlint fixes + Oxfmt; suggestion fixes are not applied). format runs Oxfmt only; lint and format:check only verify.
    • TypeScript check: pnpm --filter=@posthog/frontend typescript:check
  • Build:
    • Frontend: pnpm --filter=@posthog/frontend build
    • Start dev: ./bin/start or hogli start (interactive TUI). Detached mode: hogli up -d paired with hogli wait / hogli down
      • In a PostHog Tasks cloud run (POSTHOG_TASK_RUN_ID set), the boot sequence, prewarmed test database and scoped-test rules differ — read Cloud task sandbox before starting the stack or running tests there
  • OpenAPI/types: hogli build:openapi (regenerate after changing serializers/viewsets)
  • Dev experience feedback: hogli devex:feedback "<message>" sends feedback about repo tooling — hogli, the dev stack, tests, CI, migrations, this setup — straight to the devex team as a hogli_feedback event (add -c bug|idea|praise|question). Local agents must use it too: when a hogli command or local dev workflow is broken, slow, or confusing, run it — e.g. hogli devex:feedback -c bug "migrations:run failed with <error>". Do not run it from cloud tasks or agent-server sandboxes; the command is a no-op there.

Read the full file on GitHub · 337 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. yesterday Changed · +2 lines · +87 tokens per session 29a5a71eb62b
  2. 4d ago Changed · +1 lines · +47 tokens per session cabaaed6a623
  3. 7d ago Changed · +3 lines · +41 tokens per session 2c8ad9a88d29
  4. 11d ago Changed · +4 lines · +133 tokens per session 38a561c96bc6
  5. 12d ago Changed · -88 tokens per session 09de9a0b9964
  6. 14d ago Changed · +21 tokens per session 4b91c572a691
  7. 19d ago Changed · +66 tokens per session e3309923c7b5
  8. 20d ago Changed · +87 tokens per session 9e4fa91e5cc5
  9. 21d ago Changed · +65 tokens per session 613762c2407f
  10. 22d ago First seen · 327 lines · 10,032 tokens per session scan B 16487429c1b2

Subscribe to this mod's changes

posthog-foss AGENTS.md is an instructions file published in the GitHub repository PostHog/posthog-foss (725 stars, last pushed today), licensed MIT. It adds 10,491 tokens to every session, about $0.0420 per session on Opus 5.5. A static security scan graded it B with 2 findings (reads mcp configuration, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 9,649 tokens

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,384 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens