# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## CF_Zero_V1 Project Overview CF_Zero_V1 is an educational Bash learning platform called "Crumbforest" that uses 17 character-based AI assistants ("WaldwΓ€chter" - Forest Guardians) to teach command-line concepts, programming fundamentals, and hardware/robotics projects through interactive missions. The system is designed to run on devices ranging from Raspberry Pi Zero to desktop computers, emphasizing transparency, file-based state, and pedagogical value. ## Key Commands ### Mission System ```bash # Launch the interactive mission selector (main entry point) ./crumb-mission-selector.sh # Option 9 opens CrumbCrew Command Central (interactive shell with all AI characters) # Run individual missions directly bash missions/basics/fridolin.sh # Navigation basics bash missions/basics/balu.sh # File creation bash missions/basics/noko.sh # File reading bash missions/advanced/dns_mission.sh # DNS tools bash missions/advanced/ssh_security.sh # SSH basics bash missions/robots/lipo_power_academy.sh # LiPo battery education bash missions/robots/regenbogen_zaehlmaschine.sh # Rainbow counter project bash missions/robots/mond_maschine.sh # Moon machine ML project bash missions/robots/solar_kettle.sh # Solar water heater physics ``` ### AI Character Assistants - The 17 WaldwΓ€chter All characters require `OPENROUTER_API_KEY` environment variable set in `.env` file: ```bash # Configure environment (required first step) cp .env.template .env # Edit .env and add your OPENROUTER_API_KEY # === DAS DREIECK (The Triangle - Foundation) === # Philosophical/didactic framework (not a technical module) ./crumbforest_roles/dumbosql_zero.sh "Design a sensor database" # Structure/Lists ./crumbforest_roles/funkfox_zero.sh "Explain pipes in rap form" # Flow/Rhythm ./crumbforest_roles/taichitaube_zero.sh "How to balance chaos?" # Balance/Spiral # === Hardware Team === ./crumbforest_roles/tobi_zero.sh "Explain capacitors" # CapaciTobi - Electronics ./crumbforest_roles/schnecki_zero.sh "How to wire sensors?" # Wiring specialist ./crumbforest_roles/schraubaer_zero_final.sh "Welding tips?" # Heavy machinery # === Code Team === ./crumbforest_roles/snakepy_zero.sh "Python list comprehension" # Python guide ./crumbforest_roles/pepperphp_zero.sh "MVC architecture" # PHP structure ./crumbforest_roles/crabbrust_zero.sh "Memory safety in Rust" # Security guardian ./crumbforest_roles/spider_zero.sh "API REST design" # Network specialist # === UI Team === ./crumbforest_roles/schnippsi_zero.sh "CSS grid layout" # Styling ./crumbforest_roles/templatus_zero.sh "HTML structure" # Templates ./crumbforest_roles/asciimonster_zero.sh "Draw ASCII art" # Terminal art # === System Team === ./crumbforest_roles/mayaeule_zero.sh "What is wisdom?" # Meta-knowledge owl ./crumbforest_roles/deepbit_zero.sh "How does grep work?" # Bash deep dive ./crumbforest_roles/bugsy_zero.sh "Debug this error" # Debugging ./crumbforest_roles/vektor_zero.sh "Navigate this project" # Point-to-point guide ``` ### Unified Access via WaldwΓ€chter Library **Preferred method for missions and scripts:** ```bash # Source the library to get all characters as shell functions source lib/waldwaechter.sh # Now all characters are available as commands (no path needed) dumbosql "Design a users table" funkfox "Explain while loops as a rap" schnippsi "Center a div with CSS" mayaeule "What is the meaning of code?" # Utility commands (available after sourcing waldwaechter.sh) crew_tokens # View token usage across all characters crew_status # Check which characters are available crew_memory # View conversation histories (crew context) crew_doctor # System health check (dependencies, API keys) crew_syntax # Validate bash syntax for all scripts crew_help # Show available commands crew_memo # Track creative outputs (Mixcloud, Git, etc.) ``` ### CrumbCrew Command Central (Position 9 in Mission Selector) Interactive shell with all WaldwΓ€chter pre-loaded: - Custom prompt: `(🌲 CrumbCrew) user@host:path$` - All 17 characters available as direct commands - Utilities: `crew_status`, `crew_tokens`, `crew_memory`, `crew_doctor` - Exit with `exit` or Ctrl+D ### Crumbblocks - Browser-Terminal Bridge ```bash # Start local server for interactive HTML simulations ./start_crumbblocks.sh # Opens browser to http://localhost:8000 (or similar) # Available simulations: # - lipo_6s_charger_sim_safe_v7.html (LiPo battery charger) # - rainbow_counter.html (Color event counter) # - solar_kettle_dark.html (Solar water heater physics) # - bezier_stream.html, painter.html, and more # Simulations use Clipboard API to send results back to terminal # Evaluation scripts in missions/robots/ parse clipboard data ``` ### Token Usage Monitoring ```bash # View token usage across all AI assistants (new unified system) crew_tokens # View individual character logs (repo-based) cat logs/mayaeule/token_log.json cat logs/funkfox/token_log.json cat logs/dumbosql/token_log.json # View conversation history cat logs/mayaeule/eule_history.json cat logs/funkfox/funkfox_history.json # Track creative outputs crew_memo cat logs/crumb_memo.json ``` ### Creative Output Tracking (crumb_memo) ```bash # Log creative outputs (dual transparency: input + output) crumb_memo "https://mixcloud.com/your-mix" "My first beat" crumb_memo "https://github.com/user/repo" "My robot code" crumb_memo "https://youtube.com/watch?v=..." "Tutorial video" # View all logged creative outputs crew_memo ``` ## Architecture Overview ### Core Design Philosophy **WaldwΓ€chter (Forest Guardian) Architecture:** - **Transparency over magic** - All state is file-based JSON - **Metadata-driven extensibility** - Add content without code changes - **Educational first** - Token tracking teaches mindful questioning - **Raspberry Pi Zero compatible** - Minimal dependencies, lightweight - **Multilingual** - Characters respond in the language of the question - **File-based agent memory** - Characters can read each other's logs ### Mission System Architecture **Metadata-Driven Design:** - Each mission consists of two files: `mission_name.sh` (executable) and `mission_name.meta.json` (metadata) - The mission selector (`crumb-mission-selector.sh`) dynamically loads missions by scanning directories - **No code changes required** to add new content - just drop in files **Metadata structure:** ```json { "icon": "🦊", "title": "Mission Title", "description": "What this teaches", "category": "basics|advanced|challenges|robots", "enabled": true } ``` **Mission Categories:** - `missions/basics/` - Beginner missions (navigation, file operations) - 3 missions - `missions/advanced/` - Advanced topics (DNS, SSH, networking) - 2 missions - `missions/challenges/` - Story-based complex missions - 1 mission - `missions/robots/` - Hardware projects (LiPo, rainbow counter, moon machine, solar kettle) - 5 missions - `missions/dojo/` - BashPanda Kung Fu Belt System (progressive Bash mastery) - 6 missions ### AI Assistant Architecture - The 17 WaldwΓ€chter **Character Roster (Organized by Role):** 1. **Das Dreieck (The Triangle)** - Philosophical framework: - **DumboSQL** (🐘) - Structure/Lists (SQL, data organization, never forgets) - **FunkFox** (🦊) - Flow/Rhythm (Bash rapper, explains as hip-hop) - **Taichi Taube** (πŸ•ŠοΈ) - Balance/Spiral (Chaos management, patience) 2. **Hardware Team**: - **CapaciTobi** (🐿️) - Electronics, power, capacitors (alias: Tobi) - **Schnecki** (🐌) - Wiring, connections (slow and precise) - **SchraubbΓ€r** (🐻) - Heavy machinery, welding, mechanical systems 3. **Code Team**: - **SnakePy** (🐍) - Python guide (shows multiple paths) - **PepperPHP** (πŸ§“) - PHP structure mentor (MVC as recipes) - **CrabbyRust** (πŸ¦€) - Rust security guardian (memory safety) - **Spider** (πŸ•·οΈ) - Network specialist (APIs, connections) 4. **UI Team**: - **Schnippsi** (βœ‚οΈ) - CSS and styling expert - **Templatus** (πŸ“„) - HTML template master - **ASCII-Monster** (πŸ‘Ύ) - Terminal artist (ASCII art) 5. **System Team**: - **Maya-Eule** (πŸ¦‰) - Wise owl with meta-knowledge - **Deepbit** (πŸ”§) - Bash deep dive explainer - **Bugsy** (πŸ›) - Debugging detective - **Vektor** (🧭) - Point-to-point navigation guide 6. **Education Team**: - **BashPanda** (🐼) - Kung Fu Bash Meister (teaches progressive Bash through martial arts metaphors) **Common Pattern (Each Character Script):** 1. Load `.env` file (API keys) 2. Check token budget (optional parental control) 3. Build personality-specific system prompt 4. Check crew memory (if other characters mentioned in question) 5. Call OpenRouter API with conversation history 6. Log response + tokens to `logs/{character}/` 7. Display with character-specific formatting **The Personality IS the System Prompt:** Each character has a unique system prompt that defines their teaching style. Example from FunkFox: ``` "Du bist FunkFox - der Bash Rapper. Du erklΓ€rst Terminal-Konzepte im Hip-Hop-Flow. Pipes sind Beats, Loops sind Rhythmen." ``` **API Flow:** ```bash Question β†’ Check Budget β†’ Load History β†’ Build Prompt β†’ OpenRouter API β†’ Log Response β†’ Display ↓ Check Crew Memory (if other characters mentioned) ``` **Log Structure (Repo-Based):** ``` logs/ β”œβ”€β”€ mayaeule/ β”‚ β”œβ”€β”€ eule_history.json # Conversation history β”‚ β”œβ”€β”€ token_log.json # Token usage tracking β”‚ β”œβ”€β”€ eule_request.json # Last API request β”‚ └── eule_response.json # Last API response β”œβ”€β”€ funkfox/ β”‚ β”œβ”€β”€ funkfox_history.json β”‚ └── token_log.json β”œβ”€β”€ dumbosql/ β”‚ β”œβ”€β”€ dumbosql_history.json β”‚ └── token_log.json β”œβ”€β”€ ... (all 17 characters) β”œβ”€β”€ crumb_memo.json # Creative output tracking └── missions/ # Mission execution logs ``` **Key Difference from Old System:** - **Old:** Logs in `~/.{character}_logs/` (home directory) - **New:** Logs in `logs/{character}/` (repository-based) - **Why:** Git-trackable, transparent, portable, easier debugging ### WaldwΓ€chter Library (`lib/waldwaechter.sh`) **Central Integration Point - 715 lines of unified functionality:** This is the **most important file** for understanding how the system works. It provides: 1. **Unified character access** - All 17 characters as shell functions 2. **Environment management** - Loads `.env`, sets `CRUMB_LOGS_DIR` 3. **Utility functions** - `crew_tokens`, `crew_status`, `crew_memory`, `crew_doctor`, etc. 4. **Token budget enforcement** - Optional parental controls 5. **Cross-shell compatibility** - Works in bash, zsh **Usage in missions:** ```bash # At top of mission script SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPT_DIR}/../../lib/waldwaechter.sh" # Now all characters and utilities are available funkfox "Explain this concept" crew_tokens ``` **Utility Functions:** - `crew_tokens` - Display token usage across all characters with cost estimates - `crew_status` - Check which character scripts are available - `crew_memory` - View conversation histories (crew context awareness) - `crew_doctor` - System health check (dependencies, API keys, paths) - `crew_syntax` - Validate bash syntax for all scripts - `crew_help` - Show available commands and characters - `crew_memo` - Track creative outputs (Mixcloud, Git repos, YouTube, etc.) ### Inter-Character Communication (Crew Memory) **Lightweight Agent-Like Behavior:** Characters can reference each other's conversation histories through JSON log files: ```bash # User asks FunkFox a question mentioning another character funkfox "DumboSQL said we need a users table, what bash loops do I use?" # FunkFox script automatically: # 1. Detects "dumbosql" mention in question # 2. Reads logs/dumbosql/dumbosql_history.json # 3. Includes last 3 conversations as context # 4. Enriches system prompt with crew context # 5. Responds with awareness of DumboSQL's advice ``` **Implementation:** - Characters detect mentions of other crew members (case-insensitive grep) - Read last 3 conversations from mentioned character's history file - Include as context in API call system prompt - **Lightweight:** Simple JSON file reading, no complex orchestration - **Transparent:** All context visible in log files - **Raspberry Pi friendly:** No Redis, no databases, just files **Crew context format:** ```json { "role": "system", "content": "Context from DumboSQL: [last 3 conversations]..." } ``` ### Crumbblocks Architecture (Browser-Terminal Bridge) **17 HTML files** in `crumbblocks/` directory: **Design Pattern:** - **Self-contained** - No external dependencies, single HTML files - **Clipboard API** - Send data back to terminal via copy to clipboard - **Interactive simulations** - Physics engines, visualizations, games - **Educational** - Each teaches a concept (batteries, colors, energy, art) **Key Examples:** - `lipo_6s_charger_sim_safe_v7.html` - LiPo battery charger simulation (6S, balancing, safety) - `rainbow_counter.html` - Color event counter with RGB sensor simulation - `solar_kettle_dark.html` - Solar water heater physics engine - `bezier_stream.html` - BΓ©zier curve generator - `painter.html`, `painter_spray.html`, `painter_lines.html` - Creative painting tools - `schnippsi_ui.html` - Schnippsi's UI editor **Evaluation Flow:** 1. User interacts with Crumbblock simulation in browser 2. Simulation calculates results (e.g., battery voltage, water temperature) 3. Results exported to clipboard as JSON 4. User pastes in terminal 5. Mission evaluation script parses JSON and provides feedback **Server Options:** ```bash # PHP server (if available) php -S localhost:8000 # Python server (fallback) python3 -m http.server 8000 # start_crumbblocks.sh detects and uses best option ``` ### "Das Dreieck" - Philosophical Framework **Important:** This is a **didactic model**, not a technical module. The Triangle represents three foundational concepts taught through specific characters: 1. **DumboSQL (🐘)** - Structure/Lists - Data organization, SQL, tables, persistence - "The elephant never forgets" - Teaches: How to organize information 2. **FunkFox (🦊)** - Flow/Rhythm - Pipes, loops, process orchestration - "Terminal concepts as hip-hop beats" - Teaches: How processes flow and connect 3. **Taichi Taube (πŸ•ŠοΈ)** - Balance/Spiral - Chaos management, patience, iterative refinement - "The spiral path, not the straight line" - Teaches: How to handle complexity gracefully **Usage in Missions:** Complex projects (like robots missions) explicitly invoke The Triangle for planning: ```bash dumbosql "Design the data structure for rainbow counter" funkfox "What's the flow of data from sensor to display?" taichitaube "How do we balance hardware and software complexity?" ``` This creates a structured approach to problem-solving that children can internalize. ### "BashPanda Dojo" - Progressive Bash Learning System **NEW in v0.0-RC4:** A complete Kung Fu-themed Bash learning curriculum with belt progression system. The BashPanda Dojo teaches Bash through martial arts metaphors, creating a gamified progression path from beginner to master. Each belt represents a skill level with dedicated missions and interactive quizzes. **The 6 Belts:** 1. **πŸ–€ Schwarzer GΓΌrtel (Black)** - The Basics - echo, printf, ANSI codes - Variables (creating, using) - read (user input) - Mission: `bash missions/dojo/schwarzer_guertel.sh` 2. **πŸ’– Pinker GΓΌrtel (Pink)** - Control Flow - if/then/else conditions - while and for loops - Arrays - Arithmetik $(( )) - Mission: `bash missions/dojo/pinker_guertel.sh` 3. **πŸ’™ Blauer GΓΌrtel (Blue)** - Text Mastery - sed (stream editor) - case statements - bc (floating point math) - wc (word count) - Mission: `bash missions/dojo/blauer_guertel.sh` 4. **πŸ’š GrΓΌner GΓΌrtel (Green)** - Pattern Recognition - grep basics and options - Regular expressions (regex) - Email/date pattern matching - grep -E (extended regex) - Mission: `bash missions/dojo/gruener_guertel.sh` 5. **πŸ’› Gelber GΓΌrtel (Yellow)** - Modularity - Functions (defining, calling) - Function parameters ($1, $@, $#) - source (library loading) - return vs exit - local variables - Mission: `bash missions/dojo/gelber_guertel.sh` 6. **🀍 Weisser GΓΌrtel (White)** - Mastery - Background jobs (&) - jobs, ps commands - wait for synchronization - Parallel processing - Process control - Mission: `bash missions/dojo/weisser_guertel.sh` **Interactive GΓΌrtelprΓΌfung (Belt Exam):** Each belt has a browser-based quiz for assessment: 1. Open: `./start_crumbblocks.sh` 2. Navigate to: `bashpanda_guertelpruefung.html` 3. Select your belt and answer 5 questions 4. Results auto-copy to clipboard 5. Paste into terminal: `bash missions/dojo/evaluate_guertelpruefung.sh` 6. Receive certificate if passed (80%+ required) **Certificates:** - Stored in `logs/zertifikate/` - Format: `{belt}_{user}_{timestamp}.txt` - Contains score, date, BashPanda seal **Teaching Philosophy:** - "Der Weg des Codes ist wie der Weg der Kampfkunst: Geduld, PrΓ€zision, Wiederholung" - Each command is a "kata" (form) to be practiced - Errors are teachers, not failures - Progressive difficulty builds confidence - BashPanda provides wisdom and encouragement throughout **Integration with WaldwΓ€chter:** - BashPanda can be called from any mission: `bashpanda "question"` - Understands context from other characters via crew memory - Responds in language of question (German/English/etc.) - Token tracking for mindful learning **Usage Example:** ```bash # Start belt progression bash missions/dojo/schwarzer_guertel.sh # Ask BashPanda for help source lib/waldwaechter.sh bashpanda "ErklΓ€re mir echo vs printf" # Take belt exam ./start_crumbblocks.sh # (Open bashpanda_guertelpruefung.html in browser) # Evaluate results bash missions/dojo/evaluate_guertelpruefung.sh ``` ## Project Structure ``` CF_Zero_V1/ β”œβ”€β”€ crumb-mission-selector.sh # Main entry point (1027 lines) β”œβ”€β”€ lib/ β”‚ └── waldwaechter.sh # 17 AI characters + utilities (715 lines) β”œβ”€β”€ crumbforest_roles/ # 17 individual AI character scripts β”‚ β”œβ”€β”€ dumbosql_zero.sh # Structure/Lists (Das Dreieck) β”‚ β”œβ”€β”€ funkfox_zero.sh # Flow/Rhythm (Das Dreieck) β”‚ β”œβ”€β”€ taichitaube_zero.sh # Balance/Spiral (Das Dreieck) β”‚ β”œβ”€β”€ tobi_zero.sh # CapaciTobi - Electronics β”‚ β”œβ”€β”€ schnecki_zero.sh # Wiring specialist β”‚ β”œβ”€β”€ schraubaer_zero_final.sh # Heavy machinery β”‚ β”œβ”€β”€ snakepy_zero.sh # Python guide β”‚ β”œβ”€β”€ pepperphp_zero.sh # PHP structure β”‚ β”œβ”€β”€ crabbrust_zero.sh # Rust security β”‚ β”œβ”€β”€ spider_zero.sh # Network APIs β”‚ β”œβ”€β”€ schnippsi_zero.sh # CSS styling β”‚ β”œβ”€β”€ templatus_zero.sh # HTML templates β”‚ β”œβ”€β”€ asciimonster_zero.sh # ASCII art β”‚ β”œβ”€β”€ mayaeule_zero.sh # Wise owl β”‚ β”œβ”€β”€ deepbit_zero.sh # Bash deep dive β”‚ β”œβ”€β”€ bugsy_zero.sh # Debugging β”‚ └── vektor_zero.sh # Navigation β”œβ”€β”€ missions/ # Educational missions β”‚ β”œβ”€β”€ basics/ # 3 beginner missions β”‚ β”‚ β”œβ”€β”€ fridolin.sh/meta.json # Navigation (pwd, ls, cd) β”‚ β”‚ β”œβ”€β”€ balu.sh/meta.json # File creation (mkdir, touch) β”‚ β”‚ └── noko.sh/meta.json # File reading (cat, grep) β”‚ β”œβ”€β”€ advanced/ # 2 advanced missions β”‚ β”‚ β”œβ”€β”€ dns_mission.sh/meta.json # DNS tools β”‚ β”‚ └── ssh_security.sh/meta.json # SSH basics β”‚ β”œβ”€β”€ challenges/ # 1 story-based mission β”‚ β”œβ”€β”€ robots/ # 5 hardware missions β”‚ β”‚ β”œβ”€β”€ lipo_power_academy.sh # LiPo battery education (8 phases) β”‚ β”‚ β”œβ”€β”€ regenbogen_zaehlmaschine.sh # Rainbow counter (7 phases) β”‚ β”‚ β”œβ”€β”€ mond_maschine.sh # Moon machine ML (8 phases) β”‚ β”‚ β”œβ”€β”€ solar_kettle.sh # Solar water heater (6 phases) β”‚ β”‚ └── evaluate_solar_kettle.sh # Evaluation script β”‚ └── dojo/ # 6 BashPanda belt missions (NEW!) β”‚ β”œβ”€β”€ schwarzer_guertel.sh # Black belt - Basics β”‚ β”œβ”€β”€ pinker_guertel.sh # Pink belt - Control flow β”‚ β”œβ”€β”€ blauer_guertel.sh # Blue belt - Text β”‚ β”œβ”€β”€ gruener_guertel.sh # Green belt - Pattern matching β”‚ β”œβ”€β”€ gelber_guertel.sh # Yellow belt - Functions β”‚ β”œβ”€β”€ weisser_guertel.sh # White belt - Processes β”‚ └── evaluate_guertelpruefung.sh # Quiz evaluation β”œβ”€β”€ crumbblocks/ # 18 HTML interactive simulations β”‚ β”œβ”€β”€ lipo_6s_charger_sim_safe_v7.html β”‚ β”œβ”€β”€ rainbow_counter.html β”‚ β”œβ”€β”€ solar_kettle_dark.html β”‚ β”œβ”€β”€ bashpanda_guertelpruefung.html # Belt quiz (NEW!) β”‚ β”œβ”€β”€ bezier_stream.html β”‚ β”œβ”€β”€ painter.html β”‚ └── ... (12 more) β”œβ”€β”€ logs/ # Repo-based logging β”‚ β”œβ”€β”€ mayaeule/ β”‚ β”‚ β”œβ”€β”€ eule_history.json β”‚ β”‚ └── token_log.json β”‚ β”œβ”€β”€ funkfox/ β”‚ β”œβ”€β”€ dumbosql/ β”‚ β”œβ”€β”€ bashpanda/ # BashPanda logs (NEW!) β”‚ β”œβ”€β”€ ... (all 18 characters) β”‚ β”œβ”€β”€ crumb_memo.json # Creative output tracking β”‚ β”œβ”€β”€ zertifikate/ # Belt certificates (NEW!) β”‚ └── missions/ # Mission execution logs β”œβ”€β”€ seeds/ # Seed data for collaborative systems β”œβ”€β”€ start_crumbblocks.sh # Launch browser simulations β”œβ”€β”€ .env.template # Environment variables template └── README.md # German documentation ``` ## Important Implementation Notes ### Adding New Missions **Zero code changes required - just drop in two files:** 1. Create two files in appropriate category folder: ```bash touch missions/robots/new_mission.sh touch missions/robots/new_mission.meta.json chmod +x missions/robots/new_mission.sh ``` 2. Metadata must include: ```json { "icon": "πŸš€", "title": "Your Mission Title", "description": "What this teaches", "category": "basics|advanced|challenges|robots", "enabled": true } ``` 3. Mission script best practices: ```bash #!/bin/bash # Source waldwaechter library for AI character access SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPT_DIR}/../../lib/waldwaechter.sh" # Use cat << 'EOF' for multi-line instructions # Include interactive prompts with read -p # Provide examples before asking user to try # Call AI characters as needed: funkfox "question" # End with success message ``` 4. Mission will **automatically appear** in mission selector on next run ### Creating New AI Assistants **Current roster is complete (17 characters), but if adding new ones:** 1. Copy template from existing character: ```bash cp crumbforest_roles/deepbit_zero.sh crumbforest_roles/newchar_zero.sh ``` 2. Update these elements: - Character name and emoji in echo statements - System prompt in `jq -n` command (defines personality) - Log file paths (use `${CRUMB_LOGS_DIR}/newchar/`) - Function name if adding to waldwaechter.sh 3. Add to `lib/waldwaechter.sh`: ```bash # 🎭 NewChar - Description function newchar() { "${ROLES_DIR}/newchar_zero.sh" "$@" } export -f newchar ``` 4. Test with: ```bash source lib/waldwaechter.sh newchar "Test question" crew_status # Should show new character ``` ### Token Log Format Each character logs API usage in this format: ```json { "zeit": "2025-12-23 19:05:33", "rolle": "funkfox", "usage": { "prompt_tokens": 45, "completion_tokens": 123, "total_tokens": 168 } } ``` View with: `crew_tokens` (formatted with cost estimates) ### Creating New Crumblocks **Self-contained HTML simulations:** 1. Create single HTML file in `crumbblocks/`: ```bash touch crumbblocks/my_simulation.html ``` 2. Include in HTML: - All CSS in `