Tips

2026-04-06

git

git worktree: Multiple Branches, One Repository

Stop switching branches constantly. Use git worktree to check out multiple branches simultaneously in separate directories:

# Create linked working trees
git worktree add ../feature-auth feature/authentication
git worktree add ../hotfix-prod hotfix/critical-bug

# Work in parallel
cd ../feature-auth    # Full repo, different branch
cd ../hotfix-prod     # Same .git, different workspace

# List all worktrees
git worktree list

# Remove when done
git worktree remove ../feature-auth

Perfect for comparing implementations, testing different approaches, or handling urgent fixes while keeping feature work intact. Each worktree shares the same .git directory but maintains separate working files and staging areas.

2026-04-05

web-dev

Container Query Debugging in DevTools

Modern devtools provide ways to inspect container queries alongside media queries. For example, Chrome's Elements panel highlights active container query rules dynamically as containers resize. This lets you verify your query conditions are evaluated correctly and that container breakpoints trigger expected style changes. Look for the "Container Queries" section in the Elements panel—it shows which containers are active and their current dimensions, making debugging responsive components much easier.

2026-04-04

tools

jq's Hidden --tab Flag

Use jq --tab instead of the default spaces for indentation. By default, jq pretty-prints JSON output, but --tab makes the output more readable in terminals and consistent with many editors' default indentation. Perfect for when you're piping jq output to files or need to manually inspect large JSON structures.

2026-04-03

tools

ripgrep's --files flag for dry-run exploration

Before searching, see exactly what files ripgrep will examine:

# What would ripgrep search?
rg --files

# Combine with type filters to preview scope
rg --files --type py | wc -l  # Count Python files
rg --files --glob '*.test.*' | head -5  # Preview test files

# Pipe to other tools for analysis
rg --files --type js | xargs wc -l | sort -n  # Size distribution

--files: Just list files ripgrep would search, without searching. (great for dry-runs) Perfect for understanding ripgrep's file discovery before expensive searches.

2026-04-02

vim

Debug Macros by Pasting Them

When a macro misbehaves, paste its contents with "qp (for register q). You'll see the raw keystrokes including ^[ for Escape and ^M for Enter. Edit the text directly, then reload with :let @q = 'fixed-content'. No more re-recording broken macros.

2026-04-01

devops

Use .dockerignore to Accelerate Multi-Stage Builds

Your .dockerignore file is critical for multi-stage build performance. Even though your final stage won't include excluded files, Docker still sends them to the build context, slowing down every COPY . . instruction.

# .dockerignore
node_modules/
*.log
.git/
README.md
Dockerfile*
.dockerignore

A properly configured .dockerignore can reduce build context from hundreds of MB to just a few MB, dramatically speeding up builds—especially in CI/CD pipelines where network latency matters.

2026-03-31

devops

Use Artifacts for API Response Mocking

Generate realistic JSON API responses in Claude Artifacts by describing your data structure. "Create a mock REST API response for user profiles with nested address data" gives you properly formatted JSON with realistic field names and values. Perfect for frontend development before the backend is ready, or for testing edge cases with varied data structures.

2026-03-27

cli

Ctrl+X Ctrl+E Opens Your $EDITOR from Any Command Line

Typing a long command and wish you were in your editor? Press Ctrl+X Ctrl+E in bash (or Ctrl+X e in zsh) and your current command line opens in $EDITOR. Save and quit to execute. Set export EDITOR=vim in your shell profile if you haven't already.

2026-03-26

git

git stash push -m Gives Your Stashes Names

Stop losing track of your stashes. Instead of git stash, use:

git stash push -m "WIP: auth token refresh logic"

Now git stash list shows meaningful labels instead of cryptic auto-generated messages. When you have 5+ stashes, this is the difference between finding your work and guessing.

2026-03-25

vim

Use ci( to Change Inside Parentheses

In Vim, ci( deletes everything inside the nearest parentheses and drops you into insert mode. Works from anywhere inside the parens — your cursor doesn't need to be on the opening paren.

The same pattern works for all paired delimiters: ci[, ci{, ci", ci', ci<, and even ci` for backticks.

Use ca( instead to include the parentheses in the change. The a stands for "around."