Config Claude Coding

CLAUDE.md for a PHP project

A project file that stops Claude Code rewriting your conventions, reformatting untouched files or inventing a framework you do not use.

AI Place Hub 1
Configuration markdownCopied
# Project

PHP 8.1, no framework. MariaDB via PDO. nginx. Deployed by uploading files - there is no build step.

## Rules

- Make the smallest edit that solves the problem. Do not reformat code you were not asked to change.
- Never introduce a dependency, a package manager or a build step without asking first.
- Follow the conventions already in the file you are editing, even where they differ from your defaults.
- All SQL goes through prepared statements. No string interpolation into queries, ever.
- Escape on output with htmlspecialchars($v, ENT_QUOTES, 'UTF-8'), not on input.
- UTF-8 throughout. Do not add HTML entities, escapes or encoding conversions to text.

## Layout

- config/  - bootstrap, database, shared helpers
- pages/   - one file per route, rendered by the front controller
- api/     - JSON endpoints, each validates permissions itself
- assets/  - plain CSS and JS, no compilation

## When you are done

State which files you changed and why. If you could not finish something, say so plainly instead of leaving a stub that looks complete.

Notes from the author

Put this in the repository root. Claude Code reads it at the start of every session, so it replaces the block of rules most people paste into their first message. Trim it - a long file dilutes the rules that matter. The "no build step" line is the one that saves the most time on projects deployed by FTP.

Fork

Did this work for you?

Sign in to flag it

Related