Claude Code: Tips

2026-02-22 → 2026-08-09

Claude Code tips.

Principles#

Structure CLAUDE.md files with Progressive disclosure: keep the global file a set of thin pointers to per-repo CLAUDE.mds, so detail is read on demand instead of loaded every session. See Context engineering.

General tips#

Settings#

Permission modes#

bypassPermissions is intentionally excluded from the Shift+Tab mode cycle by default. If you’re comfortable using bypass permissions mode regularly, set it as your default in ~/.claude/settings.json:

{
  "permissions": {
    "defaultMode": "bypassPermissions"
  }
}

With this config, Claude Code starts in bypass permissions mode, and Shift+Tab will include it in the cycle so you can freely switch between modes.

Preventing accidental file deletion#

Claude Code uses rm for file deletion, which is permanent. Combined with bypassPermissions, this can be dangerous. The fix: deny rm/rmdir in settings while keeping bypass mode, and use trash (macOS built-in) as the alternative.

In ~/.claude/settings.json:

{
  "permissions": {
    "deny": ["Bash(rm:*)", "Bash(rmdir:*)"],
    "defaultMode": "bypassPermissions"
  }
}

deny takes priority over bypass mode, so everything is auto-approved except destructive deletions.

In ~/.claude/CLAUDE.md, add:

mv without -n is also dangerous—Claude can rename multiple files to the same name, silently overwriting with no recovery.

(via @devdesign.kr)

Background jobs (Agent view): turn off worktree isolation when it’s overkill#

By default, Claude Code’s background-jobs / Agent view spawns each bg agent in its own git worktree. In small repos, non-git directories, or quick prototypes, that’s more friction than it’s worth—you end up fighting the harness every time you launch a bg agent.

In ~/.claude/settings.json:

{
  "bgIsolation": "none"
}

This disables the forced worktree per background job, so agents run in place.

Running multiple sessions#

I used to run a tmux + Neovim pane per project, but dedicated agent multiplexers have made that setup obsolete: Herdr, Orca, cmux, the Codex app, and others manage many agent sessions with persistent state. (If you do pair tmux with Neovim, the one critical bit is auto-reloading externally edited files: vim.o.autoread + a checktime autocmd, and set -g focus-events on in tmux.conf.)

Reducing token usage#

MCP can use a lot of tokens. Turn on only when it’s needed.

RTK—CLI proxy that reduces LLM token consumption by 60–90% by filtering and compressing command outputs.

@atelic.io on Threads (Korean)—tips on reducing auto-inserted token traffic and capping tool output.

Tools#

Collections#

Receive my updates

YY's Random Walks — Science, academia, and occasional rabbit holes.

YY's Bike Shed — Sustainable mobility, urbanism, and the details that matter.

×