Skip to content

Instantly share code, notes, and snippets.

@gregsantos
Created June 6, 2025 17:30
Show Gist options
  • Save gregsantos/2a6874aba43a4e2eb26b6408aebdd515 to your computer and use it in GitHub Desktop.
Save gregsantos/2a6874aba43a4e2eb26b6408aebdd515 to your computer and use it in GitHub Desktop.
Claude Code Guide for Agentic Terminal Development

🧠 Claude Code Guide for Agentic Terminal Development

1. 🔧 Initial Project Setup

  • Run /init on project start

Creates a Claude.md containing:

  • Project summary
  • Component descriptions
  • Dev environment setup
  • Code style guide
  • Tooling notes
  • Commit Claude.md to repo

Ask Claude to write and commit this file. Use write to file + commit flows rather than inline pasting.

  • Enable file-based workflows
  • Press Tab: auto-completes filenames
  • Press Shift + Tab: toggles auto-accept for file changes

2. 🧭 Workflow Planning & Execution

  • Step-by-step Planning Approach
  1. Use o1-pro / o3-mini-high or Grok for "pre-plan" brainstorming
  2. Launch Claude Code in repo
  3. Explain high-level plan with milestones
  4. Ask Claude to break the plan into diffs
  5. Guide Claude one diff at a time, reorienting when needed
  • Prompt Claude to Think

Use explicit thinking modes to encourage depth:

  • think
  • think hard
  • think deeper
  • ultrathink
  • Use Plan-Implement-Review Cycle

For large changes:

  • Ask for a detailed plan before code changes
  • Review and approve/refine
  • Execute changes and tests
  • Commit with contextual messages

3. ⚙️ Commands & Customizations

  • Use /compact regularly

Compresses state for long sessions; improves response performance

  • Define custom slash commands

Add .md files to:

  • ~/.claude/commands/ (global)
  • .claude/commands/ (project)
  • Use /permissions to manage trusted tools

Avoid permission fatigue by explicitly allowlisting safe operations

4. 🧩 File Editing Best Practices

  • Always specify the file explicitly, e.g.:
  Claude, can you increase the input size in `user/page.tsx`?
  Claude, add error handling to `data_processing.py`.
  Claude, refactor the `calculate_totals` function in `invoice.py`.
  
  • Be explicit about file relationships
  • Write output to files for Claude to re-ingest

5. 🧠 Prompting & Reasoning Techniques

  • Few-shot prompting

Add 2–5 curated examples to Claude for higher output fidelity

  • Role definition

e.g., “You are a senior Rust compiler engineer” to shape tone & accuracy

  • XML tag prompting

Structure prompts as:

  <instructions>Write a data pipeline</instructions>
  <context>We use Dagster + S3</context>
  

6. 🧪 Testing & Quality Assurance

  • Test-Driven Development

Ask Claude to write tests before implementing features

  • Automated test running

Use Claude to repeatedly validate logic with local test runners

  • Review entire codebase

Periodically ask Claude to:

  • Audit for redundant code
  • Assess architectural consistency
  • Suggest cleanup/refactors

7. 🤖 Tool Integration via MCP

  • MCP Tools + Rules Strategy
  1. Identify key workflows in your dev environment
  2. Map available MCP tools (e.g., Puppeteer, Postgres, GitHub API)
  3. Define routing rules for agent-tool coordination
  • MCP Headless Mode

Integrate Claude into CI/CD or scripts with non-interactive inputs

  • Multi-agent collaboration

Delegate tasks across Claude + other AIs in parallel

8. 🖼️ Visual/UX Workflows

  • Use:
  • Screenshots as visual guides
  • Claude for Figma-to-code translation
  • Feedback cycles comparing output to design

9. 📚 Ongoing Improvement Tips

  • Rotate LLMs (e.g., Grok, GPT-4o, Claude 3.5 Sonnet) for planning then hand off to Claude Code
  • Use a Markdown journal to document Claude’s performance patterns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment