Diving Deep into the WAT Framework, Token Optimization, and CLAUDE.md Just wrapped up Day 1! Instead of just mindlessly running the setup, I had a great discussion with Claude about the core architecture and the role of CLAUDE.md. It gave me some really solid "aha!" moments about how AI agents actually scale, so I wanted to share my takeaways with the community. 📝 What I Built - The Deliverable: A fully automated newsletter system that takes a single prompt, conducts research via Perplexity, generates visuals with Nano Banana, formats everything in HTML, and sends a polished email via Gmail. - The Setup: Configured the project structure based on the WAT framework (Workflows + Agent + Tools) driven by CLAUDE.md. 💡 My "Aha!" Moments & Core Takeaways 1. What does CLAUDE.md actually do? I realized that CLAUDE.md is the literal "brain transplant" (system prompt) that turns a generic, jack-of-all-trades AI into a highly structured, autonomous operations manager for this specific project. It strictly enforces: - Role Limitation: Stopping Claude from doing everything probabilistically and forcing it to delegate to deterministic Python scripts (tools). - Shared Context: Drilling in the exact folder architecture (workflows/, tools/) and setting ground rules, like keeping deliverables in cloud services. - The Self-Improvement Loop: Commanding the agent to not just report errors, but to actively fix the scripts and update the markdown documentation on the fly. 2. The Dilemma of Centralized Management vs. Token Bloat While I loved the idea of keeping all workflows and tools in one project folder for reusability, a critical question hit me: "As we add dozens of workflows, won't Claude read everything every time and absolutely explode our token consumption?" 【How it's solved】 I learned that robust systems don't force the AI to read every single markdown file from the jump. Instead, they use a lightweight index file or vector search (RAG) to let the system pull only the specific workflow required for the task. It was eye-opening to see how decoupling AI reasoning from deterministic system control keeps the context window clean and scalable.