Getting Better at
Coding Agents

Practical tips & mental models

Based on Sankalp's guide to Claude Code 2.0

The Self-Augmentation Framework

Don't just "keep up" with AI releases. Build a system for getting better.

Stay Updated

Know what tools exist. Try new features when they ship. The landscape moves weekly.

Deepen Domain Expertise

The better you understand your problem, the better you can prompt. Domain knowledge is the multiplier.

Experiment Regularly

Try throw-away first drafts. Learn the model's biases. Build taste through iteration.

These three compound. Tools without domain expertise = slop. Domain expertise without tools = slow. Both without experimentation = stagnant.

"Context engineering is
the #1 skill."

How Context Actually Works

Everything accumulates in one big messages array

// What the model sees every API call:
{
  "system": "You are a coding agent...",        // ~500 tokens
  "tools": [bash, read, write, edit, ...],    // ~2,000 tokens
  "messages": [
    {"user": "Fix the auth bug"},              // ~10 tokens
    {"assistant": tool_use(read_file)},         // ~50 tokens
    {"user": tool_result("...500 lines...")},  // ~2,000 tokens
    {"assistant": tool_use(read_file)},         // ~50 tokens
    {"user": tool_result("...300 lines...")},  // ~1,200 tokens
    // ... 15 more tool calls ...
    // Context is now 80% full of file contents
  ]
}

Every file you read, every command you run — it all stays in the window. This is why agents "forget" things on long tasks. The useful information gets drowned out.

Context Rot

The effective window is ~50-60% of the stated capacity

Opus 4.5 — 200K token window
effective degraded lost
0K100K200K

Fighting Context Rot

Four strategies to keep context clean

1. System Reminders

Tags injected at runtime that keep objectives top-of-mind. The model re-reads these every turn.

2. Todo Lists

Not just for tracking — they're attention manipulation. The model sees the plan every turn and stays on track.

3. Compaction

Claude Code can compress old context into summaries. Trades detail for headroom. Use /compact.

4. Fresh Sessions

Sometimes the best move is to start over. Use /handoff to summarize before you go.

The best agent users are context hygienists.

Sub-Agents

Specialized Claude instances for focused work

AgentAccessUse When
Explore Read-only, fresh context Searching the codebase, finding files, understanding structure
Plan Read-only, inherits context Designing implementation strategy before coding
General-purpose Full tools, inherits context Complex research, multi-step exploration
claude-code-guide Docs only Looking up Claude Code features and settings

Key insight: Explore starts with a fresh context — it doesn't see your conversation history. This is a feature, not a bug. It forces focused work and returns only a clean summary to your main session.

Skills & Hooks

Skills = On-Demand Knowledge

  • Domain-specific knowledge loaded when needed
  • Not baked into the system prompt (saves tokens)
  • Examples: /commit, /review-pr, frontend-design
  • You can write your own as SKILL.md files
# skills/my-skill/SKILL.md
---
name: my-skill
description: When to trigger this
---

# Instructions for the model
Step 1: ...
Step 2: ...

Hooks = Lifecycle Automation

  • Scripts that run at agent lifecycle stages
  • Stop — runs after Claude finishes (e.g. notification sound)
  • UserPromptSubmit — runs before processing (e.g. inject context)
  • Enable workflows like "auto-continue" or "always lint after edit"
// .claude/settings.json
{
  "hooks": {
    "Stop": [{
      "command": "afplay /System/Library/
        Sounds/Glass.aiff"
    }]
  }
}

MCP & Custom Commands

MCP Servers

  • External tool integrations (databases, APIs, browsers)
  • Caveat: tool definitions bloat context
  • Pattern: expose fewer, more powerful tools
  • Code-execution-via-MCP: wrap APIs instead of individual endpoints

Custom Commands

  • Saved prompts in .claude/commands/
  • For repetitive workflows you run often
  • Invoked via /command-name
# .claude/commands/handoff.md

Summarize this session:
- What was accomplished
- What's left to do
- Key decisions made
- Files changed

Format as a handoff note for
a fresh session to continue.

Pro tip: Use /handoff before starting a fresh session. Preserves knowledge, resets context.

The Practical Workflow

Explore
→
Execute
→
Iterate
→
Review

1. Explore

Ask clarifying questions. Use Explore sub-agent for codebase search. Understand before you act.

2. Execute

Use /ultrathink for complex tasks. Review changes carefully. Micro-manage at first — trust builds over time.

3. Iterate

Throw-away first drafts are your friend. The first attempt teaches you the model's biases. The second attempt is informed.

4. Review

Always review generated code. Use a different model for review if possible — fresh eyes catch different bugs.

Tips That Actually Matter

Ultrathink

Use /ultrathink for anything non-trivial. Lets the model reason more deeply before acting. Worth the extra tokens.

Checkpointing

Esc+Esc or /rewind to roll back. Git-like safety net. Use it before risky operations.

Monitor Context

/context shows token usage. When you're past 50%, consider compacting or starting fresh.

Throw-Away First Drafts

Don't commit to the first output. Use it to learn the model's approach, then guide the second attempt with that knowledge.

CLAUDE.md + Scratchpad

Maintain a CLAUDE.md in your repo with project context. Use a scratchpad file for the model to think in.

Prompt History

Ctrl+R to search previous prompts. Stop retyping the same instructions.

Choosing the Right Model

Different models for different jobs

ModelStrengthWeaknessBest For
Opus 4.5 Speed, communication, collaboration 200K context limit Primary driver, pair programming
Sonnet 4.5 Fast, cheap Prone to "slop" — haphazard changes Simple tasks, quick edits
GPT-5.x Codex Raw code generation, 400K context Slower, less conversational Code review, second opinion
Open source Free, private, customizable Lower capability ceiling Low-medium complexity, offline

Pro tip: Use one model to write and a different model to review. Fresh perspective catches bugs the author misses.

Key Takeaways

"It's a little spirit/ghost that lives on your computer" — Karpathy, on AI agents

Try one new thing
from this talk today.

Happy building.

agent37.club