Mastering Claude Code: Core Settings and Process for Developers

technology ai-ide claude-code developer-tools

From: https://blog.sshh.io/p/how-i-use-every-claude-code-feature

Shrivu Shankar’s guide highlights key strategies for optimising Claude Code, focusing on practical application for both personal and enterprise development. This summary distils the core settings and processes essential for effective AI integration into coding workflows.

“The single most important file in your codebase for using Claude Code effectively is the root CLAUDE.md. This file is the agent’s “constitution,” its primary source of truth for how your specific repository works.”

CLAUDE.md: The Agent’s Constitution

The CLAUDE.md file is fundamental, acting as the primary source of truth for how Claude Code interacts with your repository.

Core Principles:

  • Targeted Guardrails: Document common agent errors or specific project constraints rather than creating a comprehensive manual.
  • Context Efficiency: Avoid embedding large external documents; instead, provide clear references and conditions for their use.
  • Actionable Guidance: Always provide alternative actions when imposing limitations, preventing the agent from getting stuck.
  • Simplify Tooling: Use CLAUDE.md to drive the simplification of complex CLI commands into more intuitive wrappers.

Context Management & Session Control

Efficiently managing Claude’s context window is vital for performance and cost.

  • Monitor Context: Regularly use /context to track token usage.
  • Avoid /compact: This automatic compaction is often unreliable.
  • Strategic Resets:
    • Simple Reboot: /clear followed by a custom /catchup command (to re-read changed files) is the preferred method.
    • Complex Tasks: For larger efforts, “Document & Clear” involves saving progress to a .md file, clearing the session, and then instructing Claude to resume from the saved document.

Slash Commands: Personal Shortcuts

Slash commands should be simple, personal shortcuts for frequent actions.

  • Purpose: Streamline common tasks (e.g., /catchup for reading changes, /pr for pull request preparation).
  • Avoid Complexity: Do not create a complex, mandatory set of commands that requires separate documentation.

Agent Orchestration: Master-Clone Approach

For complex tasks, the “Master-Clone” architecture offers a flexible alternative to rigid subagents.

  • Subagent Drawbacks: Subagents can hide context and force predefined workflows, limiting the agent’s holistic reasoning.
  • Master-Clone: Centralise core context in CLAUDE.md and allow the main agent to dynamically delegate work to copies of itself using Task(...). This preserves full context while distributing effort.

Hooks & Session History

Leveraging hooks and historical data enhances control, validation, and continuous improvement.

  • Session History: Use claude --resume to restart sessions and extract insights from past interactions, informing CLAUDE.md improvements.
  • Validation Hooks:
    • Block-at-Submit: Implement hooks (e.g., PreToolUse) to validate results at the commit stage, forcing the agent to fix issues before committing.
    • Avoid Mid-Process Blocking: Allow the agent to complete its task before validating the final outcome, preventing confusion.

Planning & Skills

Evolving agent autonomy through structured planning and “Skills” is key to robust interaction.

  • Structured Planning: Use Claude’s built-in planning mode for complex changes to align on strategy and define inspection checkpoints.
  • Skills (Scripting Model): Formalise the agent’s ability to directly access the environment (binaries, scripts) and generate code on the fly via SKILL.md. This is more robust than traditional tool-calling.
  • MCP’s Evolved Role: MCPs should act as secure data gateways, providing high-level tools for authentication and security, rather than mirroring entire APIs.

Claude Code SDK & GitHub Actions

The Claude Code SDK and GitHub Actions (GHA) enable powerful automation and integration.

  • SDK Use Cases: Parallel scripting for refactors, building internal chat tools, and rapid agent prototyping.
  • GitHub Action: Operationalise Claude Code within GHAs for automated workflows (e.g., “PR-from-anywhere”) and auditable processes, driving continuous improvement.

Advanced Customisation (settings.json)

The settings.json file provides crucial customisation for advanced users.

  • Debugging: Use HTTPS_PROXY/HTTP_PROXY for traffic inspection.
  • Timeouts: Adjust MCP_TOOL_TIMEOUT/BASH_MAX_TIMEOUT_MS for long-running commands.
  • API Keys: Utilise enterprise API keys for usage-based pricing.
  • Security: Regularly review permissions for auto-run commands.

By focusing on these core settings and processes, developers can effectively harness Claude Code to enhance productivity and maintain code quality.


View this page on GitHub.