In this article I'll show you the most important, but not all available, tools to improve productivity using Claude Code. I'll do it following a popular quote from a renowned author, from Discourse on the Method:
“States with fewer laws are often better governed, provided those laws are strictly followed.” - René Descartes
In our analogy, it means: “Better to follow specific tools and concepts than trying to incorrectly embrace everything.”
I'll skip obvious and generic tips for coding with AI that you should already know in 2026, such as:
“Provide good prompts with the entire context of what you want”
Using existing code to tell AI to follow a pattern: “Develop a calendar component following the same pattern used in the DatePicker component file”
I don’t need to tell you that you must review AI-generated code, test it, and understand what is happening before creating a PR.
General concepts to reach better results with Claude Code
Avoid filling up all the context:
“Most best practices are based on one constraint: Claude’s context window fills up fast, and performance degrades as it fills.” - Claude Code Docs
To avoid it, use /clear when you finish a task to reset context. Also use clear after multiple incorrect code generations to clean up context.
Or you can use /compact to clear context while keeping a compact conversation summary in the context. You can make a custom compact: /compact focus on x,y,z
Use /btw for quick questions that you do not want to include in the context.
Provide Claude Code a way to validate the job done
“Claude performs dramatically better when it can verify its own work, like run tests, compare screenshots, and validate outputs.” - Claude Code Docs
When to use Plan mode vs Act Mode?
Use Plan mode only for large or complex changes to explore, analyze, and create a plan you can review and modify before acting. After reviewing, switch to Act mode.
Same as developers: understand the business problem (explore), translate it into technical constraints (plan), then develop the code (act).
Time travel: Use /rewind to return to a past checkpoint, where you can restore code changes only, conversation only, or both.
CLAUDE.md
CLAUDE.md is read by Claude at the start of every conversation.
This document is where you include: code style and conventions, project overview, architecture, workflows, quality assurance, etc.
Avoid a huge CLAUDE.md; instead, split it into rules or skills.
One common failure pattern: “The over-specified CLAUDE.md. If your CLAUDE.md is too long, Claude ignores half of it because important rules get lost in the noise.” - Claude Code Docs
If you have a rule to prevent a common Claude mistake and it keeps happening, a too-large CLAUDE.md may be causing it to be ignored.
What is a big CLAUDE.md? More than 200 lines.
“Files over 200 lines consume more context and may reduce adherence.” - Claude Code Docs
Use /init to initialize a CLAUDE.md using Claude itself, then refine it.
You can have more than one CLAUDE.md in monorepos.
Rules
Contextual instructions tied to specific path, applied automatically by Claude when working into files within that path.
Used to enforce specific patterns, architecture, and conventions related to that path only.
---paths:-"src/api/**/*.ts"---# API Development Rules-All API endpoints must include input validation-Use the standard error response format-Include OpenAPI documentation comments
Skills
Used to extend Claude's knowledge with specific information about your project.
Claude applies them automatically, or you can invoke them manually with /skill-name.
How to add one skill? Add a SKILL.md file in the following path: .claude/skills/skill-name/SKILL.md
We use skills when we want a topic “specialist” within the main context. We use custom subagents when we want a specialist outside the main context; in the end, they provide a short summary to keep in the main context.
There are default code agents within Claude Code for exploring the codebase, planning, general-purpose tasks, Bash, and more.
Custom Subagents
We can also create subagents for our specific tasks.
/agents → create a new agent → generate with Claude Code → edit what is required
such as tools, AI model, background color, and memory
we can allow only read access, use MCPs, load skills into it, and more
---name:code-reviewerdescription:Reviews code for quality and best practicestools:Read, Glob, Grepmodel:sonnet---You are a code reviewer. When invoked, analyze the code and providespecific, actionable feedback on quality, security, and best practices.
Using custom subagents
Natural language: “Use the test-runner subagent to fix failing tests”
Mention subagent: @"code-reviewer (agent)" look at the auth changes
Run an entire session as a subagent: claude --agent code-reviewer
Or it can be automatically decided by Claude Code when to use each agent.
Running in background for multitasking:“run this in the background”
Parallel Claude Code for parallel tasks with Git worktrees
As developers, we sometimes need to handle multiple tasks at the same time across different projects. For example, as a full-stack developer, you may need to create an API route and consume it on the frontend. Or, while you wait for the AI to generate code for later review, you can work on another feature or fix.
Normally, with Git worktrees, we do the following to create separate branches and working directories without switching branches:
git worktree add ../feature-a -b feature-a
git worktree add ../feature-b -b feature-b
cd ./ → main branch
cd ../feature-a → feature-a
cd ../feature-b → feature-b
With Claude Code, it is similar, but we get the Git advantages along with independent context and history for each worktree:
claude --worktree feature-auth
cd ../feature-auth
Reduce Token Usage While Coding
There are also configurations to be set up as an account manager, applying rate limits and more. But as direct Claude Code users, there are major actions to be taken:
Action 1: Use /clear and /compact to reduce context size
“Token costs scale with context size: the more context Claude processes, the more tokens you use” - Claude Code Docs
Action 2: Use the correct model for tasks; switch models using /model
This is also made by using custom subagents with configured agents for their specific tasks.
“Sonnet handles most coding tasks well and costs less than Opus. Reserve Opus for complex architectural decisions or multi-step reasoning.” - Claude Code Docs
Action 3: Always avoid unnecessary file reads
For typed languages, utilize a code intelligence plugin for easier code navigation, reducing token usage by avoiding reading unnecessary files. - Documentation
A Skill file can provide Claude with domain knowledge, including details about architecture and folder structure, avoiding unnecessary file reads.
Use hooks to provide only necessary logs instead of sending 10k logs to Claude. For example, instead of sending all tests, use a hook to send only those that failed. Documentation Using Hooks
Action 4: Provide a short CLAUDE.md, move instructions to skills, and use them only when needed. CLAUDE.md should contain only a general project overview and code conventions, not specific instructions to follow.
The majority of these actions can be summarized in two parts:
1 - Reduce context size.
2 - Use tools correctly: short CLAUDE.md, skills for specific task guidance, plan mode for complex tasks, subagents for verbose output, etc.
For specific usage details, configuration and more: /status
Top comments (0)