Claude Code: Tips
Claude Code tips.
General tips
Shift + Tabto cycle through normal, plan, and accept-edits mode.- Use
@to mention specific files.
Permission modes
Shift+Tab cycles through three modes: default, auto-accept edits, and plan. bypassPermissions is intentionally excluded from this 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:
- “Never use rm to delete files. Always use trash instead.”
- “When using mv, always use -n flag to prevent silently overwriting existing files.”
mv without -n is also dangerous — Claude can rename multiple files to the same name, silently overwriting with no recovery.
(via @devdesign.kr)
tmux + Neovim Setup
If you prefer terminal-based light-weight setup over IDEs like cursor, a nice way is to have a tmux session per project with Claude Code and an editor (e.g., Neovim) open side by side. You read, check, and edit with Neovim while asking things to Claude Code. When doing this, it is critical for Neovim to auto-reload files when Claude Code edits them externally. Without this setup, you’ll be viewing stale files unless you force-reload with :e!, which creates an annoying situation with unsaved edits in the current buffer that diverged from the file content.
To do so, you have to configure tmux correctly in addition to Neovim.
Neovim configuration
Add to your Neovim config (e.g., lua/user/options.lua):
-- Auto-reload files when changed externally
vim.o.autoread = true
vim.api.nvim_create_autocmd({ 'FocusGained', 'BufEnter' }, {
command = 'checktime',
})
tmux configuration
Add to your tmux.conf:
set -g focus-events on
This tells tmux to forward focus events to Neovim. Without it, Neovim won’t know when you switch back to it and won’t trigger the FocusGained autocmd.
Applying changes
For Neovim, restart or source your config. For tmux, either restart tmux, or run tmux set -g focus-events on in the terminal, or run Ctrl+a (or your prefix) then : and type set -g focus-events on inside tmux.
Tools
- RTK — CLI proxy that reduces LLM token consumption by 60–90% by filtering and compressing command outputs
- frontend-slides — create web-based slides using Claude’s frontend skills