Skip to content

CLAUDE.md Network — Rule Execution Order

Run the CLAUDE.md Network MicroSim Fullscreen

You can include this MicroSim on your website using the following iframe:

<iframe src="https://yarmoluk.github.io/Digital-Transformation-with-AI-Spring-2026/sims/claude-md-network/main.html" height="600px" width="100%" scrolling="no"></iframe>

Description

This MicroSim visualizes how CLAUDE.md configuration files are located in the filesystem and loaded by Claude Code. Each node represents a real directory or file on the selected computer.

What You See

  • Blue-gray nodes are directories in the filesystem (/etc/, ~/, ~/projects/)
  • Colored CLAUDE.md nodes represent the 4 configuration layers:
    • Blue — Enterprise (/etc/claude/CLAUDE.md)
    • Teal — User (~/.claude/CLAUDE.md)
    • Orange — Project (<repo>/CLAUDE.md)
    • Purple — Local (<repo>/.claude/CLAUDE.md)
  • Dashed orange arrows show the execution order (numbered 1→2→3)

How to Use

  1. Select a computer (Work Laptop, Home Desktop, Cloud Server) in the right panel
  2. Select a project (Web App, API Service, ML Pipeline, Docs Site)
  3. Click "Run Simulation" to watch rules load step-by-step
  4. Click any node to inspect its filesystem path and contents
  5. Watch the Active Rules panel accumulate rules as each layer loads

Key Observations

  • Home Desktop has no Enterprise node — personal machines skip layer 1
  • Project CLAUDE.md is identical across all computers (it's version-controlled in the repo)
  • Local CLAUDE.md differs per machine — it's gitignored, so each environment can customize
  • The dashed arrows show Claude Code's internal loading sequence, not filesystem parent-child relationships

Lesson Plan

Learning Objectives

  • Map the CLAUDE.md file locations to concrete filesystem paths on different operating systems
  • Trace the rule execution order through the filesystem hierarchy
  • Compare how the same project produces different rule sets on different machines
  • Evaluate which rules belong at which layer based on scope and audience

Target Audience

Graduate students in software engineering, digital transformation, or AI courses. Professional developers configuring Claude Code for team use.

Prerequisites

  • Understanding of filesystem hierarchies (/etc/, ~/, project directories)
  • Familiarity with gitignore patterns and what "gitignored" means
  • Basic awareness of AI coding assistants

Activities

  1. Filesystem Treasure Hunt: Click on every node for "Work Laptop / Web App." Draw the full directory tree on paper. Then switch to "Home Desktop" — what's missing and why?
  2. Rule Conflict Analysis: If Enterprise says "Never force-push to main" and Local says "Allow force-push on feature branches," which wins? Discuss precedence and override semantics.
  3. Design Challenge: Your team has 5 developers on 3 different operating systems. Design the CLAUDE.md files for each layer. What goes where?
  4. Compare and Contrast: Run the simulation for "Cloud Server / ML Pipeline" and "Home Desktop / ML Pipeline." List every rule that differs. Explain why each difference exists.

Assessment

  1. On which computer(s) does the Enterprise layer load? Why not all of them?
  2. Why is the .claude/ directory gitignored while the root CLAUDE.md is committed?
  3. A team member wants all developers to use pytest before committing. Which layer should this rule go in?
  4. Your production server needs connection pooling enabled, but your dev laptop doesn't. Which layer handles this?

References

  1. Claude Code Documentation - Anthropic - Official documentation for Claude Code including CLAUDE.md configuration
  2. Filesystem Hierarchy Standard (Wikipedia) - Linux/Unix directory structure conventions explaining why /etc/ is used for system-wide configuration
  3. vis-network Documentation - vis.js - API reference for the network visualization library used in this MicroSim
  4. Configuration File (Wikipedia) - Overview of configuration file patterns, cascading precedence, and override semantics in software systems