Writing

Claude · 2 min read

Put Project Quirks in CLAUDE.md

I spent 45 minutes teaching Claude a fix I already knew. Putting that project quirk in CLAUDE.md stopped the same rediscovery next time.

In this article3 sections

I spent 45 minutes and thirty requests asking Claude Code to fix a build. I changed the wording, supplied examples, and pasted different errors.

I already knew the fix. I had never written it down for Claude.

In this example, I used Claude Code’s web interface. It loads a CLAUDE.md file from your project root at the start of every session.

Architecture is usually already visible in the repository. The useful additions are the gotchas, edge cases, and commands that only work from one directory.

Without Quirks Documented

Claude encounters pnpm typecheck failing from a package directory. Claude asks: “Are you in a monorepo? Are you using pnpm? Where should I run this?” You explain the architecture. Claude fixes it. Next task: same questions, same exploration, same delay.

With CLAUDE.md

The instruction gives Claude a place to start: “This project’s aggregate typecheck script lives at the repository root. Run pnpm run typecheck there.” It can try the expected command before investigating the build.

What Goes in CLAUDE.md

Record the working commands Write down the exceptions and commands that are hard to infer from the code.

The instructions should describe this project’s scripts, not invent rules about pnpm itself:

## Workspace commands

- Install from the repository root with pnpm install.
- Run the root typecheck script: pnpm run typecheck.
- Build the web package: pnpm --filter @workspace/web run build.
- Test the utility package: pnpm --filter @workspace/utils run test.
- Check package.json for the exact script and package names.

pnpm also supports running scripts from a package directory and adds the workspace root’s binaries to script PATH. Its run documentation and filtering reference explain those rules. An exact package name avoids ambiguity; partial names do not universally fail.

Turn the next repeated failure into a short instruction. Record the error, the directory to run from, the working command, and what a successful result looks like. Use the project’s actual script names so the next session can verify the fix.

I still check whether the build passes. The instruction saves Claude from rediscovering where to run it.

Was this useful?

What was missing?

Thanks for the feedback.