How I use Claude Code | Christian B. B. Houmann
Key Points
- 1This paper details a user's highly productive and cost-effective workflow with Claude Code, leveraging a subscription to tackle diverse coding projects from personal explorations to serious development.
- 2It outlines essential strategies for effective AI-assisted coding, emphasizing diligent context curation with CLAUDE.md files, utilizing specific commands, running parallel instances, and thorough documentation.
- 3Further advice includes advanced techniques like integrating other AI models (e.g., o3-pro), using log files for debugging, and optimizing workflows, while also highlighting crucial considerations such as security (prompt injection) and model variability.
The paper details a user's extensive experience and methodology for leveraging "Claude Code," an AI-powered coding assistant, particularly after Anthropic enabled subscription-based usage. The author posits that this shift transformed Claude Code from an prohibitively expensive tool to an indispensable asset for significantly boosting productivity across diverse projects, from personal "throwaway" explorations to complex, serious development.
The core methodology revolves around a set of refined interaction patterns and environmental configurations, emphasizing strategic human-AI collaboration rather than full automation. Key distinctions for agentic coding in serious development include:
- Context Curation: The necessity for the user to explicitly provide and maintain rich contextual information beyond mere task specifications.
- Architectural Guidance: The user's responsibility to guide the AI in generating designs that align with existing system architecture.
- Partnership Model: Viewing the AI as an "intellectual sparring partner" capable of handling trivial tasks and complex information assimilation (e.g., reading hundreds of documentation pages) but requiring explicit guidance on project specifics.
The paper outlines eighteen specific patterns and tips, which collectively form the operational methodology:
- CLAUDE.md for Persistent Context: Establish and maintain a
CLAUDE.mdfile (using#prefix in prompts) to store ongoing instructions and project context. This file can be localized to subdirectories for specific components (e.g., frontend, backend, tests), acting as a curated knowledge base akin to developer tooling like linters or type checkers. - Leveraging Claude Code Commands: Utilize built-in commands:
Plan mode(Shift+Tab) for improved task completion reliability;Verbose mode(CTRL+R) to inspect Claude's full context;Bash mode(!prefix) to execute commands and feed output back as context; andEscape(single for interrupt, double for conversation history jump). - Parallel Instance Execution: Run multiple Claude Code instances concurrently (e.g., one for frontend, one for backend), often utilizing Git worktrees for shared codebase interaction. A caveat is noted regarding the complexity of managing multiple Docker Compose environments.
- Subagent Utilization: Instruct Claude Code to spawn subagents to approach problems from multiple perspectives, with the main agent synthesizing findings for optimal solutions.
- Visual Input Integration: Drag and drop screenshots to provide visual context, especially useful for UI debugging or replicating designs due to Claude Code's proficiency in visual information understanding.
- Optimal Model Selection: Prioritize
Claude 4 Opusfor superior performance, particularly within higher subscription tiers, noting its significant improvement overClaude 4 Sonnet. - Project-Specific Slash Commands: Define custom commands within
.claude/commandsfor recurring tasks (e.g., migrations, setup, context loading), reducing repetitive manual input. - Extended Thinking Modes: Employ
think,think harder, orultrathinkto allocate increased "thinking budget" (e.g.,ultrathinkallocates 31,999 tokens) for complex tasks like debugging, planning, or design, yielding better but longer results. - Proactive Documentation: Have Claude Code document its thoughts, task specifications, designs, and requirements into intermediate Markdown files. These serve as scratchpads and crucial context for future sessions, mitigating context loss over time.
- Rigorous Git Version Control: Emphasize frequent Git commits, using Claude to generate commit messages, as AI-assisted rapid changes necessitate robust version control for checkpointing and recovery, given the lack of a built-in checkpoint system.
- Workflow Streamlining:
- Continue previous sessions using
--resumeor--continueflags to preserve context. - Utilize
MCP servers(e.g.,context7,deepwiki,puppeteer) or custom-built tools for advanced context management. - Script common deterministic tasks and have Claude maintain them.
- Prefer
GitHub CLIover fetch tools for retrieving GitHub context due to its superior integration and reliability. - Monitor usage with
ccusage, particularly the live dashboard (bunx ccusage blocks --live), to track rate limits and "could-have-spent" costs.
- Continue previous sessions using
- Fast Feedback Loops: Implement mechanisms for immediate verification of the AI's output, preventing "reward hacking" (AI taking shortcuts to appear successful without truly solving the problem). This is often achieved through specific instructions and constraints combined with rapid validation.
- IDE Integration: Utilize Claude Code within an IDE for a pair-programming-like experience, granting the AI access to IDE tools (e.g., lint errors, active file content) for richer interaction.
- Message Queueing: Send messages while Claude Code is processing, queueing them for the next turn, though a minor bug affecting consistency is noted.
- Mindful Compacting and Session Length: Exercise caution with conversation compacting, performing it preemptively at natural stopping points to reduce noise while minimizing important context loss. Ideally, tasks should be broken into manageable single sessions, preferring new sessions over
/clear. - Custom PR Templates: Advise against the default pull request template for Claude Code, suggesting a customized template tailored to specific project needs to improve PR quality and clarity.
- Log File Debugging: A powerful debugging pattern involves redirecting development server output to log files (e.g., bun run dev > dev.log 2>&1) which Claude Code can read. This allows the AI to analyze patterns, suggest logging additions, and iteratively diagnose issues without constant user input. It supports unified logs from multiple sources (frontend, backend).
- Multi-Model Collaboration: Integrate other powerful models, specifically
o3-pro(from Cursor), for planning and design. The workflow involves usingo3-profor "hard thinking" (identifying precise code changes) and then having Claude Code implement those changes. While expensive, this combination is deemed effective for complex tasks, refactors, and challenging debugging.
The paper also highlights applications beyond coding (research, documentation, refactoring, code exploration) and crucial considerations:
- Security: Emphasizing extreme caution with external context injection (e.g., via MCPs) due to prompt injection risks, which could lead to information leaks or unauthorized actions.
- "Vibe-Coding": Warning against fully automated, hours-long "vibe-coding" in production systems, stressing the need for human review.
- Model Variability: Noting anecdotal user experiences of fluctuating model quality, potentially due to quantized models or demand-based adjustments.
Finally, the author provides an optimized bash function ccv for launching Claude Code with specific environment variables for enhanced control:
- : Activates background task functionality for long-running processes.
- : Automatically dispatches long tasks to the background without confirmation.
- : Disables telemetry, error reporting, and auto-updates for privacy and efficiency.
- : Unifies file reading capabilities, including Jupyter notebooks.
These configurations aim to provide automatic background handling, reduce network traffic, unify file access, and enable easy switches for common scenarios (-y for auto-approve, -r for resume). A known limitation is that Claude Code currently struggles to retrieve logs from forced background jobs.