This post shares my collection of practical recommendations and principles for using Claude Code. For more details and the full source code, check out my repository:
Source code: github.com/NikiforovAll/claude-code-rules
Practical Recommendations
Here is my list of practical recommendations for using Claude Code:
Planning
- Ask Claude to brainstorm ideas and iterate on them. Later, these ideas can be used as grounding context for your prompts.
-
plan modevsauto-accept modevsedit mode:- Verify what is about to be performed using
plan mode. - Once verified, proceed with
auto-accept mode. - Step-by-step mode is the default mode with no auto-accept.
- Verify what is about to be performed using
- Workflows:
- a. Explore, plan, code, commit.
- b. Write tests, commit; code, iterate, commit.
- c. Write code, screenshot results, iterate.
- Ask “think hard” to trigger deep thinking:
- “think” < “think hard” < “think harder” < “ultrathink”
AI Task-Based Development
- Write a plan to an external source (e.g., file - plan.md) and use it as a checklist.
-
plan.prompt.md- use an external file as memory for task management and planning.
I’ve created a set of commands to help with AI task-based development:
- Use
/create-prdto create a Product Requirements Document (PRD) based on user input. - Use
/generate-tasksto create a task list from the PRD. - Use
/process-task-listto manage and track task progress.
Project structure looks like this:
tree -a
# .
# ├── .claude
# │ ├── commands
# │ │ ├── create-prd.md
# │ │ ├── generate-tasks.md
# │ │ └── process-task-list.md
# │ └── settings.local.json
# ├── .mcp.json
# └── README.md
For more details, please refer to source code.
Knowledge Mining / Grounding
- Use the
/initcommand to initialize theCLAUDE.mdfile. There’s no required format forCLAUDE.mdfiles. I recommend keeping it concise and human-readable. You can use it to store important information about your project, such as architecture, design decisions, and other relevant details that can help Claude understand your codebase better. -
CLAUDE.mdcan open other files like this:@path/to/import. Be careful, as this file is attached every time you submit a prompt. - There are two different types:
- Project memory
./CLAUDE.md- share it with your team. - User memory
~/.claude/CLAUDE.md- personal preferences.
- Project memory
- You can use
# <text>to add particular memory to theCLAUDE.mdfile. -
Use
/memoryto edit the memory file directly. It will open the file in your default editor. - Codebase Q&A: Use Claude Code to ask questions about your codebase. It can help during onboarding or when you need to understand how something works.
- Use hints, reference files, provide examples, mention documentation, and provide links.
Miscellaneous
- Use in “pipe” mode, as Unix philosophy utils:
claude -p ""orecho '' | claude -p "". - 🗑️
/clearand/compact <specific prompt for aggregation>can be very helpful. - 🧠 If you don’t know something about Claude Code, ask it! It’s self-aware.
- E.g., What kind of tools do you have? Can you perform a web search?
MCP Servers
You can use MCP servers. See claude-code/mcps.
Here is an example of how to setup MCP servers, just create a .mcp.json file in your project root:
{
"mcpServers": {
"microsoft.docs.mcp": {
"type": "http",
"url": "https://learn.microsoft.com/api/mcp"
},
"context7": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@upstash/context7-mcp@latest"
]
}
}
}
🎁 Bonus: Turn Claude Code into an Interactive Tutor with Microsoft Docs & Context7
You can supercharge Claude Code by integrating it with Microsoft Docs and Context7. It can be useful for learning and development tasks.
Useful Links
- ⭐ Learn best practices for Claude Code: engineering/claude-code-best-practices.
- ⭐ Tutorials - https://docs.anthropic.com/en/docs/claude-code/tutorials
- Explore common use cases for Claude Code: claude-code/common-tasks.
- CLI Usage - https://docs.anthropic.com/en/docs/claude-code/cli-usage
- Claude Code Memory - https://docs.anthropic.com/en/docs/claude-code/memory
- General Prompt Engineering with Claude Models - https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview
- Interactive Tutorial for Prompt Engineering - https://github.com/anthropics/prompt-eng-interactive-tutorial
If you have questions or want to see more, check out the GitHub repository or leave a comment below!
- Topics:
- productivity (14) ·
- productivity (13) ·
- ai (29) ·
- claude (8) ·
- agents (14)