45 Claude Code Tips — From Basics to Advanced

Source: ykdojo/claude-code-tips — 8.6K ★ Author: ykdojo Also: 📺 Demo video · 📝 How I got a job with Claude Code · 📰 Newsletter


Foundation & Setup

Tip 0: Customize Your Status Line

Display model, directory, git branch, uncommitted file count, sync status, token usage bar, and last message. Sample script supports 10 color themes.

Tip 1: Essential Slash Commands

  • /usage — check rate limits
  • /chrome — toggle browser integration
  • /mcp — manage MCP servers
  • /stats — GitHub-style activity graph
  • /clear — fresh start

Tip 2: Voice Input

Talk to Claude Code faster than typing. Options: superwhisper, MacWhisper, Super Voice Assistant (open source). Claude Code now has built-in voice mode too. Even with transcription errors, Claude usually interprets correctly.

Tip 7: Terminal Aliases

alias c='claude'
alias ch='claude --chrome'
alias co='code'
alias gb='github'
alias q='cd ~/Desktop/projects'

Tip 10: Cmd+A / Ctrl+A

Select-all and paste content from pages Claude can’t access directly (private pages, Reddit, Gmail threads, YouTube transcripts). For Gmail, use Print All first to expand the thread.

Tip 38: Input Box Shortcuts

  • Ctrl+A/E — jump start/end of line
  • Option+Left/Right — jump by word
  • Ctrl+W — delete previous word
  • Ctrl+U/K — delete to start/end of line
  • Ctrl+G — open in external editor
  • Ctrl+V — paste image from clipboard
  • \ + Enter — newline in multi-line input

Context Management

Tip 5: Fresh Context

Start a new conversation for each new topic. Claude performs best with minimal accumulated context. Think of AI context like milk — best served fresh and condensed.

Tip 8: Proactive Compaction

Use /compact or create handoff docs before starting fresh. Ask Claude to write a HANDOFF.md with goal, progress, what worked/didn’t. For fresh agents, just pass the file path. Alternatively, use plan mode (/plan or Shift+Tab) to create a comprehensive plan for the next agent with fresh context.

Tip 13: Search History

Conversations stored at ~/.claude/projects/ as .jsonl files. Search with grep or just ask Claude: “What did we talk about regarding X today?”

Tip 15: Slim Down the System Prompt

Patch the CLI bundle to reduce system prompt + tool definitions from ~19k to ~9k tokens (50% savings).

| Component     | Before | After | Savings |
|---------------|--------|-------|---------|
| System prompt | 3.0k   | 1.8k  | 1,200   |
| System tools  | 15.6k  | 7.4k  | 8,200   |
| Total         | ~19k   | ~9k   | ~10k    |

Patch scripts. Disable auto-updates with DISABLE_AUTOUPDATER: "1" in settings. Also enable lazy-load MCP tools with ENABLE_TOOL_SEARCH: "true".

Tip 15b: Lazy-Load MCP Tools

{ "env": { "ENABLE_TOOL_SEARCH": "true" } }

Loads MCP tool definitions on-demand instead of always. Auto-enabled in v2.1.7+ when MCP descriptions exceed 10% context.

Tip 23: Clone / Fork Conversations

  • /fork — built-in native forking
  • --fork-session / --fs shortcut — fork with resume
  • Half-clone: keeps only the later half of a conversation to reduce context. Tagged with [HALF-CLONE <timestamp>].
  • Auto-suggest: hook checks context usage > 85% and auto-triggers half-clone.

Tip 25: CLAUDE.md vs Skills vs Slash Commands vs Plugins

  • CLAUDE.md: loaded into every conversation. Good for project-level instructions.
  • Skills: structured, loaded on-demand by Claude. More token-efficient.
  • Slash commands: user-invoked. /my-command syntax. Functionally merged with skills in v2.1.3.
  • Plugins: package skills, commands, agents, hooks, and MCP servers together.

Tip 30: Keep CLAUDE.md Simple

Start with nothing. Add only when you find yourself repeating instructions. Review periodically — stale instructions are worse than none.


Git & GitHub

Tip 4: Git & GitHub CLI

Let Claude handle commits, branching, PRs. Pro tip: allow auto-pull but not auto-push. Use gh for draft PRs. Disable Co-Authored-By attribution:

{ "attribution": { "commit": "", "pr": "" } }

Tip 16: Git Worktrees for Parallel Work

Work on multiple branches simultaneously without conflicts:

git worktree add ../project-feature feature-branch

Each worktree is a branch + a separate directory.

Tip 26: Interactive PR Reviews

Go file-by-file at your own pace. Claude Code acts as an interactive reviewer, not a one-shot machine. General review, or deep dive into specific files.


Output & Verification

Tip 6: Getting Output Out

  • /copy — copies last response as markdown
  • pbcopy — send to clipboard
  • Write to file → open in VS Code
  • Open URLs in browser with open
  • GitHub Desktop integration

Tip 9: Write-Test Cycle

Complete the loop: write code → run it → check output → fix. For testing interactive CLIs like Claude Code itself, use tmux: send commands, capture pane, verify output.

Tip 28: Verification Strategies

  • Write tests for generated code
  • Use visual Git client (GitHub Desktop)
  • Create draft PRs for review before merging
  • Let Claude double-check its own work: “Double check every claim and make a table of what you verified”

