Most project instructions for coding agents are copied from a template. The commands in them often don't exist in your repo, so the agent runs them, fails, and guesses. For Drupal this is worse than usual, because "a Drupal project" can mean three very different things: a full site, a single contrib module, or a distribution. This post shows how to write a CLAUDE.md (or AGENTS.md ) by reading the repository first, using two real public repos:
localgovdrupal/localgov_directories , a contrib module
drupal/cms , the Drupal CMS project template (branch 2.2.x )
Step 1: find out what kind of repo it is
grep -n '"type"' composer.json ls -a | head -40
Enter fullscreen mode
Exit fullscreen mode
In localgov_directories , composer.json says "type": "drupal-module" and the root holds localgov_directories.info.yml . There is no web/ directory, no vendor/ , no Drush.…