
Claude Code rewards depth. The basics are simple: install it, run it in your project, describe what you want built. But the gap between a casual user and a power user is enormous. These 25 tips cover the patterns, shortcuts, and configurations that compound over time.
Most of these work today on the latest Claude Code release. Some require a Max plan. All of them will make you faster.
Every project should have a CLAUDE.md in its root directory. This file gets loaded automatically at session start and tells Claude your stack, conventions, and hard rules.
# CLAUDE.md
## Stack
- Next.js 16 + React 19 + TypeScript
- Convex for backend
- Tailwind for styling
## Rules
- Always use server actions, never API routes
- Run `pnpm typecheck` after every change
- Never use default exports
Three levels exist: project root (shared via git), user-level (~/.claude/CLAUDE.md for personal preferences), and project-user (.claude/CLAUDE.md for your personal overrides on a specific repo). Layer them. The project file defines team standards. Your personal file defines how you like code formatted. The project-user file handles edge cases.
The CLAUDE.md Generator on this site can scaffold one for your stack in seconds.
Beyond CLAUDE.md, Claude Code can store learned preferences in its memory system. When you correct it during a session - "always use satisfies instead of as" or "never add comments to obvious code" - you can tell it to remember that.
> Remember: always use named exports, never default exports
Claude stores this in its memory file and applies it to future sessions. Over weeks, your Claude Code instance becomes personalized to your exact coding style. This is the closest thing to a coding assistant that actually learns from you.
The memory compounds. Each correction you persist means one fewer correction next session. After a month of active use, Claude Code knows your patterns cold.
Slash commands are markdown files that define reusable prompts. Drop a file in .claude/commands/ and it becomes available as a slash command in every session.
<!-- .claude/commands/review.md -->
Review the staged git changes. Check for:
- Type safety issues
- Missing error handling
- Security concerns (SQL injection, XSS)
- Performance regressions
Output a summary with severity levels.
Now type /review in any session and Claude executes that prompt. Build commands for your common workflows: code review, test generation, documentation updates, migration scripts. The file format is plain markdown, so version control them alongside your code.
Project-level commands go in .claude/commands/. Global commands go in ~/.claude/commands/. Both show up when you type / in a session.
Single-threaded AI assistance is slow. Sub-agents let you decompose work across multiple focused Claude instances running simultaneously.
Spawn three sub-agents:
1. Research agent: search the web for the latest Stripe API changes
2. Frontend agent: build the pricing page component
3. Backend agent: create the webhook handler
Use worktree isolation for each.
Each agent gets its own context, its own tools, and its own git branch. The research agent fetches documentation while the frontend agent builds UI while the backend agent writes server code. No context pollution between them.
Define reusable agent configurations in .claude/agents/ as markdown files. Specify which tools each agent can access, which model it should use, and what system prompt governs its behavior.
Claude Code does not require an interactive terminal. The -p flag runs a single prompt and exits, which makes it scriptable.
claude -p "Add input validation to all API routes in src/app/api/"
This is how you integrate Claude Code into shell scripts, CI pipelines, and automation workflows. Combine it with cron jobs for scheduled maintenance tasks:
# Daily dependency check
claude -p "Check for outdated dependencies and security vulnerabilities. Output a summary."
Headless mode outputs to stdout by default. Pipe it wherever you need it. Combine with --output to write results directly to a file.
When you want Claude Code's response saved to disk rather than printed to the terminal, use the --output flag.
claude -p "Generate a migration plan for upgrading from Next.js 15 to 16" --output migration-plan.md
This pairs well with headless mode for building content pipelines. Generate documentation, audit reports, or code analysis and route the output directly where it belongs.
You can also use --output-format to control the response format. Options include text, json, and stream-json for programmatic consumption.
Long sessions accumulate context. Eventually the model's context window fills up and performance degrades. The /compact command summarizes the conversation so far into a condensed form, freeing up space for more work.
Run it proactively. Do not wait until you see degraded responses. A good rule of thumb: /compact after every major task completion within a session. If you just finished building a component and are about to start on something unrelated, compact first.
You can also pass a focus hint: /compact focus on the authentication changes to tell Claude which parts of the conversation are most important to preserve.
Hooks let you run shell commands at specific points in Claude Code's lifecycle. Define them in .claude/hooks.json or your project settings.
{
"hooks": {
"postSave": "pnpm typecheck && pnpm lint",
"preCommit": "pnpm test",
"stop": "claude -p 'Reflect on this session and update skills'"
}
}
The postSave hook catches type errors immediately after Claude modifies a file. The preCommit hook ensures tests pass before any commit. The stop hook triggers a self-reflection step when you end a session, feeding corrections back into your skill files.
Hooks close the gap between "AI wrote some code" and "AI wrote code that meets my quality bar." Automate the verification loop and you never ship unchecked output.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
Git worktrees let you run multiple Claude Code sessions on the same repo without conflicts. Each session gets its own branch and its own working directory.
# Terminal 1
claude
> Build a pricing page with monthly/annual toggle
# Terminal 2 (same repo)
claude
> Build a pricing page with a slider-based UI
Claude Code automatically creates worktree branches. You end up with two independent implementations you can compare side by side. Merge the one you prefer, delete the other.
This pattern is powerful for A/B testing approaches. Not sure whether to use a modal or a slide-over panel? Spawn two agents, get both built, and pick the winner.
Stop telling Claude what to build. Let it ask you questions first.
I want to add authentication to this app. Before writing any code,
interview me about my requirements using the Ask User Question tool.
Ask at least 10 questions about technical decisions, UX concerns,
and trade-offs. Then write a spec.
Claude will ask about your auth provider preference, session strategy, role-based access needs, password requirements, and dozens of other decisions you would have glossed over. The resulting spec becomes a contract that Claude executes against.
This front-loads decision-making when it is cheap. Rewriting code after 500 lines of implementation is expensive. Answering ten questions upfront is free.
When sub-agents need to communicate, the SendMessage tool passes structured data between them. Agent A finishes research and sends its findings to Agent B, which uses them to generate code.
This turns sequential workflows into pipelines. Research feeds into implementation. Implementation feeds into testing. Testing feeds back into refinement. Each stage is handled by a specialist agent with the right context and tools.
The key is structuring the handoff. Have Agent A output a well-defined format - a JSON object, a markdown spec, a list of requirements - that Agent B knows how to consume. Loose handoffs produce loose results.
Before Claude writes a single line of code, you can ask it to plan. Shift+Tab toggles plan mode in the interactive session. Claude outputs a structured plan - files to create, changes to make, tests to write - without executing anything.
Review the plan. Adjust it. Then let Claude execute. This prevents the common failure mode where Claude charges ahead, builds something wrong, and then has to undo half the work.
Plan mode is especially valuable for:
Skills are reusable capability definitions stored as markdown. They live in .claude/commands/ and can be invoked as slash commands, but they go deeper than simple prompts.
A well-built skill includes:
<!-- .claude/commands/deploy-check.md -->
Before deploying, verify:
1. All tests pass (`pnpm test`)
2. TypeScript compiles (`pnpm typecheck`)
3. No console.log statements in production code
4. Environment variables are documented
5. Database migrations are up to date
If any check fails, stop and report. Do not proceed with deployment.
Skills can self-improve by reflecting on sessions and updating their own instructions with confidence levels. Over time, a skill file becomes a refined, battle-tested playbook.
The Model Context Protocol lets Claude Code talk to external tools and services through a standardized interface. Database browsers, API clients, cloud dashboards, design tools - anything with an MCP server becomes accessible from your terminal.
Use the MCP Config Generator to build your configuration file, then drop it into .claude/mcp.json:
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "postgresql://localhost:5432/mydb"
}
}
}
}
Now Claude can query your database directly. Ask it to inspect schema, run queries, or debug data issues without leaving your terminal session. See the full MCP server guide for setup patterns across different services.
Beyond Claude Code's automatic worktree creation, you can manually set up worktrees for specific branch-based workflows.
git worktree add ../my-project-feature feature-branch
cd ../my-project-feature
claude
This is useful when you want to run Claude Code against a specific branch while keeping your main working directory untouched. Combine it with sub-agents: one agent works in the main directory, another works in a worktree, both contribute to the same repo.
Clean up when you are done:
git worktree remove ../my-project-feature
The Chrome MCP server gives Claude Code eyes. It can navigate pages, read content, fill forms, take screenshots, and interact with web UIs directly from your terminal session.
Navigate to localhost:3000 and take a screenshot.
Check if the pricing page renders correctly on mobile.
This is invaluable for frontend development. Claude builds a component, then visually verifies it looks right. No more switching between terminal and browser to check output. The Chrome automation guide covers the full setup.
MCP servers for Linear and GitHub let Claude Code read issues, create tickets, update status, and link PRs - all from your coding session.
Read the open issues in Linear. Pick the highest priority bug.
Fix it. Create a PR. Update the Linear issue status to "In Review."
This collapses the context switch between project management and implementation. You stop tab-switching between your issue tracker and your editor. Claude reads the requirements, implements the fix, and updates the tracker in one flow.
Claude Code runs in any terminal, including VS Code's integrated terminal. But dedicated extensions exist that add deeper integration: inline diff views, context sharing with open files, and keyboard shortcuts that bridge the IDE and the agent.
The practical setup: open VS Code's terminal, run claude, and work. VS Code provides the file tree and editor. Claude Code provides the agent. You get the best of both worlds without committing to a fully AI-native IDE.
For teams evaluating Claude Code vs Cursor, the VS Code integration is the middle ground. You keep your existing editor setup and add Claude Code's agent capabilities on top.
Not every task needs the full Opus or Sonnet model. Claude Code's --model flag lets you switch to faster, cheaper models for routine work.
claude --model haiku -p "Rename all instances of userId to accountId in src/"
Haiku is faster and costs less. Use it for mechanical changes: renaming, formatting, simple refactors, boilerplate generation. Save the heavy models for architecture decisions, complex debugging, and nuanced code review.
Sub-agents can also be configured to use Haiku by default. Your research agent might need Opus for nuanced analysis, but your formatting agent works fine on Haiku.
When you have a list of independent tasks, do not run them sequentially. Spawn parallel agents.
I need to:
1. Add error boundaries to all page components
2. Write unit tests for the auth module
3. Update the API documentation
4. Fix the responsive layout on the dashboard
Spawn four sub-agents and handle these in parallel.
Four agents, four tasks, one-quarter the wall-clock time. Each agent works independently, so there is no bottleneck. This is the single biggest productivity multiplier in Claude Code.
The pattern scales. Ten independent tasks? Ten agents. The limit is your token budget, not your patience.
If Claude spends tokens re-discovering your architecture every session, you are burning money. Put the answers in CLAUDE.md.
## Architecture Notes
- Auth: Clerk (middleware in src/middleware.ts)
- Database: Convex (schema in convex/schema.ts)
- API routes: None. We use server actions exclusively.
- State: React Server Components + Convex reactive queries
- Deployment: Vercel (auto-deploy on push to main)
Every fact in CLAUDE.md is a fact Claude does not need to rediscover by reading files. This reduces token usage, speeds up responses, and improves accuracy. Think of it as a cache for your agent's understanding of your codebase.
Update it regularly. When you make architectural decisions during a session, add them to CLAUDE.md before ending. Future sessions start from a higher baseline.
Different models have different strengths. Claude Code defaults to your plan's primary model, but you can override per session.
# Full power for architecture work
claude --model opus
# Fast iteration for small fixes
claude --model haiku
# Balanced for most development
claude --model sonnet
You can also switch models mid-session if you start with a lighter model for exploration and need to escalate to something more capable for implementation.
The /cost command shows your current session's token usage - input tokens, output tokens, and estimated cost. Run it periodically to stay aware of consumption.
> /cost
Input: 45,231 tokens
Output: 12,847 tokens
Total: 58,078 tokens
If you see token counts climbing fast, it usually means Claude is re-reading large files repeatedly. That is a signal to /compact or to add key information to your CLAUDE.md so Claude does not need to grep through your codebase for context it already found.
Combine headless mode with cron jobs to build a daily development briefing.
#!/bin/bash
# morning-briefing.sh
claude -p "
Check the git log for yesterday's commits.
List any open PRs that need review.
Check for failing CI runs.
Summarize what needs attention today.
" --output ~/briefings/$(date +%Y-%m-%d).md
Schedule this with cron or launchd and you start every morning with a status report generated by Claude Code. It reads your repo state, checks CI, and surfaces what matters - before you open a single browser tab.
This extends naturally. Add checks for dependency updates, security advisories, or stale branches. The briefing grows with your needs.
Claude Code's headless mode makes it a building block for content pipelines. Chain multiple invocations to produce structured output.
#!/bin/bash
# Generate a blog post from a video transcript
TOPIC="$1"
# Step 1: Research
claude -p "Research the topic: $TOPIC. Output key points as bullet list." \
--output /tmp/research.md
# Step 2: Draft
claude -p "Using the research in /tmp/research.md, write a blog post. \
Follow the style guide in CLAUDE.md." \
--output /tmp/draft.md
# Step 3: Review
claude -p "Review /tmp/draft.md for technical accuracy, tone, and SEO. \
Output the final version." \
--output "content/blog/${TOPIC}.md"
Each step is a focused invocation with clear input and output. The pipeline is version-controlled, repeatable, and improvable. Add steps for SEO optimization, image generation, or social media drafts.
This is how you turn Claude Code from a tool you use interactively into infrastructure that runs your development workflow.
These 25 tips share a common thread: compounding returns. A CLAUDE.md file saves you five minutes every session. Multiplied by hundreds of sessions, that is days recovered. Sub-agents cut task time by 3-4x. Skills that self-improve get better every week.
The power users are not the ones who write the cleverest prompts. They are the ones who invest in configuration, automation, and tooling that pays dividends across every future session.
Pick three tips from this list. Implement them today. Build from there.
For more on Claude Code, check out the complete guide, the sub-agents deep dive, and the tools directory.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Anthropic's agentic coding CLI. Runs in your terminal, edits files autonomously, spawns sub-agents, and maintains memory...
View ToolAI voice dictation for macOS. Works in any app - code editors, browsers, notes. Understands context and formats output...
View ToolNew tutorials, open-source projects, and deep dives on coding agents - delivered weekly.
OpenAI's flagship. GPT-4o for general use, o3 for reasoning, Codex for coding. 300M+ weekly users. Tasks, agents, web br...

Anthropic has released Channels for Claude Code, enabling external events (CI alerts, production errors, PR comments, Discord/Telegram messages, webhooks, cron jobs, logs, and monitoring signals) to b

Claude Code “Loop” Scheduling: Recurring AI Tasks in Your Session The script explains Claude Code’s new “Loop” feature (an evolution of the Ralph Wiggins technique) for running recurring prompts that

Anthropic's Big Claude Code & Cowork Update: Remote Control, Scheduled Tasks, Plugins, Auto Memory + New Simplify/Batch Skills The script recaps a consolidated update on new Anthropic releases across

The exact tools, patterns, and processes I use to ship code 10x faster with AI. From morning briefing to production depl...

Complete pricing breakdown for every major AI coding tool - Claude Code, Cursor, Copilot, Windsurf, Codex, and more. Fre...

How solo developers and indie hackers ship products 10x faster using AI coding tools. The complete stack for building al...