Tip 34: TDD with Claude Code

  1. Write tests first (they fail)
  2. Commit the tests
  3. Write code to make them pass This creates a clear contract. Verified working on cc-safe.

Tip 40: Simplify Overcomplicated Code

Claude has a bias for writing too much code. Ask “why did you make this change?” or “simplify this.” Applies to prose too — Claude often summarizes previous paragraphs unnecessarily.


Multi-Tasking & Parallelism

Tip 14: Multitasking with Tabs

Run 3-4 Claude instances at a time. “Cascade” method: open new tabs to the right, sweep left-to-right from oldest to newest tasks.

Tip 36: Background Tasks

  • Ctrl+B — move a running command to background
  • Subagents can run in background for long research
  • Customize subagents: how many, background/foreground, which model

Tip 17: Exponential Backoff for Long Jobs

Ask Claude to check long-running jobs (Docker builds, CI) with increasing intervals: 1min, 2min, 4min… More token-efficient than gh run watch which spams output.


Writing & Research

Tip 18: Writing Assistant

Give context → dictate via voice → get draft → iterate line-by-line. Side-by-side: terminal left, editor right.

Tip 19: Markdown is the S**t

Markdown with Claude Code is the most efficient writing format. For pasting into other platforms: paste into Notion first, then copy from there. Or use Cmd+Shift+V for unformatted paste.

Copy from Slack → paste into Notion → copy from Notion → paste as markdown into Claude. Notion converts formatted text to markdown with links intact.

Tip 27: Research Tool

Claude Code as a Google/deep research replacement. Give it access through: gh CLI, containers, MCPs (Slack), browser via Playwright, or Cmd+A content.

Tip 29: DevOps Engineer

Excellent for debugging GitHub Actions CI failures. /gha <url> command investigates failures, checks for flakiness, identifies breaking commits, suggests fixes.


Security & Risk

Tip 21: Containers for Risky Tasks

Use --dangerously-skip-permissions only inside containers. Great for long-running research, system prompt patching, unsupervised work. SafeClaw makes this easy — spin up isolated sessions with web terminal.

Advanced: Worker Claude in Container

Local Claude controls another Claude inside a container via tmux. The inner Claude runs with --dangerously-skip-permissions. Outer Claude uses tmux send-keys to prompt and capture-pane to read output. Fully sandboxed.

Advanced: Multi-Model Orchestration

Run Codex, Gemini CLI in separate containers. Claude Code becomes the central interface that coordinates everything — spinning up models, sending data between containers/host.

Tip 33: Audit Approved Commands

Scan .claude/settings.json for risky patterns (sudo, rm -rf, Bash, chmod 777, etc.):

npm install -g cc-safe
cc-safe ~/projects

Detects dangerous approved commands before they cause damage.


Philosophy & Strategy

Tip 3: Break Down Large Problems

Same as traditional engineering — if Claude can’t one-shot it, break it down further. Keep going until each sub-problem is solvable.

Tip 12: Invest in Your Workflow

Spend time on your CLAUDE.md, learn the tools. It’s an investment in everything you build.

Tip 22: Learn by Using

The billion-token rule: consume a lot of tokens to develop intuition. Opus 4.5 is affordable enough to run multiple sessions without worrying.

Tip 31: Universal Interface

Claude Code is your universal computer interface — video editing (ffmpeg), audio transcription (Whisper), data analysis (Python/JS), storage cleanup, anything. Terminal is the new IDE.

Tip 32: Right Level of Abstraction

Vibe coding is fine for one-off projects. But dig deeper for critical work — check file structure, individual lines, dependencies. It’s a spectrum, not binary.

Tip 35: Be Braver in the Unknown

You can solve problems in unfamiliar domains (React, Rust, whatever) by iterating with Claude Code. Control your pace: fast for exploration, slow for understanding.

Tip 37: Personalized Software Era

Build custom tools for yourself — transcription systems, data viz, slide decks. Whatever you need, Claude Code can build it in an hour or two.

Tip 39: Plan Then Prototype

Make high-level decisions early (tech stack, structure) before letting Claude write code. Use plan mode (Shift+Tab) or just ask for a plan first.

Tip 41: Automation of Automation

Whenever you repeat a task 2-3 times, automate it. Put in CLAUDE.md → create a skill → write a script. That’s the meta-skill.

Tip 42: Share & Contribute

Share knowledge, file issues, contribute. The Claude Code team reacts fast — they use Claude Code to build Claude Code.

Tip 43: Keep Learning

  • Ask Claude Code about itself — it has a specialized subagent
  • /release-notes to see latest features
  • r/ClaudeAI subreddit
  • Follow @adocomplete for daily tips

DX Plugin (Tip 44)

Install with two commands:

claude plugin marketplace add ykdojo/claude-code-tips
claude plugin install dx@ykdojo
CommandDescription
/dx:gha <url>Analyze GitHub Actions failures
/dx:handoffCreate handoff docs for context continuity
/dx:cloneClone conversations to branch off
/dx:half-cloneHalf-clone to reduce context
/dx:reddit-fetchFetch Reddit via Gemini CLI
/dx:review-claudemdReview conversations → improve CLAUDE.md

Quick Setup (Tip 45)

bash <(curl -s https://raw.githubusercontent.com/ykdojo/claude-code-tips/main/scripts/setup.sh)

Configures: DX plugin, cc-safe, status line, auto-updates off, lazy-load MCP, permissions, attribution off, aliases, fork shortcut.