Core Capabilities
Claude Code understands:- Intent: What you want to accomplish
- Context: Which files, features, or components you’re referencing
- Scope: How extensive the changes should be
- Constraints: Limitations, patterns, or requirements to follow
Request Types
Code Generation
Create new code from descriptions:- Analyze existing code patterns
- Generate implementation following your conventions
- Show complete code for review
- Create files after approval
- Specify technology: “using JWT tokens”
- Reference examples: “similar to the session module”
- List requirements: “with password hashing and rate limiting”
Code Modification
Edit existing code:- Read the specified file
- Identify query locations
- Add appropriate error handling
- Show diff for review
- Use @-mentions: “in @src/api.js”
- Be specific: “wrap in try-catch” vs “add error handling”
- Reference locations: “in the login function” or “at line 45”
Code Explanation
Understand existing code:- Find relevant files
- Trace execution flow
- Explain logic with code references
- Highlight key components
- Ask about flow: “trace how requests are authenticated”
- Request details: “explain the JWT validation logic”
- Compare: “what’s the difference between X and Y?”
Code Search
Find code patterns:- Search for relevant patterns
- Identify files and locations
- Summarize findings with references
- Search by functionality: “find all database queries”
- Search by pattern: “locate all TODO comments”
- Search by usage: “where is UserService used?”
Refactoring
Restructure code:- Identify the code to extract
- Create new function
- Update all call sites
- Show all changes
- Specify scope: “across all files” vs “just in this module”
- Name components: “create a validateEmail function”
- Describe structure: “move to @src/utils/validation.js”
File References
@-Mentions
Reference files explicitly using@:
@ to see file suggestions:
- Files in current directory
- Recently edited files
- Frequently referenced files
- Search by typing partial names
- Relative:
@src/utils/helpers.js - Absolute:
@/home/user/project/file.js - With line numbers:
@src/app.js:45 - With anchors:
@README.md#installation
Implicit References
Claude infers file references from context:- Files with “login” in name
- Functions named “login”
- Recent conversation files
- Git changes
Multiple Files
Reference multiple files:- Read both files
- Identify shared code
- Create common utilities
- Update both files
Context Building
Claude Code assembles context from multiple sources:Conversation History
Project Structure
Git State
Configuration
.claude/CLAUDE.md if present.
Slash Commands
Slash commands provide shortcuts for common operations:Built-in Commands
| Command | Natural Equivalent |
|---|---|
/commit | ”Create a git commit for these changes” |
/model | ”Change to a different AI model” |
/clear | ”Start a new conversation” |
/help | ”Show me available commands” |
/resume | ”Continue a previous conversation” |
Custom Commands
Create project-specific shortcuts in.claude/commands/:
Natural Language Patterns
Effective Requests
Good:Iterative Refinement
First request:Contextual Follow-ups
Advanced Techniques
Conditional Logic
Express complex requirements:Multiple Steps
Describe multi-step workflows:Constraints and Preferences
Specify how to implement:Examples and References
Provide examples:Tool Selection
Claude automatically selects appropriate tools:| Request | Tools Used |
|---|---|
| ”Show me @src/app.js” | Read |
| ”Fix typo in @README.md” | Read, Edit |
| ”Create @tests/api.test.js” | Write |
| ”Find all TODO comments” | Grep |
| ”Run the tests” | Bash |
| ”Where are the API routes defined?” | Grep, Glob |
- Glob: Find existing API files
- Read: Understand current patterns
- Edit: Update routes file
- Write: Create handler file
- Bash: Run tests
Command Syntax
While natural language is preferred, Claude understands technical syntax:Shell Commands
Embed shell commands:Code Snippets
Include code examples:Find all functions matching /async\s+function\s+\w+/
Variable Substitution
In custom commands, use$ARGUMENTS:
Error Handling
When requests are ambiguous: Clarifying Questions:Best Practices
Common Patterns
Code Review Requests
Documentation Requests
Testing Requests
Debugging Requests
Next Steps
Agents
Learn about specialized background agents
Codebase Understanding
How Claude analyzes your code
Task Automation
Create custom commands and workflows
Configuration
Customize Claude Code behavior