Skip to content

Instantly share code, notes, and snippets.

@mikedotexe
Created July 2, 2025 23:55
Show Gist options
  • Select an option

  • Save mikedotexe/a45473494cb9673a25b647075b1a66f7 to your computer and use it in GitHub Desktop.

Select an option

Save mikedotexe/a45473494cb9673a25b647075b1a66f7 to your computer and use it in GitHub Desktop.
Helpful CLAUDE.md section whilst developing software with build cycles where the build errors beget information-rich context

CLAUDE.md — AI-Optimized Documentation for Claude Code

This file provides comprehensive guidance to Claude Code (claude.ai/code) when working with this repository. It emphasizes technical continuity, autonomous development workflows, and architectural understanding.

Critical Context for AI Sessions

Autonomous Development Workflow

Available Scripts

  • yarn dev (port 3001) - Development server for human developers
  • yarn dev-ai (port 3002) - Development server for AI development
  • yarn build - Create production build
  • yarn start (port 3001) - Production server for human developers
  • yarn start-ai (port 3002) - Production server for AI development
  • yarn lint - Run linting checks

Script Execution Pattern

CRITICAL: Always use ONLY these specific log filenames to prevent git pollution:

  • ai-output.log - For all build, lint, and one-time commands
  • ai-output-start.log - For server commands that need to be killed

DO NOT create descriptive log names like build-dashboard.log or lint-fix.log

# For linting and building (reuses same file)
yarn lint > ai-output.log 2>&1
yarn build > ai-output.log 2>&1

# For dev/start servers (use timeout to prevent hanging)
yarn dev-ai > ai-output.log 2>&1 & sleep 10; kill $!
yarn start-ai > ai-output-start.log 2>&1 & sleep 10; kill $!

After running any command:

  1. Read the output log file
  2. Parse for errors, warnings, or relevant messages
  3. Fix any issues found
  4. Re-run the command to verify fixes (overwrites the same log file)
  5. Document any new patterns or solutions

Note: The log files are in .gitignore to keep the repository clean

Production Readiness Checklist

  • yarn lint passes with no errors
  • yarn build completes successfully
  • yarn start-ai starts cleanly (after successful build)
  • All TypeScript errors resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment