Episode 2
Structure of rules
Rules in Claude are a way to manage context and organize instructions for larger projects using .claude/rules directory. This helps avoid a massive Claude MD file. The rules can be scoped with path globs allowing for specific instructions for different parts of a project (e.g., API vs. admin panel) or unconditionally applied. The structure involves a rules directory with individual rule files, supporting glob patterns and subdirectories. Personal rules can be stored in the user directory for use across multiple projects. The presenter uses a desktop application called Solo, with a rules directory containing rules specific to that project, such as Tauri, TanStack Query, React, Swift, and Tailwind rules. The Tauri rules define project structure, Vite setup, and lessons learned from development, covering topics like ensuring a native desktop feel for web views, disabling spellcheck, window dragging, dark mode, and icon specifications for different operating systems. They also include condensed, high-impact guidelines in a "Don't do this, do that" format. The presenter plans to share init files and demonstrate how to add rules to existing projects in the next video.