11 KiB
description, shortcut, category, difficulty, estimated_time, version
| description | shortcut | category | difficulty | estimated_time | version |
|---|---|---|---|---|---|
| Greet the user with a contextual, helpful welcome message | h | utility | beginner | instant | 2.0.0 |
Hello Command
Provides a warm, professional greeting that acknowledges the user's current context and offers relevant assistance. This command demonstrates best practices for contextual awareness and helpful responses while serving as an exemplary template for other commands.
When to Use
Use this command when:
- Starting a new development session to get oriented
- Wanting a quick overview of available capabilities
- Testing if Claude Code is responsive and working correctly
- Needing suggestions for what to work on in the current context
- Beginning work in an unfamiliar project or directory
- After a long break to re-engage with your project
Do NOT use this command for:
- Getting specific technical help (use specialized commands instead)
- Project analysis (use
/analyzeor audit commands) - Generating code (use generation commands for your framework)
Prerequisites
Before running this command, ensure:
- Claude Code is properly installed and configured
- You are in the directory where you want to work
- No specific prerequisites - this command works anywhere
Process
Step 1: Analyze Current Context
The command examines your current environment to provide relevant suggestions:
- Identifies the current working directory path
- Detects project type by checking for configuration files (package.json, pom.xml, etc.)
- Notes the time of day for appropriate greeting tone
- Checks for recently modified files to understand current work
- Identifies available tools and frameworks
Step 2: Construct Personalized Greeting
Based on the context analysis, creates a greeting that includes:
- Time-appropriate salutation (Good morning/afternoon/evening)
- Acknowledgment of the current project type if detected
- Recognition of the working directory location
- A warm but professional tone that encourages engagement
Step 3: Offer Contextual Assistance
Provides 3-5 relevant suggestions based on what was detected:
- For identified project types: Framework-specific actions
- For unknown contexts: General development capabilities
- For error states: Troubleshooting and recovery options
- Always ends with an open question to encourage user engagement
Output Format
The command will produce output in this format:
[Time-based greeting]! I'm Claude Code, ready to help with your [project type/development] work.
I notice you're [context observation]. I can help you with:
• [Relevant capability 1 - specific to context]
• [Relevant capability 2 - specific to context]
• [Relevant capability 3 - specific to context]
[Optional: • Additional capabilities if relevant]
[Optional: Contextual tip or observation]
What would you like to work on today?
Output Fields Explained:
[Time-based greeting]: "Good morning", "Good afternoon", or "Good evening" based on system time[project type/development]: Specific framework/language detected or generic "development"[context observation]: What Claude Code notices about the current directory/project[Relevant capabilities]: 3-5 specific actions that make sense in this context[Contextual tip]: Optional helpful tip specific to the detected environment
Examples
Example 1: React Project Context
Scenario: User runs /hello in a React project with recent component changes
User Input:
/hello
Context:
- Working directory:
/home/user/projects/my-react-app - Project type: React (detected via package.json)
- Recent changes: Components modified in last hour
Command Execution:
# Step 1: Context detection
pwd # Returns: /home/user/projects/my-react-app
ls -la # Finds: package.json, src/, public/
cat package.json | grep react # Confirms React project
find . -type f -mmin -60 # Finds recently modified components
# Step 2: Greeting construction based on findings
# Step 3: Capability matching to React context
Output:
Good morning! I'm Claude Code, ready to help with your React development.
I notice you're in a React project with recent component changes. I can help you with:
• Creating new components or custom hooks
• Setting up tests for your recent changes
• Optimizing bundle size and performance
• Implementing state management patterns
• Debugging React DevTools warnings
I see you've been working on components recently - would you like help with testing or documentation?
What would you like to work on today?
Result: User receives a contextual greeting that acknowledges their React project and recent work, offering specific React-related assistance.
Example 2: Python Data Science Project
Scenario: User runs /hello in a Jupyter notebook directory
User Input:
/h
Context:
- Working directory:
/home/user/data-analysis - Files present: Multiple .ipynb files, requirements.txt, data/ folder
- Virtual environment detected
Command Execution:
# Context detection finds Jupyter notebooks and data files
ls *.ipynb # Finds notebook files
test -d data && echo "Data folder found"
test -f requirements.txt && echo "Python project detected"
Output:
Good afternoon! I'm Claude Code, ready to help with your data science work.
I notice you're in a Python data analysis project with Jupyter notebooks. I can help you with:
• Writing data processing pipelines
• Creating visualizations with matplotlib/seaborn
• Optimizing pandas operations
• Setting up machine learning models
• Documenting your analysis workflow
I see you have a data folder - need help with data cleaning or exploratory analysis?
What would you like to work on today?
Example 3: Unknown Project Type
Scenario: User runs /hello in home directory with no specific project
User Input:
/hello
Context:
- Working directory:
/home/user - No project files detected
- General development environment
Output:
Hello! I'm Claude Code, your AI development assistant.
I notice you're in your home directory. I can help you with:
• Starting a new project in any language or framework
• Exploring existing codebases in subdirectories
• Setting up development environments
• Learning new programming concepts
• Automating repetitive tasks
Would you like to start a new project or work on something existing?
What would you like to work on today?
Error Handling
Error: Permission Denied in Current Directory
Symptoms: Cannot read directory contents Cause: Insufficient permissions Solution:
Good morning! I'm Claude Code, though I notice I can't fully analyze this directory due to permissions.
I can still help you with:
• General coding questions and solutions
• Creating new files you have permission to write
• Planning project architecture
• Debugging code you share with me
Would you like to move to a different directory or continue here?
Prevention: Run Claude Code with appropriate permissions or work in user-owned directories
Error: Extremely Large Project (10,000+ files)
Symptoms: Context analysis takes too long Cause: Project too large for quick analysis Solution:
Hello! I'm Claude Code. This appears to be a large project that would take time to fully analyze.
I can help you with:
• Focused work on specific components
• Architecture-level discussions
• Code review for specific files
• Performance optimization strategies
What specific part of this project would you like to focus on today?
Error: System Time Unavailable
Symptoms: Cannot determine time of day Cause: System clock issue or permission restriction Solution: Default to neutral "Hello" greeting and continue normally
Configuration Options
The hello command behavior can be influenced by:
Environment Variable: CLAUDE_CODE_GREETING_STYLE
- Purpose: Adjusts greeting formality
- Values:
formal,friendly(default),brief - Example:
export CLAUDE_CODE_GREETING_STYLE=brief
Project-level .claude/config.json
- Purpose: Customize greeting for specific project
- Example:
{
"greeting": {
"projectType": "Custom Framework",
"suggestions": ["Run tests", "Check CI/CD", "Review PRs"]
}
}
Best Practices
✅ DO:
- Run
/hellowhen starting a session for contextual orientation - Use the shortcut
/hfor quick access - Pay attention to the suggestions as they're context-aware
- Use this as a conversation starter for your development session
❌ DON'T:
- Expect technical problem-solving from this command
- Run repeatedly in the same session (context doesn't change much)
- Ignore the contextual suggestions - they're tailored to your situation
💡 TIPS:
- The greeting adapts to your project - try it in different directories
- Use this command to test if Claude Code is working properly
- The suggestions can help you discover commands you didn't know about
Related Commands
/analyze- Deep analysis of your project structure and health/help- Comprehensive help and command listing/status- Check Claude Code configuration and capabilities/suggest- Get specific suggestions for your current task
Performance Considerations
- Typical execution time: <1 second
- Resource usage: Minimal - only reads directory structure
- Scaling notes: May be slightly slower in very large projects
- Optimization tips: Use in project root for best context detection
Security Notes
⚠️ Security Considerations:
- No sensitive information is collected or transmitted
- Directory analysis is read-only
- No files are modified or created
- Project detection uses only filename patterns, not file contents
Troubleshooting
Issue: Greeting doesn't recognize my project type
Solution: Ensure project configuration files are in the root directory (package.json, pom.xml, etc.)
Issue: Suggestions aren't relevant
Solution: Check you're in the correct directory and project files are standard
Issue: Command not found
Solution: Verify the hello-world plugin is installed with /plugin list
Getting Help
- Try the examples above for common scenarios
- Report issues at: https://github.com/anthropics/claude-code/issues
- Check documentation:
/help hello
Version History
- v2.0.0 - Complete rewrite with contextual awareness and examples
- v1.0.0 - Initial basic greeting implementation
Credits
- Rewritten to Anthropic quality standards by Claude Code Quality System
- Original concept from hello-world example template
- Context detection patterns inspired by VS Code and IntelliJ