# Set Up: Ultra-Compressed CLAUDE.md System Prompt for Maximum Context Efficiency
## What This Is
A structured CLAUDE.md template using XML-like shorthand notation that communicates your project architecture, conventions, and preferences to Claude Code in under 300 tokens — compared to the typical 800+. Uses abbreviation schemas and tiered priority markers.
Source: https://github.com/anthropics/claude-code/discussions/284
## Before You Start
Scan my workspace and analyze:
- The project language, framework, and directory structure
- Existing agent configuration (check for .claude/, .codex/, CLAUDE.md, settings.json, commands/, skills/ directories)
Then ask me before proceeding:
1. Should this be a slash command (.claude/commands/*.md) or added to CLAUDE.md as persistent context?
2. Any project-specific values I should customize in the prompt?
## What to Implement
This is a **Command Template** — a reusable slash command or system prompt.
- Create the command file based on my answer above (either `.claude/commands/[name].md` or add to `CLAUDE.md`)
- Adapt any placeholder values to my project specifics
- If the command references specific tools or APIs, wire it to what I already have configured
## Additional Context
- Replace verbose CLAUDE.md prose with the compressed schema: use P1/P2/P3 markers for priority, abbrev tech names (TS, PG, RQ for TypeScript, PostgreSQL, React Query), and collapse repeated patterns into single-line rules.
- Add a "FORBIDDEN" block at the top listing anti-patterns Claude should never produce — this is 10x more token-efficient than explaining why not to do each thing.
- Benchmark your current CLAUDE.md by pasting it into the Claude.ai tokenizer, then compare after applying the compressed format — most users see 55–65% reduction.
## Reference Implementation
```
# CLAUDE.md — compressed schema v2
## PROJECT
stack: Next15·TS5·PG16·Drizzle·RQ5·shadcn
arch: app-router·RSC-first·server-actions
deploy: Vercel·edge-functions
## RULES [P1=critical P2=important P3=prefer]
P1: never-client-components-for-data-fetch
P1: drizzle-not-prisma — schema in /db/schema.ts
P2: zod-validation-all-inputs
P2: error-boundaries-all-async
P3: prefer-server-actions-over-api-routes
## FORBIDDEN
- any useState for server-fetchable data
- inline SQL strings
- console.log in production paths
- @ts-ignore without explanation comment
```
## Guidelines
- Adapt everything to my existing project — do not assume a specific stack or directory layout
- Review any fetched code for safety before installing or executing it
- After setup, run a quick verification and show me a summary of exactly what was installed, where, and how to use it