payload CLAUDE.md

A project instruction file for Payload CMS, a system for building content-managed websites and applications. It explains the monorepo layout, major packages, testing areas, and deployment-related folders.

In plain words
What is it for?
Use it when modifying Payload's Next.js-based codebase, database integrations, storage or email adapters, plugins, GraphQL layer, or feature tests.
Why use it?
It helps coding agents understand where Payload's core, user interface, database adapters, plugins, and tests belong before making changes.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/payloadcms/payload/claude-md
Clone the repo
git clone --depth 1 https://github.com/payloadcms/payload
Per session 5,127 This file is loaded in full into every session.
When invoked 5,127 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.05127 $0.05127
Opus 5 $0.02563 $0.02563
Sonnet 5 $0.01025 $0.01025
Haiku 4.5 $0.00513 $0.00513

Measured 2d ago against content hash 3e403a5c09e1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

payload CLAUDE.md scanned grade A with 0 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 463 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) and Cursor when working with code in this repository.

Project Structure

Payload is a monorepo structured around Next.js, containing the core CMS platform, database adapters, plugins, and tooling.

Key Directories

  • packages/ - All publishable packages
    • packages/payload - Core Payload package containing the main CMS logic
    • packages/ui - Admin UI components (React Server Components)
    • packages/next - Next.js integration layer
    • packages/db-* - Database adapters (MongoDB, Postgres, SQLite, Vercel Postgres, D1 SQLite)
    • packages/drizzle - Drizzle ORM integration
    • packages/kv-redis - Redis key-value store adapter
    • packages/richtext-* - Rich text editors (Lexical)
    • packages/storage-* - Storage adapters (S3, Azure, GCS, Vercel Blob, R2)
    • packages/email-* - Email adapters (Nodemailer, Resend)
    • packages/plugin-* - Additional functionality plugins
    • packages/graphql - GraphQL API layer
    • packages/translations - i18n translations
  • test/ - Test suites organized by feature area. Each directory contains a granular Payload config and test files
  • docs/ - Documentation (deployed to payloadcms.com)
  • tools/ - Monorepo tooling
  • templates/ - Production-ready project templates
  • examples/ - Example implementations

Architecture Notes

  • Payload 3.x is built as a Next.js native CMS that installs directly in /app folder
  • UI is built with React Server Components (RSC)
  • Database adapters use Drizzle ORM under the hood
  • Packages use TypeScript with strict mode and path mappings defined in tsconfig.base.json
  • Source files are in src/, compiled outputs go to dist/
  • Monorepo uses pnpm workspaces and Turbo for builds

Quick Start

  1. pnpm install
  2. pnpm run build:core
  3. pnpm run dev (MongoDB) or pnpm run dev:postgres

Build Commands

  • pnpm install - Install all dependencies
  • pnpm turbo - All Turbo commands should be run from root with pnpm - not with turbo directly
  • pnpm run build or pnpm run build:core - Build core packages (excludes plugins and storage adapters)
  • pnpm run build:all - Build all packages
  • pnpm run build:<directory_name> - Build specific package (e.g. pnpm run build:db-mongodb, pnpm run build:ui)

Read the full file on GitHub · 463 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. 2d ago First seen · 463 lines · 5,127 tokens per session scan A 3e403a5c09e1

Subscribe to this mod's changes

payload CLAUDE.md is an instructions file published in the GitHub repository payloadcms/payload (44,499 stars, last pushed 4d ago), licensed MIT. It adds 5,127 tokens to every session, about $0.0256 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

sonicjs AGENTS.md

Instructions for SonicJs-Org/sonicjs, covering sonicjs agent guidelines, decision tree — code exploration, rtk (rust token killer), caveman mode and delegation — cavecrew subagents.

SonicJs-Org/sonicjs · 2,447 tokens

webiny-js AGENTS.md

AGENTS.md instructions for webiny/webiny-js, covering exploration, persist learnings, code, building and testing.

webiny/webiny-js · 820 tokens

webiny-js CLAUDE.md

Claude Code instructions for webiny/webiny-js, covering context, claude project guidelines, reading code, development commands and install dependencies (suppress all output – it's noise).

webiny/webiny-js · 555 tokens

sonicjs CLAUDE.md

Instructions for SonicJs-Org/sonicjs, covering sonicjs ai development guidelines, core technology stack, workspace boundary (conductor), architecture direction: document model (authoritative) and the 5 document tables (migration 0002documents.sql).

SonicJs-Org/sonicjs · 4,697 tokens

webiny-js copilot-instructions.md

Copilot instructions for webiny/webiny-js, a project described as: Open-source, self-hosted CMS platform on AWS serverless (Lambda, DynamoDB, S3). TypeScript framework with multi-tenancy, lifecycle hooks, GraphQL API, and AI-assisted development via MCP server. Built for developers at large organizations.

webiny/webiny-js · 57 tokens

flowwink CLAUDE.md

Instructions for magnusfroste/flowwink, covering claude.md, commands, development (auto-runs migrations before starting), production build and lint.

magnusfroste/flowwink · 7,029 tokens