Seven Tips for Using Claude Code

I recently shared these seven tips for using Claude Code during an internal company presentation, so I’ve compiled them into an article to share with everyone.
While the founder of Claude Code has written similar threads, this article still contains some novel content, especially in section 3: Sub-fractal Architecture.
1. Plan Before You Code
Before tackling any complex requirements, I always enable Plan mode to communicate with the AI about what I need.
You can use the /plan command or press Shift + Tab to open Plan mode.
The biggest benefit of Plan mode is that it forces you to think—yes, you, not the AI.
In this mode, the AI will continuously ask you detailed questions to gradually clarify the boundaries and structure of your requirements, then output a detailed task document for you.
Based on this task document, you can communicate changes and desired outcomes with it, reducing the likelihood of rework.
When handling extremely large tasks, you can also ask it to save the task as a persistent document. Claude Code now has multi-session shared todo functionality, but it’s not enabled by default.
2. Master Claude.md
Claude.md is Claude Code’s default configuration file loaded on startup. When Claude Code launches, it starts as a clean slate beyond system instructions and MCP configurations, so it loads the Claude.md file in your project root to understand your project context.
I typically include three directives in Claude.md:
- Address Rule: Always address me as “Boss” before any response.
- Decision Confirmation: When encountering uncertain code design issues, must consult Boss first before taking action.
- Code Compatibility: Never write backward-compatible code unless Boss explicitly requests it.
The first directive verifies instruction adherence.
As we all know, when context becomes too long, AI starts to ignore instructions. So if you notice that the AI’s response doesn’t include the “Boss” prefix, you know the conversation context has overloaded and it’s time to start a new session with /new.
The second directive constrains the AI’s autonomous behavior.
AI always loves to dive in without asking questions first, which often leads to rework. With this directive, it frequently asks you how you want to design something and provides several options.
The third directive also constrains the AI.
Many times, when iterating on a task and you know it’s wrong, asking it to fix the issue often results in it adding an if branch on top of the existing code, justifying it as “compatibility” and “system robustness.”
I’m not a fan of excessive redundant code, so most of the time I just want it to complete my requirements rather than overthinking on my behalf.
Generally, when context window usage exceeds 40%, the AI’s instruction adherence starts degrading. So keep an eye on how much context is remaining—once it drops below 50%, I start a new window.
You can do two things:
- Disable context compression, which consumes 22.5% of your total context even when you’re doing nothing.
- Use the
/showlinecommand to display context percentage in the status bar.
Also, you don’t need to put everything in Claude.md—use lazy loading and only check files when needed.
Here’s a lazy loading example: it tells Claude Code through three directives to check the corresponding files when encountering these three scenarios, following the specifications inside.
3. Use Sub-fractal & Self-describing Architecture
The concept of Sub-fractal in Vibe Coding comes from Zhao Chunxiang, but I’ve made some improvements. The core idea is leveraging Claude Code’s hierarchical loading mechanism.
When Claude Code searches files, it automatically loads the Claude.md file in that directory. For example, if you search for “User” and it finds a folder, it will proactively load the Claude.md in that folder. This is called hierarchical loading, or lazy loading.
So we can do the following in certain business code modules:
- Place a Claude.md file in each business module folder. This file documents the module’s important information: its role (what it manages in the system), logic (what it does in the system), constraints (usage rules), and a business domain inventory listing all sub-folders, sub-modules, and functions.
- Set three-line header comments in all source files: INPUT (dependencies), OUTPUT (what it provides), POS (position in the system). These must be at the top because AI loads files from the top down, so every file read includes this business context first.
After doing this, you’ll find:
Claude Code searches code faster because these descriptive comments make search results more relevant.
Claude Code understands code more accurately because whenever it searches and loads something, there’s a corresponding Claude.md to explain the broader direction, preventing it from going off track and making it easier to understand the code content from a macro perspective.
For example, if a file is in the fifth level of a folder hierarchy, when Claude Code finds it, it has already loaded the Claude.md from all four previous levels, giving it an incredibly clear understanding of the entire module.
4. Clear Prompts
With current model capabilities, even poorly written prompts can be understood, so you only need to follow three principles:
- Clearly and accurately describe the final goal of the task—what features it should have, what elements appear on the page.
- Provide reference context, such as API data, API documentation, or pages already written.
- Tell it how to test, such as having frontend pages verified using its built-in Chrome.
5. Use MCP for Retrieval
Even though you’ve installed MCP, Claude Code often doesn’t call it and just goes in circles.
For example, when writing a page, if a particular code usage keeps causing compilation issues or producing different effects than expected, and it can’t solve the problem, you need to proactively tell it to call Context7 to check the online documentation. After reading the documentation, it fills in its context and can write more accurate code.
But there’s no need to install a bunch of MCPs. I always believe:
If it can be solved locally, don’t connect to the cloud.
Too many MCPs consume your context window. You can use the /context command to check detailed context window usage.
6. Agent Collaboration
Agent is a well-established concept, but there are still some tips:
- When searching for things that might consume a lot of context, ask it to open a SubAgent to search. SubAgent has an independent context and won’t occupy the current session’s context. Once it finishes searching, it directly reports results to the current session, preventing context window overload from searching code before the main task is done.
- Call multiple Agents in a single instruction for adversarial error correction. For example, if you have a CodeReview Agent and a Test Agent, you can tell Claude Code after task execution to call the CodeReview Agent for code review and use the Test Agent for test validation. This way, in one task, you’ve called three Agents for adversarial error correction, producing higher accuracy code.
- Parallel development: open two more windows using multi-branch, letting different Agents simultaneously develop different modules. Then open another window specifically for handling PRs between Agents, performing code review and test validation (custom validation methods or TDD both work).
7. Master Skills
Claude Code has now merged custom slash commands and Skills, so we need to consolidate all frequently used functionality as Skills.
For example, the Sub-fractal architecture I introduced in section 3, I made a dedicated Commit Skill that specifically detects code to be committed, then completes comment headers and updates parent folder Claude.md before Git commit.
Skills have the ability to customize prompts, workflows, and schedule SubAgents. Use them wisely and they’re incredibly powerful.