2.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
This is a best practices repository for Claude Code configuration, demonstrating patterns for agents, commands, hooks, and skills. It serves as a reference implementation rather than an application codebase.
Key Components
Weather System (Example Workflow)
A demonstration of agent orchestration:
/weathercommand delegates to/weather-karachiweather-fetcheragent: fetches temperature from wttr.in APIweather-transformeragent: applies transformation rules frominput/input.md, writes results tooutput/output.md
Agents run sequentially, not in parallel, to maintain data dependencies.
Hooks System
Cross-platform sound notification system in .claude/hooks/:
scripts/hooks.py: Main handler for all 9 Claude Code hooksconfig/hooks-config.json: Shared team configurationconfig/hooks-config.local.json: Personal overrides (git-ignored)sounds/: Audio files organized by hook event
Special handling: git commits trigger pretooluse-git-committing sound.
Critical Patterns
Agent Orchestration
Agents cannot invoke other agents via bash commands. Use the Task tool:
Task(subagent_type="agent-name", description="...", prompt="...", model="haiku")
Be explicit about tool usage in agent definitions. Avoid vague terms like "launch" that could be misinterpreted as bash commands.
Agent Definition Structure
Agents in .claude/agents/*.md use YAML frontmatter:
name: Agent identifierdescription: When to invoke (use "PROACTIVELY" for auto-invocation)tools: Comma-separated list of allowed toolsmodel: Typically "haiku" for efficiencycolor: CLI output color for visual distinction
Configuration Hierarchy
.claude/settings.local.json: Personal settings (git-ignored).claude/settings.json: Team-shared settingshooks-config.local.jsonoverrideshooks-config.json
Disable Hooks
Set "disableAllHooks": true in .claude/settings.local.json, or disable individual hooks in hooks-config.json.
Documentation
docs/AGENTS.md: Agent orchestration troubleshootingdocs/WEATHER.md: Weather system flow diagram