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.
curl -O https://raw.githubusercontent.com/PostHog/posthog-foss/master/AGENTS.mdgit clone --depth 1 https://github.com/PostHog/posthog-fossWrote 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.
[](https://agentmods.dev/instructions/posthog/posthog-foss/agents-md)<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.
<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>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.
| Model | Per session | Once 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 |
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 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 inproducts/<name>/backend/routes.pyviaregister_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:lintenforces - 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.mdthat wins locally (posthog/temporal/,rust/,frontend/src/, most ofproducts/). Check for one before working in an unfamiliar tree.
Commands
- Environment:
- This is a full dev environment with
node,pnpm, a package mirror andapt. A missingnode_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, noapt, 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 activatein interactive sessions (it hangs if you try)
- Never use
- This is a full dev environment with
- 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
- Universal:
- Lint:
- Python:
ruff check . --fixandruff format .
- Frontend:
pnpm --filter=@posthog/frontend fix(safe Oxlint fixes + Oxfmt; suggestion fixes are not applied).formatruns Oxfmt only;lintandformat:checkonly verify. - TypeScript check:
pnpm --filter=@posthog/frontend typescript:check
- Python:
- Build:
- Frontend:
pnpm --filter=@posthog/frontend build - Start dev:
./bin/startorhogli start(interactive TUI). Detached mode:hogli up -dpaired withhogli wait/hogli down- In a PostHog Tasks cloud run (
POSTHOG_TASK_RUN_IDset), the boot sequence, prewarmed test database and scoped-test rules differ — read Cloud task sandbox before starting the stack or running tests there
- In a PostHog Tasks cloud run (
- Frontend:
- 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 ahogli_feedbackevent (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.
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.
- yesterday Changed · +2 lines · +87 tokens per session 29a5a71eb62b
- 4d ago Changed · +1 lines · +47 tokens per session cabaaed6a623
- 7d ago Changed · +3 lines · +41 tokens per session 2c8ad9a88d29
- 11d ago Changed · +4 lines · +133 tokens per session 38a561c96bc6
- 12d ago Changed · -88 tokens per session 09de9a0b9964
- 14d ago Changed · +21 tokens per session 4b91c572a691
- 19d ago Changed · +66 tokens per session e3309923c7b5
- 20d ago Changed · +87 tokens per session 9e4fa91e5cc5
- 21d ago Changed · +65 tokens per session 613762c2407f
- 22d ago First seen · 327 lines · 10,032 tokens per session scan B 16487429c1b2
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.
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).
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.
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).
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.
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).
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.