A guide to effective development patterns and techniques using Claude Code.
-
- 2.1. Context Grounding
- 2.2. Project Memory (
./CLAUDE.md) - 2.3. Session Management
-
- 5.1. Communication
- 5.2. Iteration
- 5.3. Learning
- Research and understand the problem space
- Create a detailed implementation plan using Claude's Plan Mode
- Write the code following the plan
- Commit with descriptive messages
When to use: New features, bug fixes, refactoring tasks. This is your daily driver for structured development.
💡 Use commits as checkpoints, commit frequently, use the /commit (git commit) command to automate commit creation.
💡 Use git worktree for parallel development
- Write tests first, commit
- Implement code iteratively
- Refactor and commit improvements
When to use: AI-assisted development thrives when you have robust and comprehensive test suites.
💡 Make sure generated tests are meaningful and not just boilerplate. Keep the code quality as high as that of your production code.
- Use
/create-prd(create project requirement document) to create a Product Requirements Document (PRD) based on user input. - Use
/generate-tasks(generate tasks from PRD) to create a task list from the PRD. - Use
/process-task-list(process task list) to manage and track task progress.
Or use spec-kit, https://github.com/github/spec-kit for more details.
When to use: Greenfield projects, PoC development, pet projects
💡 This is a new methodology and might not give you best results with complex production code bases. Be careful with your time and feel free to throw away code that you don't like and iterate. Also, since much work is delegated to LLM the result and applicability heavily depends on LLM at use.
- Ask Claude to brainstorm multiple approaches and iterate on ideas
- Use generated ideas as grounding context for subsequent prompts
- Build on previous suggestions rather than starting from scratch
When to use: Early stages of feature design, architectural decisions, or when stuck on a problem.
💡 Be very direct and explicit with the way you want to interact with LLM. E.g.: "give me 3 results and compare pros and cons for each result using markdown tables"
💡 For common tasks, you can create re-usable slash commands to help you to describe your problem solving approach, e.g.: /five command - Use the "Five Whys" root cause analysis technique
- Provide relevant files and examples
- Perform prior code base / feature exploration and ask Claude to focus on relevant parts
- Use web search and MCPs to gather additional context and information
💡 Hint Claude in the right direction. E.g.: "Hint: you might want to check relevant tests for this functionality"
💡 Use MCP servers for latest/authoritative information. E.g.: (Microsoft Docs MCP, Context7)
- Purpose: Team-shared context and project knowledge
- Content: Architecture decisions, design patterns, coding standards
- Import syntax: Use
@path/to/importto reference other files - Best practice: Keep it concise but comprehensive and high-level
💡 Use # <text> to add specific memories to CLAUDE.md
/clear- Reset conversation context when needed/compact <prompt>- Aggregate and summarize conversation history- Context Control: Manage conversation length for optimal performance
- /context - Review current context and adjust as necessary
💡 Be aware of context limits and how it may impact the quality of responses. It is better to keep your context short and focused.
🤩 See more at TIPS-AND-TRICKS.md
Claude Code is self-aware and driven by human language. So many discrete capabilities can be discovered and triggered through conversation.
- Ask Claude directly about its capabilities: "What tools do you have?" (https://docs.anthropic.com/en/docs/claude-code/settings#tools-available-to-claude)
- Explore features through conversation:
- "Can you run tasks in the background?"
- "Please search the web for..."
- "Extract the content of this website and summarize it"
- Understand limitations by testing boundaries
💡 In this context of MCP/Tools discovery, it is very important to nudge the model to use tools explicitly to get the consistent results, especially as your LLM customizations grows. The bigger context, the less LLM can concentrate on details to give you a good result.
Use progressive thinking levels to solve complex problems: claude-code/common-workflows#use-extended-thinking
- "think" - Basic analysis
- "think hard" - Deeper investigation
- "think harder" - Comprehensive analysis
- "ultrathink" - Maximum depth analysis
When to use: Complex architectural decisions, debugging difficult issues, or when initial solutions seem insufficient.
- Pipe Mode: Use Claude as a Unix utility:
claude -p ""orecho '' | claude -p "" - Integration: Combine with existing development tools and scripts
- Automation: Chain Claude commands for repeated workflows
When to use: When you want to integrate Claude into your CI/CD pipelines or automate repetitive tasks. For example, you can do some decision making as part of your CI/CD workflow based on structured output from Claude.
- Permissions: https://docs.anthropic.com/en/docs/claude-code/settings#permission-settings
- Available Tools: https://docs.anthropic.com/en/docs/claude-code/settings#tools-available-to-claude
- Custom Slash Commands: https://docs.anthropic.com/en/docs/claude-code/slash-commands
- Sub-Agents: https://docs.anthropic.com/en/docs/claude-code/sub-agents
- Be specific about requirements and constraints
- Provide context about your development environment
- Ask for explanations when solutions aren't clear
- Start with working solutions, then optimize
- Use feedback loops to refine approaches
- Don't hesitate to backtrack and try different methods
- Experiment with different prompt styles
- Learn from Claude's reasoning and explanations
- Build a personal knowledge base of effective patterns