Jeffrey Hicks

Jeffrey Hicks

Platform Eng @R360

How to Create the Perfect CLAUDE.md File for Claude Code

Daniel Bergholz explains how to properly configure the CLAUDE.md file for optimal use with Claude Code, covering essential customizations, MCP tools, and development workflows

By Daniel Bergholz • Aug 20, 2025

This video by Daniel Bergholz explains how to properly configure the CLAUDE.md file for optimal use with Claude Code, transforming it from a simple code generator into a full-blown development agent.

Initial Setup

The video assumes you already have Claude Code installed and connected to your account. The first step is running the init command in your project directory, which generates an initial CLAUDE.md file with a high-level overview of your codebase.

Essential Customizations

1. Format and Check Scripts

The most important addition to the default CLAUDE.md file is instructions for formatting and checking code after generation:

  • Add a format command that Claude should run after writing code (e.g., mix format for Elixir, npm run format for JavaScript)
  • Add a check script to verify there are no errors or warnings (e.g., mix check, TypeScript checking, linting)
  • Order matters: Always format first, then check, to avoid formatting warnings

2. Remove Unnecessary Sections

The default “commands” section listing available scripts is unnecessary since Claude can read these directly from configuration files like mix.exs or package.json.

3. MCP (Model Context Protocol) Tools

For comprehensive testing capabilities, add MCP tools:

  • Tidewave MCP for Elixir projects
  • Playwright MCP for browser testing and front-end interaction
  • Context 7 for fetching updated documentation

Practical Tips

  • The Pro plan ($20/month) provides predictable billing with usage limits that reset after 5 hours, rather than pay-per-use pricing
  • Create development-only routes for authentication testing (e.g., /xray/username to auto-login as specific users)
  • Be explicit in the CLAUDE.md file about when to use each tool (e.g., “run Tidewave MCP after changing Elixir code”)

Example Workflow

For a project using Elixir with React/Inertia:

  1. Claude generates code
  2. Runs mix format.all (formats both Elixir and React code)
  3. Runs mix check (compilation checks, linting, code quality)
  4. Uses Tidewave MCP for Elixir testing
  5. Uses Playwright MCP for front-end testing

This setup transforms Claude from a simple code generator into a full-blown development agent capable of writing, formatting, checking, and testing code autonomously.

References

  1. How to Create the Perfect CLAUDE.md File for Claude Code

Related

#phoenix-and-elixir #daniel-bergholz