tech-guide 5 min read

Claude Code Field Notes

Claude Code Field Notes

It's been all the hype lately. From the people who claimed they were blockchain experts pushing crypto, now vibe coding the future, to the senior-level software architects who've seen it exponentially increase their development workflow. Every damn person on LinkedIn has "agentic" or "vibe code" somewhere in their bio now.

It's an AI agent that works across multiple environments such as IDEs, the browser, and the terminal (CLI) and Claude even has its own proprietary desktop app. This post gives a brief explanation of what Claude Code is and how I leverage it.

What is Claude Code?

It's an opinionated agent built around the agentic loop, a continuous back-and-forth between two components: the harness and the model. I think of them as a frontend and backend.

The loop runs through three stages:

  1. Gather context
  2. Take action (tools called)
  3. Verify result

The loop breaks when the model responds with plain text and no tool call.

The special sauce is the harness. It manages state and assembles every request sent to the model. Let's break that down.

The harness

This is the UI layer. It assembles everything the model needs to get to work like exposing tools, shell commands, and your codebase, then structuring it all into a single API request. When you hit enter, that request fires. Here's what's in it:

  1. System Prompt — Claude Code's core identity, coding conventions, and environment context: current working directory, operating system, shell, git branch, etc.
  2. Tool Schemas — JSON schemas defining available actions: Bash, Edit, Read, Write, WebFetch, and any MCP servers you've configured.
  3. Messages — the full conversation history, your CLAUDE.md preferences, and available skills.
{
  model: "claude-opus-4-7",
  tools: [
    { name: "Bash",      description: "...", input_schema: {...} },
    { name: "Edit",      description: "...", input_schema: {...} },
    { name: "Read",      description: "...", input_schema: {...} },
    { name: "Write",     description: "...", input_schema: {...} },
    { name: "WebFetch",  description: "...", input_schema: {...} },
    // MCP servers
    { name: "Storyblok", description: "...", input_schema: {...} },
  ],
  system: [
    {
      type: "text",
      text: "You are Claude Code, Anthropic's CLI...\n\n..."
    }
  ],
  messages: [
    {
      role: "user",
      content: `<system-reminder>
        # claudeMd Contents of /Users/branden/bbuilds-web-svelte/CLAUDE.md:
          - no em dashes in copy or comments
          - run dev server with: npm run dev
          - build with: npm run build
          - SvelteKit + Storyblok + Cloudflare Pages stack
          - prefer prerendering routes where possible
          - Storyblok API version: published in prod, draft in dev
        </system-reminder>
        <system-reminder>
          Available skills:
            - seo: Inject JSON-LD structured data and meta tags into Storyblok pages
            - deploy: Trigger Cloudflare Pages deploy via webhook
        </system-reminder>
        Add JSON-LD structured data to the services page`
    }
  ]
}

The model(s)

These are stateless and they don't retain anything between requests. Every prompt starts fresh, which is why the harness has to assemble all that context every single time.

  1. Opus ($$$) — Reasoning and planning. When the answer is more than just code. I reach for this when:
  2. Sonnet ($$) — Everyday engineering. When code is the priority. I use this for:
  3. Haiku ($) — No decision-making needed, just execution. Pure mechanical work:

Behind the harness and context assembly

Lets go over the different ways Claude Code assembles the context. You can inspect your full context at any time by running /context

Claude.md

Think of this as the "global" context the onboarding doc for your codebase. It gets loaded into every request, so keep it short. Only put things Claude couldn't figure out on its own. Think of it less like documentation and more like policies. If you find yourself repeating the same instruction across different tasks, it probably belongs in CLAUDE.md.

Useful things to include:

  • tech stack used
  • useful commands
  • code style choices
  • file system / project architecture
  • systems design / data flow

Skills

Think of these as context loaded on demand. Each skill is a markdown file with structured instructions for something you want the agent to do more cleverly and consistently. Skills are triggered by relevance, which makes the description critical. Anthropic has a plugin called Skill Creator that makes building them easy. After installing, you can just run /skill-creator and follow the prompts.

Note

Need some skill ideas? Run /insights to generate a report based on your coding habits. It surfaces patterns you might not notice yourself and suggests skills worth adding. There's a ton of useful signals in there. I recommend running it after every sprint or large feature.

Some examples of useful skills:

  • Generating a PR based off a PR template.
  • Writing components in a certain way
  • Structuring tests

Hooks

A hook runs specific commands with hard programmatic determinism in the lifecycle. Often compared to Git hooks in that if something must always happen, it belongs in a hook. Configured in settings.json or via the /hooks command. You pick a lifecycle event, optionally scope it to specific tools, and provide a command to run. You can view the whole lifecycle and events but the two I reach for most are PreToolUse and PostToolUse.

  • PreToolUse — before any tool fires. Block dangerous commands, enforce certain CLI commands.
  • PostToolUse / PostToolUseFailure — after a tool runs or fails. Good for lint, formatting, logging.

Model Context Protocol (MCP)

A newer but open source and standardized protocol that connects AI applications to third-party systems. There are several SDKs that can be leveraged when building your own.

Heads up

MCP vs. CLI

In my research diving into agentic coding, I've seen a lot of pushback on MCPs. They can burn the context window fast. CircleCI has a great article on this debate.

Next post I will dive more into the process and how I use the tools in a project.

// 06.contact

Bring your vision into focus.

From initial market strategy to deep code implementation, together we design and build full-lifecycle digital ecosystems. Drop a brief, a deck, or an open problem, and let Branden Builds do his thing.

Start a project

Let's get to work.