Claude Code is Anthropic's official AI coding agent, used by developers at companies from startups to Fortune 500. Learn more →
Claude Code Tips10 Claude Code Tips I Use Daily (That Most People Miss)
Most people use Claude Code like a chatbot. These 10 tips turn it into a productivity machine — from CLAUDE.md memory files to subagents, hooks, piping, and model switching.
TL;DR — All 10 Tips
- CLAUDE.md files — persistent memory across sessions
- Subagents — parallel task execution (5-20x throughput)
- Plan Mode — read-only analysis before big changes
- Custom slash commands — repeatable workflows in one keystroke
- Git hooks — auto-commit, auto-lint, PR review agents
- Piping — chain Claude with any terminal command
- Model switching — cut costs 60-80% on simple tasks
- Keyboard shortcuts — double-Escape rewind, Cmd+P model picker
- Permission presets — stop the "Allow?" spam permanently
- Claude Code + OpenClaw — code + life automation together
The biggest Claude Code productivity gains come from features most people never touch: CLAUDE.md files for persistent memory, subagents for parallel work, hooks for automation, and piping for chaining commands. These aren't hidden — they're just buried in the docs where nobody looks.
I've been using Claude Code daily since launch. These are the 10 tips that actually changed how I work — not theory, but techniques I reach for every single day. Each one saves real time, and most take under 5 minutes to set up.
Tip #1: Use CLAUDE.md Files to Set Persistent Context ~30 min/day saved
This is the single highest-leverage thing you can do. A CLAUDE.md file gives Claude persistent memory across sessions. Without one, you re-explain your project every time you open Claude Code.
Why it matters: Every session without a CLAUDE.md starts from zero. You waste 5-10 minutes re-explaining your stack, conventions, and current work. Multiply that by 6 sessions a day, and you're losing an hour just on context-setting.
Run /init and Claude creates a starter file. But the real power comes from what you put in it:
# Project: Marketing Site
## Stack
- Next.js 14, TypeScript, Tailwind
- Deployed on Vercel, DB on Supabase
## Conventions
- Use server components by default
- All API routes go in /app/api/
- Run `npm run lint` before committing
- Never modify files in /generated/
## Current sprint
- Redesigning pricing page
- A/B test variant B is active
## Mistakes to avoid
- Don't use client components unless interactivity is required
- Always use `@/` path aliases, never relative imports above 2 levels
- The Supabase client is initialized in /lib/supabase.ts — don't create new instances
The trick most people miss: you can have multiple CLAUDE.md files. Claude reads them hierarchically:
~/.claude/CLAUDE.md— global preferences (applies everywhere)~/project/CLAUDE.md— project-level context~/project/src/CLAUDE.md— directory-specific rules
Put your coding style preferences in the global file. Put project-specific architecture in the project file. Put module-specific rules in subdirectories.
"CLAUDE.md is like .env for AI context. Once you start using it, you can't go back."
— Common sentiment in r/ClaudeAI
Tip #2: Subagents for Parallel Tasks ~1-2 hrs/day saved
This is the feature that turns Claude Code from "fast assistant" into "small engineering team." Subagents let Claude spawn independent workers that run in parallel.
Why it matters: Sequential work is the biggest bottleneck in AI-assisted coding. A 30-minute refactor across 10 files becomes a 5-minute parallel job. Real developers on Reddit report running 5-20 parallel Claude instances in tmux sessions for massive throughput.
Instead of Claude doing tasks sequentially — refactor file A, then update tests, then fix docs — it can spin up three subagents that work simultaneously:
Refactor the authentication module. Use subagents to:
1. Update the auth middleware in /src/middleware/auth.ts
2. Fix all related tests in /tests/auth/
3. Update the API documentation in /docs/api.md
Run these in parallel.
Each subagent gets its own context window, reads the project's CLAUDE.md, and works independently. The main agent coordinates and merges results.
When to reach for subagents:
- Large refactors — different files can be updated simultaneously
- Test + implementation — write code and tests at the same time
- Multi-file generation — create multiple components in parallel
- Research tasks — investigate different approaches simultaneously
Tip #3: Plan Mode Before Big Changes ~20 min/task saved
Press Shift+Tab twice to enter Plan Mode. In this mode, Claude reads and analyzes but cannot make any changes. It's read-only.
Why it matters: Letting Claude code without a plan is like building without blueprints. You end up spending 30 minutes undoing bad architectural decisions that 2 minutes of planning would have prevented.
This sounds limiting. It's actually liberating.
Plan Mode is for when you need Claude to think before it does. Ask it to analyze your codebase, propose an architecture, compare approaches — all without touching a single file.
# Enter Plan Mode (Shift+Tab twice), then:
I want to add Stripe payments to this app.
Analyze the current codebase and give me a detailed
implementation plan:
- What files need to change?
- What new files do we need?
- What's the order of operations?
- What could go wrong?
- What are the security considerations?
Claude produces a thorough plan. You review it, adjust it, maybe ask follow-up questions — still in Plan Mode. When the plan is right, exit Plan Mode and tell Claude to execute it.
The pattern: Plan → Review → Execute → Verify. Use Ctrl+G to open the plan in your text editor for direct editing. Read our full Plan Mode guide for advanced techniques.
Tip #4: Custom Slash Commands for Repeated Workflows ~15 min/day saved
If you find yourself typing the same instruction more than twice, make it a custom slash command.
Why it matters: Repetitive prompts waste tokens, time, and mental energy. A slash command turns a 200-word prompt into a 2-second keystroke — and it's consistent every time.
Create a file in .claude/commands/ and it becomes a slash command:
# .claude/commands/deploy-check.md
Before deploying, run through this checklist:
1. Run all tests: `npm test`
2. Check for TypeScript errors: `npx tsc --noEmit`
3. Run the linter: `npm run lint`
4. Check for console.logs in production code:
`grep -rn "console.log" src/ --include="*.ts" --include="*.tsx"`
5. Verify environment variables are set
6. Build the project: `npm run build`
Report each step as pass/fail. Stop on the first failure.
Now type /project:deploy-check and Claude runs the entire checklist automatically.
More powerful example with dynamic arguments:
# .claude/commands/review.md
Review the file $ARGUMENTS for:
- Security vulnerabilities (SQL injection, XSS, CSRF)
- Performance issues (N+1 queries, missing indexes)
- Missing error handling
- Code style violations per our CLAUDE.md conventions
Format: table with severity (critical/warning/info), line number, and fix.
Usage: /project:review src/api/users.ts
Commands I use daily:
/project:review— code review checklist for the current diff/project:morning— check git status, failing tests, open TODOs/project:refactor— analyze a file and suggest improvements/project:document— generate docs for undocumented functions
For the full setup, see Claude Code Slash Commands.
Tip #5: Hook Into Git for Auto-Commits and PR Reviews ~25 min/day saved
Hooks are automatic triggers that run at specific points in Claude Code's workflow. The most immediately useful one: auto-committing after Claude makes changes.
Why it matters: Without auto-commits, you lose the ability to undo granularly. With them, every Claude action becomes a checkpoint you can revert to. Community developers also use hooks to build PR review agents that automatically read diffs for missing tests, risky changes, and security issues.
Add this to your .claude/settings.json:
{
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hook": "cd \"$PROJECT_DIR\" && git add -A && git commit -m \"auto: claude code changes\" --no-verify 2>/dev/null || true"
}
],
"PreToolUse": [
{
"matcher": "Bash",
"hook": "echo \"$TOOL_INPUT\" | grep -qE '(rm -rf|sudo|DROP TABLE)' && echo 'BLOCKED: dangerous command' && exit 1 || true"
}
]
}
}
Now every time Claude writes or edits a file, it auto-commits. This gives you a complete undo history — if Claude goes off track, just git log --oneline and revert to any point.
I compiled my best tips and the exact setup I use into a free guide — it goes deeper than what I can cover here.
Other hook ideas that save real time:
- PostToolUse on Write: Auto-run Prettier/ESLint after every file edit
- PreToolUse on Bash: Block dangerous commands (rm -rf, DROP TABLE, etc.)
- Notification: Send a Slack/desktop notification when a long task finishes
- PR review agent: Auto-analyze diffs for missing tests and security issues on every commit
Tip #6: Pipe Output Into Claude Code for Chaining ~10 min/task saved
This is the Unix philosophy applied to AI. Claude Code accepts piped input, which means you can chain it with any terminal command.
Why it matters: Piping turns Claude into a composable tool in your existing workflow. Instead of copy-pasting error logs or test output into a chat window, you feed it directly. It's faster and preserves the full output.
# Analyze test failures
npm test 2>&1 | claude "analyze these test failures and fix them"
# Review a diff for bugs and security issues
git diff main | claude "review this diff for bugs, security issues, and missing tests"
# Explain error logs
cat /var/log/app-error.log | claude "what's causing these errors? give me a fix"
# Process CSV data
cat sales.csv | claude "summarize this data, find anomalies, output as markdown table"
The real power comes from chaining multiple steps:
# Find TODO comments and create GitHub issues
grep -rn "TODO" src/ | claude "create a GitHub issue body for each TODO" | gh issue create --body-file -
# Generate a commit message from staged changes
git diff --staged | claude -p "write a conventional commit message for this diff"
# Audit dependencies for issues
npm audit --json | claude -p "summarize critical vulnerabilities and suggest fixes"
The -p flag (print mode) is key for non-interactive piping — Claude processes the input and prints the result without starting a session. This turns Claude Code into a composable Unix tool that fits into any pipeline.
Tip #7: Model Switching for Cost Control ~60-80% cost reduction
Not every task needs Opus 4.6. Switching models mid-session is the easiest way to cut costs without losing quality where it matters.
Why it matters: Most Claude Code sessions mix trivial tasks (rename variables, add imports) with complex ones (design a caching layer). Paying Opus prices for everything is like hiring a senior architect to move furniture.
Press Cmd+P (Mac) to open the model picker, or type /model:
| Task | Model | Why |
|---|---|---|
| Complex architecture decisions | Opus 4.6 | Needs deep reasoning |
| Writing code from clear specs | Sonnet 4.5 | Fast, good enough |
| Fixing typos, formatting | Haiku | Trivial tasks, cheapest |
| Large refactors | Opus 4.6 + high effort | Max reasoning power |
| Boilerplate generation | Sonnet 4.5 | Speed over depth |
A typical cost-optimized workflow:
# Start session — scaffold on Sonnet (cheap + fast)
/model sonnet-4.5
Create the file structure for a new REST API module with user CRUD.
# Hit a complex problem — switch to Opus
/model opus-4.6
Design the caching layer. We need Redis for sessions
and in-memory LRU for frequently accessed user profiles.
Handle cache invalidation on writes.
# Back to Sonnet for cleanup
/model sonnet-4.5
Add JSDoc comments to all public functions in this module.
The model picker also lets you adjust effort level (low, medium, high) which controls how deeply the model reasons. Low effort + Sonnet for simple tasks. High effort + Opus for the hard stuff. Read the full model switching guide.
Tip #8: Keyboard Shortcuts That Matter ~10 min/day saved
There are dozens of keyboard shortcuts. These are the only ones that actually change your daily workflow:
| Shortcut | What It Does | Why It Matters |
|---|---|---|
| Shift+Tab | Cycle modes (Normal → Auto → Plan) | The most important shortcut. Period. |
| Esc | Stop Claude mid-response | Catch mistakes early |
| Esc Esc | Open rewind menu | Undo to any checkpoint |
| Cmd+P | Model picker | Switch models without typing |
| Ctrl+R | Search history | Re-run previous prompts |
| Ctrl+G | Open in external editor | Write long prompts in your editor |
| @ | Reference a file | Point Claude at specific files |
The one most people miss: double-tap Escape for the rewind menu. This lets you undo Claude's changes to any previous checkpoint. It's like unlimited undo, but for entire sequences of actions.
# Quick reference — pin this to your wall
Shift+Tab → cycle modes (Normal/Auto/Plan)
Esc → stop Claude mid-response
Esc Esc → rewind menu (undo to any point)
Cmd+P → model picker
Ctrl+R → search prompt history
Ctrl+G → edit prompt in $EDITOR
@filename → reference a file in your prompt
You can also create custom keybindings by running /keybindings and editing ~/.claude/keybindings.json. See the full keyboard shortcuts guide for every available shortcut and custom binding examples.
Tip #9: Permission Presets to Stop the "Allow?" Spam ~15 min/day saved
Nothing kills flow like Claude asking "Allow this tool?" 47 times per session. Permission configuration fixes this permanently.
Why it matters: Every permission prompt breaks your focus. Over a full day, you might click "Allow" 50-100 times for operations you'd always approve. That's not just time lost — it's flow state destroyed.
Edit .claude/settings.json in your project:
{
"permissions": {
"allow": [
"Read",
"Grep",
"Glob",
"LS",
"Bash(npm test)",
"Bash(npm run lint)",
"Bash(npx tsc --noEmit)",
"Bash(git status)",
"Bash(git diff*)",
"Bash(git log*)",
"Bash(cat *)"
],
"deny": [
"Bash(rm -rf*)",
"Bash(sudo*)",
"Bash(curl*|*)",
"Bash(wget*)",
"Bash(*DROP*)",
"Bash(*DELETE FROM*)"
]
}
}
This tells Claude: "Read files, run tests, lint, and check git freely. Never delete recursively, run as sudo, or execute destructive SQL."
The result: Claude flows through read operations and safe commands without interrupting you, but still asks before anything destructive.
You can also use Shift+Tab to switch to Auto-Accept mode for trusted projects. This auto-approves file edits but still asks before shell commands. For the full setup, see our permissions guide.
Bash(npm test)) rather than broad (e.g., Bash(*)).
Tip #10: When to Use Claude Code vs. OpenClaw Unlocks 24/7 automation
This one's less about a setting and more about knowing which tool fits. Claude Code and OpenClaw solve different problems.
Why it matters: Claude Code is a coding session tool — powerful but ephemeral. OpenClaw is an always-on agent platform. Using only one is like having a carpenter but no architect, or vice versa. Together, they cover everything from code to life automation.
Use Claude Code when:
- You're writing or editing code in a specific project
- You need file system access and terminal commands
- You want interactive, back-and-forth coding sessions
- The task is contained within a codebase
Use OpenClaw when:
- You need persistent, always-on AI that works across tools
- You want to orchestrate multiple services (email, calendar, messaging)
- You need scheduled tasks and background automation
- You want AI that reaches out to you proactively
The sweet spot: use both together. OpenClaw can spawn Claude Code sessions as subagents for coding tasks, then handle the non-coding parts (notifications, scheduling, communication) itself. Community developers report using this pattern to build "3AM autopilot" systems — Sentry fires an alert, OpenClaw pulls logs, opens an issue, proposes a fix, and creates a PR, all without human intervention.
# Example: OpenClaw AGENTS.md routing to Claude Code
## Routing Policy
- Code changes → spawn Claude Code subagent in project dir
- PR reviews → Claude Code reads diff, posts review comments
- Sentry alerts → pull logs → analyze → open GitHub issue
- Email/calendar/Slack → handle directly via OpenClaw skills
Read the full Claude Code vs. OpenClaw comparison to see where each tool shines.
Putting It All Together
Here's what a productive Claude Code setup looks like when you combine these tips:
- CLAUDE.md is set up with project context, conventions, and "mistakes to avoid"
- Permissions are configured so Claude doesn't interrupt for safe operations
- Custom commands handle your daily workflows (deploy checks, code review, morning standup)
- Hooks auto-commit changes and format code
- You use Plan Mode for anything complex before executing
- You switch models based on task complexity
- You pipe output into Claude for quick one-shot tasks
- Subagents parallelize large refactors
The total setup time: about 30 minutes. The daily time saved: 2-4 hours.
Bonus: Advanced Tips from the Community
These go beyond the basics. They come from real developers sharing workflows on Reddit and developer forums.
Parallel Coding with tmux (Subagents on Steroids)
Advanced users don't just use Claude's built-in subagents — they run 5-20 parallel Claude Code instances in tmux or SSH sessions, each working on a different part of the codebase:
# Create a tmux session with 4 parallel Claude instances
tmux new-session -d -s claude-parallel
# Window 1: API routes
tmux send-keys -t claude-parallel "cd ~/project && claude 'build all CRUD routes for /api/users'" Enter
# Window 2: Tests
tmux new-window -t claude-parallel
tmux send-keys -t claude-parallel "cd ~/project && claude 'write integration tests for the user API'" Enter
# Window 3: Frontend components
tmux new-window -t claude-parallel
tmux send-keys -t claude-parallel "cd ~/project && claude 'create React components for user management'" Enter
# Window 4: Documentation
tmux new-window -t claude-parallel
tmux send-keys -t claude-parallel "cd ~/project && claude 'generate API docs from the route handlers'" Enter
Each instance has its own API context and works independently. The key is giving each instance a clearly scoped task with no file overlap. This is how teams ship features in hours instead of days.
The Skill Migration Pattern (42 Skills, 30/30 Tests)
A community power user migrated 42 custom skills and 56 agents from Claude Code to OpenClaw, and documented the entire process. The key insights:
- YAML frontmatter is mandatory: Skills need proper
nameanddescriptionfields in YAML frontmatter — without them, skills are "invisible at runtime" and silently ignored - Build explicit routing: Create an intent map in AGENTS.md that routes prompts to the right specialist skill. Without routing, agents behave as generalists even with specialist skills loaded
- Test with prompt matrices: Build a matrix of 30+ test prompts covering all skill domains. Baseline your hit rate, fix failures, and re-test until you hit 30/30
# Example: Skill YAML frontmatter (required!)
---
name: code-review
description: Analyzes code diffs for bugs, security issues, and style violations
---
# Code Review Skill
When reviewing code:
1. Check for security vulnerabilities (SQL injection, XSS, CSRF)
2. Flag missing error handling
3. Identify performance issues (N+1 queries, missing indexes)
4. Verify test coverage for changed code
...
# Example: Routing policy in AGENTS.md
## Intent Routing
- "review" / "check code" / "audit" → code-review skill
- "deploy" / "release" / "ship" → deployment skill
- "test" / "coverage" / "spec" → testing skill
- "document" / "docs" / "README" → documentation skill
Governed Agents Create Trusted Artifacts
A pattern from the community: "Governed agents compound because they create assets you can trust." Instead of agents that just chat, build agents that produce concrete artifacts — diffs, logs, PRs, checklists, reports. These artifacts become a paper trail that compounds over time.
Every agent workflow should have: a trigger (what starts it), context (what it reads), an action (what it does), an artifact (what it produces), and guardrails (what prevents mistakes). If you can't define all five, you don't have a workflow — you have a demo.
Related Guides
- Claude Code Tutorial for Beginners — your first project
- What Is Claude Code? — understand the fundamentals
- Claude Code for Non-Coders — non-technical workflows
- How to Write a CLAUDE.md File — deep dive on project memory
- Claude Code Subagents Guide — parallel task execution
- How to Use Plan Mode — read-only analysis
- Slash Commands in Claude Code — custom commands
- Claude Code Hooks Guide — automation triggers
- Keyboard Shortcuts — complete reference
- Permissions Guide — configure access control
- How to Change Models — model switching
- OpenClaw vs. Claude Code — when to use each
Free: The AI Growth Breakdown
See how one business went from 0 to 600 daily visitors in 14 days using AI. The exact tools and results.
Get the Free Breakdown →