8 Advanced Claude Code Tips: Cost Saving, Context Management, Custom Commands

After heavy daily use of Claude Code, a Reddit user shared 8 advanced tips for developers. Here's the technical breakdown—no fluff, just the specific commands and workflows.
1. Automate Git Workflow
Use natural language in Claude Code to handle git chores without breaking focus:
Summarize the changes I've made so far and create a PR– auto-summarize & PR creation.Generate JSDocs for undocumented functions in this PR– docs before commit.Generate new tests for this feature and include in the PR– auto test generation.
2. Multimodal Image Input in CLI
Claude Code fully supports vision. Three ways to add images:
- Drag & Drop: Drag the image file into the terminal. (Doesn't work in Cursor's integrated terminal.)
- Clipboard: Copy the image from file explorer, then press
Ctrl+Vin the CLI (macOS also uses Ctrl+V here). - Absolute Path: Prompt:
Analyze this image: /absolute/path/to/your/image.png
3. Track API Usage
Pro tip: Use the open-source package ccusage for a detailed breakdown of tokens and costs.
npm install -g ccusage
ccusage dailyThe native /cost command is also available.
4. Save API Credits with /compact
By default, Claude Code auto-compacts only at 95% context limit. Manually run /compact when around 40-50% full to summarize the conversation and start fresh, reducing exponential context growth. Or use /clear to wipe context entirely.
5. Resume Interrupted Sessions
claude --continuepicks up where you left off.claude --resumeopens an interactive menu to select past sessions by start time, summary, or initial prompt.
6. Rule Management
Define persistent rules to avoid repeating instructions. Manage them visually with /memory.
- Project-specific:
./CLAUDE.md– Claude reads recursively upwards, can be in any subdirectory. - Global/personal:
~/.claude/CLAUDE.md - Quick rule trick: Start prompt with
#to instantly append a rule to local CLAUDE.md. Example:# Use arrow functions when possible - Reference other docs:
# Use my git workflows listed in u/docs/git-instructions .md
7. Trigger Thinking Levels
Trigger different compute allocations via natural language in prompts:
- Light:
think about ways to refactor - Medium:
think hard for security issues - Heavy:
think harder about edge cases - Maximum:
ultrathink why I wrote this s**t
8. Custom Commands
AI-powered aliases. Create ./.claude/commands/optimize.md with content:
Analyze the performance of this code and suggest $ARGUMENTS optimizationsThen run /project:optimize 3 to get 3 suggestions. Custom commands support different scopes.
📖 Read the full source: r/ClaudeAI
👀 See Also

Developer tracks frustration with 'F-Bombs Per Thousand Prompts' metric across 44,212 Claude Code logs
A developer tracked 'fpk' (f-bombs per thousand prompts) across 44,212 Claude Code prompts over 5 months, finding frustration dropped 3.4× from Claude Opus 4-5 to 4-7, and most cursing targeted environmental tooling, not the model.

SkyClaw Adds Encrypted Chat-Based API Key Setup for AI Agents
SkyClaw implements AES-256-GCM encrypted key ingestion through chat, intercepting key commands at the system layer so the LLM never sees API keys and using one-time key encryption so messaging platforms only see ciphertext.

Claude Code v2.1.144: Background Sessions, /model Scoping, and 15s Startup Timeout
Claude Code v2.1.144 adds /resume for background sessions, scopes /model to current session only, and fixes a 75s startup hang when api.anthropic.com is unreachable with a 15s timeout.

Forge: Turn a Mac or Linux Machine into an Always-On Dev Host for AI Coding Agents
Forge is an open-source tool that installs a daemon to turn any Mac or Linux machine into a permanent, always-on development host. It keeps AI coding agents running when you walk away, provides a web dashboard for monitoring, and uses Tailscale for secure remote access via SSH.