<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ claude-code - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ claude-code - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Fri, 08 May 2026 22:31:59 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/claude-code/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Keep Human Experts Visible in Your AI-Assisted Codebase ]]>
                </title>
                <description>
                    <![CDATA[ Six months ago, Stack Overflow processed 108,563 questions in a single month. By December 2025, that number had fallen to 3,862. A 78% collapse in two years. The explanation everyone reaches for is th ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-keep-human-experts-visible-in-your-ai-assisted-codebase/</link>
                <guid isPermaLink="false">69dd18d4217f5dfcbd13e964</guid>
                
                    <category>
                        <![CDATA[ claude.ai ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Productivity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ claude ]]>
                    </category>
                
                    <category>
                        <![CDATA[ claude-code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Daniel Nwaneri ]]>
                </dc:creator>
                <pubDate>Mon, 13 Apr 2026 16:24:52 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/21d160a8-af66-4048-9fda-1d83b2e26148.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Six months ago, Stack Overflow processed 108,563 questions in a single month. By December 2025, that number had fallen to 3,862. A 78% collapse in two years.</p>
<p>The explanation everyone reaches for is that AI replaced it. That's partly true. But it misses the structural problem underneath: every time a developer asks Claude or ChatGPT to write code, the knowledge that shaped the answer disappears.</p>
<p>The GitHub discussion where someone spent two hours documenting why cursor-based pagination beats offset for live-updating datasets. The Stack Overflow answer from 2019 where one engineer, after a week of debugging, documented exactly why that approach fails under concurrent writes.</p>
<p>The AI consumed all of it. The humans who produced it got nothing — no citation in the codebase, no signal that their work mattered.</p>
<p>Over time, those people stopped contributing. Stack Overflow isn't dying because it's bad. It's dying because AI extracted its value and the feedback loop that kept humans contributing broke down.</p>
<p>This tutorial builds a tool that puts that loop back together. <strong>proof-of-contribution</strong> is a Claude Code skill that links every AI-generated artifact back to the human knowledge that inspired it — and surfaces exactly where the AI made choices with no human source at all.</p>
<p>I'll show you how to install proof-of-contribution, how to record your first provenance entry, how to use the spec-writer integration that makes Knowledge Gaps deterministic, and how to run <code>poc.py verify</code> — a static analyser that detects gaps without a single API call.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ol>
<li><p><a href="#heading-what-you-will-build">What You Will Build</a></p>
</li>
<li><p><a href="#heading-prerequisites">Prerequisites</a></p>
</li>
<li><p><a href="#heading-quickstart-in-5-minutes">Quickstart in 5 Minutes</a></p>
</li>
<li><p><a href="#heading-how-the-tool-works">How the Tool Works</a></p>
</li>
<li><p><a href="#heading-how-to-install-proof-of-contribution">How to Install proof-of-contribution</a></p>
</li>
<li><p><a href="#heading-how-to-scaffold-your-project">How to Scaffold Your Project</a></p>
</li>
<li><p><a href="#heading-how-to-record-your-first-provenance-entry">How to Record Your First Provenance Entry</a></p>
</li>
<li><p><a href="#heading-how-to-use-import-spec-to-seed-knowledge-gaps">How to Use import-spec to Seed Knowledge Gaps</a></p>
</li>
<li><p><a href="#heading-how-to-trace-human-attribution">How to Trace Human Attribution</a></p>
</li>
<li><p><a href="#heading-how-to-verify-with-static-analysis">How to Verify with Static Analysis</a></p>
</li>
<li><p><a href="#heading-how-to-enable-pr-enforcement">How to Enable PR Enforcement</a></p>
</li>
<li><p><a href="#heading-where-to-go-next">Where to Go Next</a></p>
</li>
</ol>
<h2 id="heading-what-you-will-build">What You Will Build</h2>
<p>proof-of-contribution is a Claude Code skill with a local CLI. Together they give you:</p>
<ul>
<li><p><strong>Provenance Blocks</strong>: Claude appends a structured attribution block to every generated artifact, listing the human sources that inspired it and flagging what it synthesized without any traceable source.</p>
</li>
<li><p><strong>Knowledge Gaps</strong>: the parts of AI-generated code that have no human citation, surfaced before they become production incidents</p>
</li>
<li><p><code>poc.py trace</code>: a CLI command that shows the full human attribution chain for any file in thirty seconds</p>
</li>
<li><p><code>poc.py import-spec</code>: bridges proof-of-contribution with spec-writer, seeding knowledge gaps from your spec's assumptions list before the agent builds anything</p>
</li>
<li><p><code>poc.py verify</code>: a static analyser that cross-checks your file's structure against seeded claims using Python's AST. Zero API calls. Exit code 0 means clean, exit code 1 means gaps found — wires directly into CI</p>
</li>
<li><p><strong>A GitHub Action</strong>: optional PR enforcement that fails PRs missing attribution, for teams that want a standard</p>
</li>
</ul>
<p>The complete source is at <a href="https://github.com/dannwaneri/proof-of-contribution">github.com/dannwaneri/proof-of-contribution</a>.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<p>This is a beginner-to-intermediate tutorial. You should be comfortable with:</p>
<ul>
<li><p><strong>Command line basics</strong>: navigating directories, running scripts</p>
</li>
<li><p><strong>Git</strong>: basic commits and PRs</p>
</li>
<li><p><strong>Python 3.8 or higher</strong>: the CLI is pure Python with no dependencies</p>
</li>
</ul>
<p>You will need:</p>
<ul>
<li><p><strong>Python installed</strong>: check with <code>python --version</code> or <code>python3 --version</code></p>
</li>
<li><p><strong>Git installed</strong>: check with <code>git --version</code></p>
</li>
<li><p><strong>Claude Code</strong> (or any agent that supports the Agent Skills standard — Cursor and Gemini CLI also work)</p>
</li>
</ul>
<p>There's no database to install. No API keys. No paid services. The default storage is SQLite, which Python includes out of the box.</p>
<h2 id="heading-quickstart-in-5-minutes">Quickstart in 5 Minutes</h2>
<p>If you want to try the tool before reading the full tutorial, here are the five commands that take you from zero to your first gap detection:</p>
<p><strong>Mac and Linux:</strong></p>
<pre><code class="language-bash"># 1. Install
mkdir -p ~/.claude/skills
git clone https://github.com/dannwaneri/proof-of-contribution.git \
  ~/.claude/skills/proof-of-contribution

# 2. Scaffold your project (run in your repo root)
python ~/.claude/skills/proof-of-contribution/assets/scripts/poc_init.py

# 3. Record attribution for an AI-generated file
python poc.py add src/utils/parser.py

# 4. Detect gaps via static analysis
python poc.py verify src/utils/parser.py

# 5. See the full provenance chain
python poc.py trace src/utils/parser.py
</code></pre>
<p><strong>Windows PowerShell:</strong></p>
<pre><code class="language-powershell"># 1. Install
New-Item -ItemType Directory -Force -Path "$HOME\.claude\skills"
git clone https://github.com/dannwaneri/proof-of-contribution.git `
  "$HOME\.claude\skills\proof-of-contribution"

# 2. Scaffold your project
python "$HOME\.claude\skills\proof-of-contribution\assets\scripts\poc_init.py"

# 3. Record attribution
python poc.py add src\utils\parser.py

# 4. Detect gaps
python poc.py verify src\utils\parser.py

# 5. See the full provenance chain
python poc.py trace src\utils\parser.py
</code></pre>
<p>That's the whole tool. The sections below walk through each step in detail with real terminal output at every stage.</p>
<h2 id="heading-how-the-tool-works">How the Tool Works</h2>
<p>Before you install anything, you need a clear mental model of what proof-of-contribution actually does — because the most important part isn't obvious.</p>
<h3 id="heading-the-archaeology-problem">The Archaeology Problem</h3>
<p>Here's a scenario that happens on every team using AI-assisted development.</p>
<p>A developer joins. They go through six months of AI-generated codebase. They hit a bug in the pagination logic — cursor-based, unusual implementation, nobody remembers why it was built that way. The original developer has left.</p>
<p>Old answer: two days of archaeology. <code>git blame</code> points to a commit message that says "fix pagination." The commit before that says "implement pagination." Dead end.</p>
<p>With <code>poc.py trace src/utils/paginator.py</code>, that same developer sees this in thirty seconds:</p>
<pre><code class="language-plaintext">Provenance trace: src/utils/paginator.py
────────────────────────────────────────────────────────────
  [HIGH]  @tannerlinsley on github
          Cursor pagination discussion
          https://github.com/TanStack/query/discussions/123
          Insight: cursor beats offset for live-updating datasets

Knowledge gaps (AI-synthesized, no human source):
  • Error retry strategy — no human source cited
  • Concurrent write handling — AI chose this arbitrarily
</code></pre>
<p>They now know where the pattern came from and — critically — which parts have no traceable human source. The concurrent write handling is where the bug lives. The AI made a choice nobody reviewed.</p>
<p>That's what this tool does. Not enforcement first. Archaeology first.</p>
<h3 id="heading-how-knowledge-gaps-are-detected">How Knowledge Gaps Are Detected</h3>
<p>The obvious assumption is that Claude introspects and reports what it doesn't know. That assumption is wrong. LLMs hallucinate confidently. An AI that could reliably detect its own knowledge gaps wouldn't produce them.</p>
<p>The detection mechanism is a comparison, not introspection.</p>
<p>When you use <a href="https://github.com/dannwaneri/spec-writer">spec-writer</a> before building, it generates a spec with an explicit <code>## Assumptions to review</code> section — every decision the AI is making that you didn't specify, each one impact-rated. That list is the contract.</p>
<p>When you run <code>poc.py import-spec spec.md --artifact src/utils/paginator.py</code>, those assumptions get seeded into the database as unresolved knowledge gaps. After the agent builds, <code>poc.py trace</code> shows which assumptions made it into code with no human source ever cited.</p>
<p>The AI isn't grading its own exam. The spec is the answer key.</p>
<p><code>poc.py verify</code> takes this further. After the agent builds, it parses the file's actual structure using Python's built-in <code>ast</code> module — extracting every function definition, conditional branch, and return path. It cross-checks each one against the seeded claims. Any structural unit with no resolved claim surfaces as a deterministic Knowledge Gap, regardless of how confident the model was when it wrote the code.</p>
<h2 id="heading-how-to-install-proof-of-contribution">How to Install proof-of-contribution</h2>
<h3 id="heading-mac-and-linux">Mac and Linux</h3>
<pre><code class="language-bash">mkdir -p ~/.claude/skills
git clone https://github.com/dannwaneri/proof-of-contribution.git \
  ~/.claude/skills/proof-of-contribution
</code></pre>
<h3 id="heading-windows-powershell">Windows PowerShell</h3>
<pre><code class="language-powershell">New-Item -ItemType Directory -Force -Path "$HOME\.claude\skills"
git clone https://github.com/dannwaneri/proof-of-contribution.git `
  "$HOME\.claude\skills\proof-of-contribution"
</code></pre>
<p>That's the entire installation. No package to install, no configuration file to edit. The skill is a markdown file the agent reads. The CLI is a Python script that runs locally.</p>
<h3 id="heading-verify-the-install">Verify the Install:</h3>
<pre><code class="language-bash">ls ~/.claude/skills/proof-of-contribution/
</code></pre>
<p>You should see <code>SKILL.md</code>, <code>poc.py</code>, <code>assets/</code>, and <code>references/</code>. If the directory is empty, the clone failed — check your internet connection and try again.</p>
<h2 id="heading-how-to-scaffold-your-project">How to Scaffold Your Project</h2>
<p>The scaffold script creates the database, config, CLI, and GitHub integration in your project root. Run it once per project.</p>
<h3 id="heading-mac-and-linux">Mac and Linux</h3>
<pre><code class="language-bash">cd /path/to/your/project
python ~/.claude/skills/proof-of-contribution/assets/scripts/poc_init.py
</code></pre>
<h3 id="heading-windows-powershell">Windows PowerShell</h3>
<pre><code class="language-powershell">cd C:\path\to\your\project
python "$HOME\.claude\skills\proof-of-contribution\assets\scripts\poc_init.py"
</code></pre>
<p>You should see output like this:</p>
<pre><code class="language-plaintext">🔗 Proof of Contribution — init

  →  Project root: /path/to/your/project
  ✔  Created .poc/config.json
  ✔  Created .poc/.gitignore  (db excluded from git, config tracked)
  ✔  Created .poc/provenance.db  (SQLite — no extra infra needed)
  ✔  Created .github/PULL_REQUEST_TEMPLATE.md
  ✔  Created .github/workflows/poc-check.yml
  ✔  Created poc.py  (local CLI — includes import-spec command)
  ✔  Created .gitignore

✔ Proof of Contribution initialised for 'your-project'
</code></pre>
<p>This creates four things in your project:</p>
<pre><code class="language-plaintext">your-project/
├── .poc/
│   ├── config.json      ← project settings (commit this)
│   ├── provenance.db    ← SQLite database (local only, gitignored)
│   └── .gitignore
├── .github/
│   ├── PULL_REQUEST_TEMPLATE.md
│   └── workflows/
│       └── poc-check.yml
└── poc.py               ← your local CLI
</code></pre>
<ul>
<li><p><code>.poc/</code> — the tool's local data directory. <code>config.json</code> stores project settings and is committed to git. <code>provenance.db</code> is the SQLite database where attribution records and knowledge gaps are stored — local only, gitignored.</p>
</li>
<li><p><code>poc.py</code> — your local CLI, copied into the project root. Run <code>python poc.py trace</code>, <code>python poc.py verify</code>, and every other command directly without a global install.</p>
</li>
<li><p><code>.github/PULL_REQUEST_TEMPLATE.md</code> — a PR template with the <code>## 🤖 AI Provenance</code> section pre-filled. Developers fill it in when submitting PRs that contain AI-generated code.</p>
</li>
<li><p><code>.github/workflows/poc-check.yml</code> — the optional GitHub Action for PR enforcement. Installed but dormant until you push the workflow file and enable it in your repo settings.</p>
</li>
</ul>
<p><strong>Windows note:</strong> if the scaffold fails with a <code>UnicodeEncodeError</code>, the emoji in the PR template is hitting a Windows encoding limit. Open <code>assets/scripts/poc_init.py</code> in a text editor and find every line ending with <code>.write_text(...)</code>. Change each one to <code>.write_text(..., encoding="utf-8")</code>. Save and re-run.</p>
<h3 id="heading-verify-the-scaffold-worked">Verify the Scaffold Worked</h3>
<pre><code class="language-bash">python poc.py report
</code></pre>
<p>Expected output:</p>
<pre><code class="language-plaintext">Proof of Contribution Report
────────────────────────────────────────
  Artifacts tracked    : 0
  With provenance      : 0  (0%)
  Unresolved gaps      : 0
  Resolved claims      : 0
  Human experts        : 0
</code></pre>
<p>Empty database, clean state. You're ready.</p>
<h2 id="heading-how-to-record-your-first-provenance-entry">How to Record Your First Provenance Entry</h2>
<p>Before we dive in here, I just want to clear something up. Earlier, I described <code>poc.py verify</code> as detecting Knowledge Gaps automatically — and it does. But the static analyser can only tell you <em>that</em> a function has no human citation. It can't tell you <em>which</em> human source inspired it. That knowledge lives in your head, not in the code.</p>
<p><code>poc.py add</code> is where you supply that context. After the agent builds a file, you record the human sources you actually drew on: the GitHub discussion you read before prompting, the Stack Overflow answer that shaped the approach. Those records become the attribution chain <code>poc.py trace</code> surfaces — and what closes the gaps <code>poc.py verify</code> flags.</p>
<p><code>verify</code> finds the gaps. <code>add</code> fills them.</p>
<p><code>poc.py add</code> records attribution for a file interactively. You can run it on any AI-generated file in your project.</p>
<pre><code class="language-bash">python poc.py add src/utils/parser.py
</code></pre>
<p>You'll see a prompt:</p>
<pre><code class="language-plaintext">Recording provenance for: src/utils/parser.py
(Press Ctrl+C to cancel)

  Human source URL (or Enter to finish):
</code></pre>
<p>Enter the URL of the human-authored source that inspired the code. This could be a GitHub discussion, a Stack Overflow answer, a documentation page, a blog post, or an RFC.</p>
<pre><code class="language-plaintext">  Human source URL (or Enter to finish): https://github.com/TanStack/query/discussions/123
  Author handle: tannerlinsley
  Platform (github/stackoverflow/docs/other): github
  Source title: Cursor pagination discussion
  What specific insight came from this? cursor beats offset for live-updating datasets
  Confidence HIGH/MEDIUM/LOW [MEDIUM]: HIGH
  ✔ Recorded.
</code></pre>
<p>Add as many sources as apply. Press Enter on a blank URL when you're done.</p>
<pre><code class="language-plaintext">  Human source URL (or Enter to finish): 
✔ Provenance saved. Run: python poc.py trace src/utils/parser.py
</code></pre>
<h3 id="heading-check-what-you-recorded">Check What You Recorded</h3>
<pre><code class="language-bash">python poc.py trace src/utils/parser.py
</code></pre>
<pre><code class="language-plaintext">Provenance trace: src/utils/parser.py
────────────────────────────────────────────────────────────
  [HIGH]  @tannerlinsley on github
          Cursor pagination discussion
          https://github.com/TanStack/query/discussions/123
          Insight: cursor beats offset for live-updating datasets
</code></pre>
<p>No knowledge gaps — because you recorded a source. If the file had parts with no human source, they would appear below as gaps.</p>
<h3 id="heading-see-all-experts-in-your-graph">See All Experts in Your Graph</h3>
<p>Every <code>poc.py add</code> call stores not just the URL but the author — their handle, platform, and the specific insight they contributed. Run it across enough files, and those authors accumulate into a <strong>knowledge graph</strong>: a local record of which human experts your codebase drew from, which files their knowledge shaped, and how many artifacts trace back to their work.</p>
<p><code>poc.py experts</code> surfaces the top contributors. On a new project, it'll be one or two entries. On a mature codebase, it becomes a map of whose knowledge is load-bearing — the people you'd want to consult if that part of the code ever needed to change.</p>
<pre><code class="language-bash">python poc.py experts
</code></pre>
<pre><code class="language-plaintext">Top Human Experts in Knowledge Graph
──────────────────────────────────────────────────────
  @tannerlinsley            github          1 artifact(s)
</code></pre>
<h2 id="heading-how-to-use-import-spec-to-seed-knowledge-gaps">How to Use import-spec to Seed Knowledge Gaps</h2>
<p>This is the most important command in the tool. It connects proof-of-contribution with spec-writer and makes Knowledge Gaps deterministic.</p>
<p>When you use spec-writer before building a feature, it generates an <code>## Assumptions to review</code> section — every implicit decision is impact-rated HIGH, MEDIUM, or LOW. The <code>import-spec</code> command reads that section and seeds those assumptions into the database as unresolved gaps before the agent writes a line of code.</p>
<p>After the agent builds, any assumption that made it into the implementation without a cited human source surfaces automatically in <code>poc.py trace</code>. You don't need to know which parts of the code are uncertain. The spec already told you.</p>
<h3 id="heading-step-1-create-a-test-spec">Step 1 — Create a Test Spec</h3>
<p>If you don't have a spec-writer output yet, create one manually to see how the import works.</p>
<p><strong>Mac and Linux:</strong></p>
<pre><code class="language-bash">cat &gt; test-spec.md &lt;&lt; 'EOF'
## Assumptions to review

1. SQLite is sufficient for single-developer use — Impact: HIGH
   Correct this if: you need team-shared provenance

2. Filepath is the artifact identifier — Impact: MEDIUM
   Correct this if: you use content hashing instead

3. REST pattern for any future API — Impact: LOW
   Correct this if: you prefer GraphQL
EOF
</code></pre>
<p><strong>Windows PowerShell:</strong></p>
<pre><code class="language-powershell">python -c "
content = '''## Assumptions to review

1. SQLite is sufficient for single-developer use - Impact: HIGH
   Correct this if: you need team-shared provenance

2. Filepath is the artifact identifier - Impact: MEDIUM
   Correct this if: you use content hashing instead

3. REST pattern for any future API - Impact: LOW
   Correct this if: you prefer GraphQL'''
open('test-spec.md', 'w', encoding='utf-8').write(content)
print('test-spec.md created')
"
</code></pre>
<p><strong>Windows note:</strong> don't use PowerShell's <code>echo</code> to create spec files. PowerShell saves files as UTF-16, which causes a <code>UnicodeDecodeError</code> when <code>import-spec</code> reads them. The <code>python -c</code> approach above writes UTF-8 correctly.</p>
<h3 id="heading-step-2-import-the-assumptions">Step 2 — Import the Assumptions</h3>
<pre><code class="language-bash">python poc.py import-spec test-spec.md --artifact src/utils/parser.py
</code></pre>
<pre><code class="language-plaintext">Spec assumptions imported — 3 Knowledge Gap(s) seeded
───────────────────────────────────────────────────────
  1. [HIGH] SQLite is sufficient for single-developer use
       Correct if: you need team-shared provenance
  2. [MEDIUM] Filepath is the artifact identifier
       Correct if: you use content hashing instead
  3. [LOW] REST pattern for any future API
       Correct if: you prefer GraphQL

  →  Bound to: src/utils/parser.py
  After the agent builds, run:
  python poc.py trace src/utils/parser.py
  python poc.py add src/utils/parser.py
</code></pre>
<h3 id="heading-step-3-trace-the-gaps">Step 3 — Trace the Gaps</h3>
<pre><code class="language-bash">python poc.py trace src/utils/parser.py
</code></pre>
<pre><code class="language-plaintext">Knowledge gaps (AI-synthesized, no human source):
  • REST pattern for any future API [Correct if: you prefer GraphQL]
  • SQLite is sufficient for single-developer use [Correct if: you need team-shared provenance]
  • Filepath is the artifact identifier [Correct if: you use content hashing instead]

  Resolve gaps: python poc.py add src/utils/parser.py
</code></pre>
<p>Three gaps, colour-coded by urgency. The HIGH-impact assumption — SQLite for single-developer use — appears in red. The LOW-impact one appears in green. When you run <code>poc.py add</code> and record a human source with an insight that overlaps the gap text, the gap auto-closes.</p>
<h3 id="heading-preview-without-writing">Preview Without Writing</h3>
<pre><code class="language-bash">python poc.py import-spec test-spec.md --dry-run
</code></pre>
<p>This parses the spec and prints what would be seeded without touching the database. This is useful before committing to an import.</p>
<h3 id="heading-check-the-overall-health">Check the Overall Health</h3>
<pre><code class="language-bash">python poc.py report
</code></pre>
<pre><code class="language-plaintext">Proof of Contribution Report
────────────────────────────────────────
  Artifacts tracked    : 1
  With provenance      : 0  (0%)
  Unresolved gaps      : 3
  Resolved claims      : 0
  Human experts        : 1
  ⚠ Less than 50% of artifacts have provenance records.
  ⚠ 3 unresolved Knowledge Gap(s).
    Run `poc.py trace &lt;filepath&gt;` to locate them.
</code></pre>
<h2 id="heading-how-to-trace-human-attribution">How to Trace Human Attribution</h2>
<p><code>poc.py trace</code> is the command you'll use most. It shows the full human attribution chain for any file and lists any knowledge gaps — parts of the code with no traceable human source.</p>
<pre><code class="language-bash">python poc.py trace src/utils/parser.py
</code></pre>
<p>A file with both attribution and gaps looks like this:</p>
<pre><code class="language-plaintext">Provenance trace: src/utils/parser.py
────────────────────────────────────────────────────────────
  [HIGH]  @juliandeangelis on github
          Spec Driven Development methodology
          https://github.com/dannwaneri/spec-writer
          Insight: separate functional from technical spec

  [MEDIUM] @tannerlinsley on github
           Cursor pagination discussion
           https://github.com/TanStack/query/discussions/123
           Insight: cursor beats offset for live-updating datasets

Knowledge gaps (AI-synthesized, no human source):
  • Error retry strategy — no human source cited
  • CSV column ordering — AI chose this arbitrarily

  Resolve gaps: python poc.py add src/utils/parser.py
</code></pre>
<p>The human attribution section shows every cited source, colour-coded by confidence. The knowledge gaps section shows every assumption that shipped without a human citation — either seeded from a spec via <code>import-spec</code>, or flagged by Claude in the Provenance Block.</p>
<h3 id="heading-resolving-gaps">Resolving Gaps</h3>
<p>Run <code>poc.py add</code> on any file with open gaps:</p>
<pre><code class="language-bash">python poc.py add src/utils/parser.py
</code></pre>
<p>When you enter an insight that shares words with an open gap claim, the gap auto-closes. Run <code>poc.py trace</code> again to confirm it's resolved.</p>
<h2 id="heading-how-to-verify-with-static-analysis">How to Verify with Static Analysis</h2>
<p><code>poc.py verify</code> is the command that closes the epistemic trust gap completely. It detects Knowledge Gaps by analysing the file's actual code structure — not by asking the AI what it doesn't know.</p>
<p>Run it after the agent builds, once you've seeded gaps with <code>import-spec</code>:</p>
<pre><code class="language-bash">python poc.py verify src/utils/parser.py
</code></pre>
<p>Expected output:</p>
<pre><code class="language-plaintext">Verify: src/utils/parser.py
────────────────────────────────────────────────────────────
  Structural units detected : 11
  Seeded claims             : 3
  Covered by cited source   : 2
  Deterministic gaps        : 1

Deterministic Knowledge Gaps (no human source):
  • function: handle_concurrent_writes (lines 47–61)
      Seeded assumption: concurrent write handling — AI chose this arbitrarily

  Resolve: python poc.py add src/utils/parser.py
</code></pre>
<p>The gap shown is not something Claude admitted. It's something the analyser found by comparing the file's function list against your seeded claims. The function <code>handle_concurrent_writes</code> exists in the code but has no resolved human citation in the database. That's the gap.</p>
<h3 id="heading-what-the-exit-codes-mean">What the Exit Codes Mean</h3>
<pre><code class="language-bash">python poc.py verify src/utils/parser.py
echo $?   # Mac/Linux

python poc.py verify src/utils/parser.py
echo $LASTEXITCODE   # Windows PowerShell
</code></pre>
<ul>
<li><p><strong>Exit code 0</strong> — no gaps, all detected units have cited sources</p>
</li>
<li><p><strong>Exit code 1</strong> — gaps found, resolve with <code>poc.py add</code></p>
</li>
<li><p><strong>Exit code 2</strong> — file not found or unsupported language</p>
</li>
</ul>
<p>Exit code 1 integrates directly into CI pipelines. Add <code>poc.py verify</code> to your GitHub Action or pre-commit hook and gaps block the build before they reach production.</p>
<h3 id="heading-run-it-without-a-seeded-spec">Run it Without a Seeded Spec</h3>
<p>If you haven't run <code>import-spec</code> first, <code>verify</code> still works — it falls back to structural analysis and surfaces every uncited function and branch as a gap:</p>
<pre><code class="language-bash">python poc.py verify src/utils/parser.py
</code></pre>
<pre><code class="language-plaintext">⚠ No spec imported — showing all uncited structural units.
  Run: python poc.py import-spec spec.md --artifact src/utils/parser.py
  for deterministic gap detection.

Deterministic Knowledge Gaps (no human source):
  • function: parse_query (lines 1–7)
  • branch: if not text (lines 2–3)
  • function: fetch_results (lines 9–12)
  ...
</code></pre>
<p>It's less precise than the spec-writer path — every structural unit shows rather than only the ones tied to named assumptions — but it's useful as a baseline on any file, new or old.</p>
<h3 id="heading-the-strict-flag">The <code>--strict</code> Flag</h3>
<pre><code class="language-bash">python poc.py verify src/utils/parser.py --strict
</code></pre>
<p>Strict mode flags every uncited structural unit as a gap even when claims are seeded. You can use it when you want zero tolerance: any function or branch without a resolved human source fails the check.</p>
<h2 id="heading-how-to-enable-pr-enforcement">How to Enable PR Enforcement</h2>
<p>Once <code>poc.py trace</code> has saved you real hours — not before — enable the GitHub Action. The distinction matters. Turning it on day one frames the tool as overhead. Turning it on after the team already finds value frames it as a standard.</p>
<pre><code class="language-bash">git add .github/ .poc/config.json poc.py
git commit -m "chore: add proof-of-contribution"
git push
</code></pre>
<p>After that, every PR is checked for an <code>## 🤖 AI Provenance</code> section. The scaffold already created the PR template with that section included. Developers fill it in naturally once they're already running <code>poc.py trace</code> locally — the template just asks them to record what they already know.</p>
<p>Developers who write fully human code opt out by adding <code>100% human-written</code> anywhere in the PR body. The action skips the check automatically.</p>
<h3 id="heading-what-the-action-checks">What the Action Checks</h3>
<p>The action reads the PR description and looks for:</p>
<ol>
<li><p>The <code>## 🤖 AI Provenance</code> heading</p>
</li>
<li><p>At least one populated row in the attribution table</p>
</li>
</ol>
<p>If the section is missing or the table is empty, the action fails and posts a comment explaining what to add. The comment includes a link to <code>poc.py trace &lt;filepath&gt;</code> so the developer knows exactly where to look.</p>
<h2 id="heading-where-to-go-next">Where to Go Next</h2>
<h3 id="heading-use-it-with-spec-writer-on-a-real-feature">Use it with spec-writer on a Real Feature</h3>
<p>The real value of <code>import-spec</code> is on actual features, not test specs. If you use <a href="https://github.com/dannwaneri/spec-writer">spec-writer</a>, the workflow is:</p>
<pre><code class="language-plaintext">/spec-writer "your feature description"
</code></pre>
<p>Save the output to <code>spec.md</code>. Then:</p>
<pre><code class="language-bash">python poc.py import-spec spec.md --artifact src/path/to/output.py
</code></pre>
<p>Build the feature with your agent. Then run <code>poc.py trace</code> to see which assumptions made it into code with no human source. Resolve the HIGH-impact gaps first — those are the ones that will cause production incidents.</p>
<h3 id="heading-activate-the-claude-code-skill">Activate the Claude Code Skill</h3>
<p>The SKILL.md file makes Claude automatically append a Provenance Block to every generated artifact when the skill is active. The block lists human sources Claude drew from and flags what it synthesized without any traceable source.</p>
<p>To activate it in Claude Code, the skill is already installed at <code>~/.claude/skills/proof-of-contribution/</code>. Claude Code loads it automatically when you are in a project that has <code>.poc/config.json</code>.</p>
<p>A generated Provenance Block looks like this:</p>
<pre><code class="language-plaintext">## PROOF OF CONTRIBUTION
Generated artifact: fetch_github_discussions()
Confidence: MEDIUM

## HUMAN SOURCES THAT INSPIRED THIS

[1] GitHub GraphQL API Documentation Team
    Source type: Official Docs
    URL: docs.github.com/en/graphql
    Contribution: cursor-based pagination pattern

[2] GitHub Community (multiple contributors)
    Source type: GitHub Discussions
    URL: github.com/community/community
    Contribution: "ghost" fallback for deleted accounts
                  surfaced in bug reports

## KNOWLEDGE GAPS (AI synthesized, no human cited)
- Error handling / retry logic
- Rate limit strategy

## RECOMMENDED HUMAN EXPERTS TO CONSULT
- github.com/octokit community for pagination
</code></pre>
<p>The Knowledge Gaps section is the part no other tool produces. It's where AI admits what it synthesized without a traceable human source — before that gap becomes a production incident.</p>
<h3 id="heading-upgrade-when-you-outgrow-sqlite">Upgrade When You Outgrow SQLite</h3>
<p>The default database is SQLite — local only, no infra required. When you need team sharing or graph queries, the <code>references/</code> directory in the repo has migration guides:</p>
<table>
<thead>
<tr>
<th>Need</th>
<th>File</th>
</tr>
</thead>
<tbody><tr>
<td>Team sharing a provenance DB</td>
<td><code>references/relational-schema.md</code></td>
</tr>
<tr>
<td>Graph traversal queries</td>
<td><code>references/neo4j-implementation.md</code></td>
</tr>
<tr>
<td>Semantic web / interoperability</td>
<td><code>references/jsonld-schema.md</code></td>
</tr>
</tbody></table>
<h2 id="heading-manual-tracking-vs-proof-of-contribution">Manual Tracking vs. proof-of-contribution</h2>
<table>
<thead>
<tr>
<th></th>
<th>Manual tracking</th>
<th>proof-of-contribution</th>
</tr>
</thead>
<tbody><tr>
<td><strong>Finding who wrote the code</strong></td>
<td>Search Slack, ask the team, dig through commits</td>
<td><code>poc.py trace &lt;file&gt;</code> — thirty seconds</td>
</tr>
<tr>
<td><strong>Knowing which parts the AI guessed</strong></td>
<td>You don't, until it breaks in production</td>
<td>Knowledge Gaps section — surfaced before the code ships</td>
</tr>
<tr>
<td><strong>Detecting gaps after the build</strong></td>
<td>Code review, if someone notices</td>
<td><code>poc.py verify</code> — static analysis, zero API calls</td>
</tr>
<tr>
<td><strong>Enforcing attribution on PRs</strong></td>
<td>Honor system</td>
<td>GitHub Action fails the PR if attribution is missing</td>
</tr>
<tr>
<td><strong>Connecting to your spec</strong></td>
<td>Copy-paste assumptions into comments manually</td>
<td><code>poc.py import-spec</code> seeds them as tracked claims automatically</td>
</tr>
<tr>
<td><strong>Infrastructure required</strong></td>
<td>None (usually a spreadsheet or nothing)</td>
<td>None — SQLite, pure Python, no paid services</td>
</tr>
</tbody></table>
<p>The tool doesn't replace code review. It gives code review the context it needs to catch the right things.</p>
<p>The archaeology scenario — two days tracing a bug through dead-end commit messages — takes thirty seconds with <code>poc.py trace</code>. The code still has gaps, and it always will. But now you know where they are.</p>
<p><em>Built by</em> <a href="https://dev.to/dannwaneri"><em>Daniel Nwaneri</em></a><em>. The spec-writer skill that feeds</em> <code>import-spec</code> <em>is at</em> <a href="https://github.com/dannwaneri/spec-writer"><em>github.com/dannwaneri/spec-writer</em></a><em>. The full proof-of-contribution repo is at</em> <a href="https://github.com/dannwaneri/proof-of-contribution"><em>github.com/dannwaneri/proof-of-contribution</em></a><em>.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ How to Build a Cost-Efficient AI Agent with Tiered Model Routing ]]>
                </title>
                <description>
                    <![CDATA[ Most AI agent tutorials make the same mistake: they route every task to the most expensive model available. A character count doesn't need GPT-4. A presence check doesn't need Sonnet. A regex doesn't  ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-build-a-cost-efficient-ai-agent-with-tiered-model-routing/</link>
                <guid isPermaLink="false">69d6ddbd707c1ce7688e7ea0</guid>
                
                    <category>
                        <![CDATA[ Python ]]>
                    </category>
                
                    <category>
                        <![CDATA[ claude.ai ]]>
                    </category>
                
                    <category>
                        <![CDATA[ claude-code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ AI ]]>
                    </category>
                
                    <category>
                        <![CDATA[ ai agents ]]>
                    </category>
                
                    <category>
                        <![CDATA[ webdev ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Daniel Nwaneri ]]>
                </dc:creator>
                <pubDate>Wed, 08 Apr 2026 22:59:09 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/3a60436b-cbd7-4005-8e52-36291d815eea.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Most AI agent tutorials make the same mistake: they route every task to the most expensive model available.</p>
<p>A character count doesn't need GPT-4. A presence check doesn't need Sonnet. A regex doesn't need anything except Python.</p>
<p>The mistake isn't using AI — it's not knowing when to stop using it.</p>
<p>This tutorial shows you how to build a tiered routing system that sends tasks to the cheapest model that can solve them. The pattern is called the cost curve. It comes from a comment thread on a DEV.to article, implemented by three developers over a weekend, and it cut the per-URL cost of a real SEO audit agent from \(0.006 to effectively \)0 for most pages.</p>
<p>By the end, you'll have a working <code>cost_curve.py</code> module you can drop into any agent project.</p>
<h2 id="heading-what-youll-build">What You'll Build</h2>
<p>A three-tier routing function that:</p>
<ul>
<li><p>Runs deterministic Python checks first — zero API cost</p>
</li>
<li><p>Escalates to Claude Haiku only for genuinely ambiguous cases — ~$0.0001 per call</p>
</li>
<li><p>Escalates to Claude Sonnet only when semantic judgment is required — ~$0.006 per call</p>
</li>
<li><p>Falls back gracefully when any tier fails</p>
</li>
<li><p>Returns a consistent result schema regardless of which tier handled the request</p>
</li>
</ul>
<p>The full implementation is part of <a href="https://github.com/dannwaneri/seo-agent">dannwaneri/seo-agent</a>, an open-core SEO audit agent. The cost curve module is the premium routing layer, and the principle applies to any agent with mixed-complexity tasks.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li><p>Python 3.11 or higher</p>
</li>
<li><p>An Anthropic API key</p>
</li>
<li><p>Basic familiarity with Python and the Claude API</p>
</li>
</ul>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ol>
<li><p><a href="#heading-the-problem-with-calling-claude-on-everything">The Problem with Calling Claude on Everything</a></p>
</li>
<li><p><a href="#heading-the-cost-curve-explained">The Cost Curve Explained</a></p>
</li>
<li><p><a href="#heading-project-setup">Project Setup</a></p>
</li>
<li><p><a href="#heading-tier-1-deterministic-python">Tier 1: Deterministic Python</a></p>
</li>
<li><p><a href="#heading-tier-2-claude-haiku-for-ambiguous-cases">Tier 2: Claude Haiku for Ambiguous Cases</a></p>
</li>
<li><p><a href="#heading-tier-3-claude-sonnet-for-semantic-judgment">Tier 3: Claude Sonnet for Semantic Judgment</a></p>
</li>
<li><p><a href="#heading-the-router-audit_url">The Router: audit_url()</a></p>
</li>
<li><p><a href="#heading-graceful-fallback">Graceful Fallback</a></p>
</li>
<li><p><a href="#heading-testing-the-cost-curve">Testing the Cost Curve</a></p>
</li>
<li><p><a href="#heading-applying-this-pattern-to-your-agent">Applying This Pattern to Your Agent</a></p>
</li>
</ol>
<h2 id="heading-the-problem-with-calling-claude-on-everything">The Problem with Calling Claude on Everything</h2>
<p>Here's what most agent code looks like:</p>
<pre><code class="language-python">def audit_url(snapshot: dict) -&gt; dict:
    response = client.messages.create(
        model="claude-sonnet-4-20250514",
        messages=[{"role": "user", "content": build_prompt(snapshot)}]
    )
    return parse_response(response)
</code></pre>
<p>This works. It also calls Sonnet for every URL in the list — including the ones where the title is 142 characters long and the answer is obviously FAIL without any model involvement.</p>
<p>Claude Sonnet 4 is priced at \(3 per million input tokens and \)15 per million output tokens. A typical page snapshot is around 500 input tokens. That's \(0.0015 per URL just for input — before output tokens. Across a 20-URL weekly audit, the total is around \)0.12. Not expensive. But most of those pages have mechanical SEO issues: missing descriptions, titles over 60 characters, no canonical tag. A character count catches all of that. You don't need a model.</p>
<p>The cost curve fixes this by routing based on what the task actually requires, not on what the model is capable of.</p>
<h2 id="heading-the-cost-curve-explained">The Cost Curve Explained</h2>
<p>In the cost curve, we have three tiers, three tools, and three price points:</p>
<p><strong>Tier 1 — Deterministic Python. Cost: $0.</strong> Check title length, description length, H1 count, canonical presence. These are not judgment calls. They're string operations. If title length &gt; 60, FAIL. No model needed.</p>
<p><strong>Tier 2 — Claude Haiku. Cost: ~$0.0001 per call.</strong> Title present but only 4 characters long. Description present but only 30 characters. Status code is a redirect. These pass the mechanical audit but something is off. Haiku is fast and cheap enough that escalating ambiguous cases costs less than the debugging time you'd spend on false positives.</p>
<p><strong>Tier 3 — Claude Sonnet. Cost: ~$0.006 per call.</strong> Pages Haiku flags as needing semantic judgment. "This title passes length but reads like a navigation label." "This description duplicates the title verbatim." Sonnet earns its cost on genuinely hard cases — not on every URL in the list.</p>
<p>The routing decision happens before any API call. The result schema is identical regardless of which tier handled the request.</p>
<h2 id="heading-project-setup">Project Setup</h2>
<pre><code class="language-bash">mkdir cost-curve-demo &amp;&amp; cd cost-curve-demo
pip install anthropic
</code></pre>
<p>Set your API key:</p>
<pre><code class="language-bash"># macOS/Linux
export ANTHROPIC_API_KEY="sk-ant-..."

# Windows PowerShell
$env:ANTHROPIC_API_KEY = "sk-ant-..."
</code></pre>
<p>Create <code>cost_curve.py</code> — you'll build this module step by step.</p>
<h2 id="heading-tier-1-deterministic-python">Tier 1: Deterministic Python</h2>
<p>Tier 1 runs first on every URL. It checks four fields using only Python string operations. There's no API call, no latency, and no cost.</p>
<pre><code class="language-python">import json
import logging
import os
import re
from datetime import datetime, timezone

import anthropic

logger = logging.getLogger(__name__)

REDIRECT_CODES = {301, 302, 307, 308}

# Fields that trigger Tier 2 escalation
# Title or description present but suspiciously short
AMBIGUOUS_TITLE_MAX = 10   # chars — present but too short to be real
AMBIGUOUS_DESC_MAX = 50    # chars — present but too short to be useful


def _now_iso() -&gt; str:
    return datetime.now(timezone.utc).isoformat()


def _build_result(snapshot: dict, method: str) -&gt; dict:
    """Base result skeleton — same schema regardless of tier."""
    return {
        "url": snapshot.get("final_url", ""),
        "final_url": snapshot.get("final_url", ""),
        "status_code": snapshot.get("status_code"),
        "title": {"value": None, "length": 0, "status": "PASS"},
        "description": {"value": None, "length": 0, "status": "PASS"},
        "h1": {"count": 0, "value": None, "status": "PASS"},
        "canonical": {"value": None, "status": "PASS"},
        "flags": [],
        "human_review": False,
        "audited_at": _now_iso(),
        "method": method,
        "needs_tier3": False,
    }


def tier1_check(snapshot: dict) -&gt; dict:
    """
    Pure Python SEO checks. Zero API calls.

    Returns a result dict with method="deterministic".
    Sets needs_tier3=False always — Tier 1 never escalates to Tier 3 directly.
    Escalation to Tier 2 is decided by the router, not here.
    """
    result = _build_result(snapshot, "deterministic")

    title = snapshot.get("title") or ""
    description = snapshot.get("meta_description") or ""
    h1s = snapshot.get("h1s") or []
    canonical = snapshot.get("canonical") or ""

    # Title check
    result["title"]["value"] = title or None
    result["title"]["length"] = len(title)
    if not title or len(title) &gt; 60:
        result["title"]["status"] = "FAIL"
        msg = "Title is missing" if not title else f"Title is {len(title)} characters (max 60)"
        result["flags"].append(msg)

    # Description check
    result["description"]["value"] = description or None
    result["description"]["length"] = len(description)
    if not description or len(description) &gt; 160:
        result["description"]["status"] = "FAIL"
        msg = "Meta description is missing" if not description else f"Meta description is {len(description)} characters (max 160)"
        result["flags"].append(msg)

    # H1 check
    result["h1"]["count"] = len(h1s)
    result["h1"]["value"] = h1s[0] if h1s else None
    if len(h1s) == 0:
        result["h1"]["status"] = "FAIL"
        result["flags"].append("H1 tag is missing")
    elif len(h1s) &gt; 1:
        result["h1"]["status"] = "FAIL"
        result["flags"].append(f"Multiple H1 tags found ({len(h1s)})")

    # Canonical check
    result["canonical"]["value"] = canonical or None
    if not canonical:
        result["canonical"]["status"] = "FAIL"
        result["flags"].append("Canonical tag is missing")

    return result
</code></pre>
<p>The key design decision: <code>tier1_check()</code> never decides whether to escalate. It just runs the checks and returns. The router decides escalation based on the result.</p>
<h2 id="heading-tier-2-claude-haiku-for-ambiguous-cases">Tier 2: Claude Haiku for Ambiguous Cases</h2>
<p>Tier 2 runs when Tier 1 detects something mechanical but the result might need a second look. A 4-character title present but clearly wrong. A 30-character description that's technically there but useless. A redirect status that needs a human-readable explanation.</p>
<p>Haiku is the right model here. It's fast, cheap (\(1 input / \)5 output per million tokens), and sufficient for triage-level judgment. The prompt asks a narrow question: is this ambiguous enough to need Sonnet?</p>
<pre><code class="language-python">def tier2_check(snapshot: dict) -&gt; dict:
    """
    Claude Haiku call for ambiguous cases.

    Returns result with method="haiku".
    Sets needs_tier3=True if Haiku determines the case needs semantic judgment.
    Falls back to Tier 1 result on API error.
    """
    api_key = os.environ.get("ANTHROPIC_API_KEY")
    if not api_key:
        raise OSError("ANTHROPIC_API_KEY is not set.")

    client = anthropic.Anthropic(api_key=api_key)

    title = snapshot.get("title") or ""
    description = snapshot.get("meta_description") or ""
    status_code = snapshot.get("status_code")

    prompt = f"""You are an SEO auditor doing a quick triage check.

Page data:
- Title: {repr(title)} ({len(title)} chars)
- Meta description: {repr(description)} ({len(description)} chars)
- Status code: {status_code}

Answer these two questions with only "yes" or "no":
1. Does this page need semantic judgment beyond simple length/presence checks? 
   (e.g. title is present but clearly wrong, description is present but meaningless)
2. Is the status code a redirect that needs investigation?

Respond in this exact JSON format and nothing else:
{{"needs_tier3": true_or_false, "reason": "one sentence explanation"}}"""

    try:
        response = client.messages.create(
            model="claude-haiku-4-5-20251001",
            max_tokens=150,
            messages=[{"role": "user", "content": prompt}],
        )
        raw = response.content[0].text.strip()
        # Strip markdown fences if present
        if raw.startswith("```"):
            lines = raw.splitlines()
            raw = "\n".join(lines[1:-1] if lines[-1].strip() == "```" else lines[1:])
        parsed = json.loads(raw)

        result = _build_result(snapshot, "haiku")
        # Copy Tier 1 field checks — Haiku doesn't redo those
        t1 = tier1_check(snapshot)
        result["title"] = t1["title"]
        result["description"] = t1["description"]
        result["h1"] = t1["h1"]
        result["canonical"] = t1["canonical"]
        result["flags"] = t1["flags"]
        result["needs_tier3"] = parsed.get("needs_tier3", False)
        if result["needs_tier3"]:
            result["flags"].append(f"Escalated to Tier 3: {parsed.get('reason', '')}")

        return result

    except Exception as exc:
        logger.warning("[tier2] Haiku API error: %s — falling back to Tier 1 result", exc)
        fallback = tier1_check(snapshot)
        fallback["method"] = "haiku-fallback"
        return fallback
</code></pre>
<p>The fallback is the critical piece. If Haiku fails — rate limit, network error, malformed response — the function returns the Tier 1 result rather than crashing. The audit continues. The URL gets flagged with <code>method="haiku-fallback"</code> so you can identify it later.</p>
<h2 id="heading-tier-3-claude-sonnet-for-semantic-judgment">Tier 3: Claude Sonnet for Semantic Judgment</h2>
<p>Tier 3 is where the full extraction prompt runs. This is the same call you'd make in a naïve implementation — the difference is that only a small fraction of URLs reach this tier.</p>
<pre><code class="language-python">def tier3_check(snapshot: dict) -&gt; dict:
    """
    Claude Sonnet call for semantic judgment.

    Returns result with method="sonnet".
    This is the full extraction prompt — same as calling the model directly.
    """
    api_key = os.environ.get("ANTHROPIC_API_KEY")
    if not api_key:
        raise OSError("ANTHROPIC_API_KEY is not set.")

    client = anthropic.Anthropic(api_key=api_key)

    prompt = f"""You are an SEO auditor. Analyze this page snapshot and return ONLY a JSON object.
No prose. No explanation. No markdown fences. Raw JSON only.

Page data:
- URL: {snapshot.get('final_url')}
- Status code: {snapshot.get('status_code')}
- Title: {snapshot.get('title')}
- Meta description: {snapshot.get('meta_description')}
- H1 tags: {snapshot.get('h1s')}
- Canonical: {snapshot.get('canonical')}

Return this exact schema:
{{
  "url": "string",
  "final_url": "string",
  "status_code": number,
  "title": {{"value": "string or null", "length": number, "status": "PASS or FAIL"}},
  "description": {{"value": "string or null", "length": number, "status": "PASS or FAIL"}},
  "h1": {{"count": number, "value": "string or null", "status": "PASS or FAIL"}},
  "canonical": {{"value": "string or null", "status": "PASS or FAIL"}},
  "flags": ["array of strings describing specific issues"],
  "human_review": false,
  "audited_at": "ISO timestamp"
}}

PASS/FAIL rules:
- title: FAIL if null or length &gt; 60 characters, or if present but clearly not a real title
- description: FAIL if null or length &gt; 160 characters, or if present but meaningless
- h1: FAIL if count is 0 or count &gt; 1
- canonical: FAIL if null
- audited_at: use current UTC time"""

    try:
        response = client.messages.create(
            model="claude-sonnet-4-20250514",
            max_tokens=1000,
            messages=[{"role": "user", "content": prompt}],
        )
        raw = response.content[0].text.strip()
        if raw.startswith("```"):
            lines = raw.splitlines()
            raw = "\n".join(lines[1:-1] if lines[-1].strip() == "```" else lines[1:])

        result = json.loads(raw)
        result["method"] = "sonnet"
        result["needs_tier3"] = False
        return result

    except Exception as exc:
        logger.warning("[tier3] Sonnet API error: %s — falling back to Tier 1 result", exc)
        fallback = tier1_check(snapshot)
        fallback["method"] = "sonnet-fallback"
        return fallback
</code></pre>
<p>Note the prompt addition in Tier 3 that isn't in Tier 1: <code>"or if present but clearly not a real title"</code> and <code>"or if present but meaningless"</code>. That's the semantic judgment Haiku identified as needed. Tier 3 acts on it.</p>
<h2 id="heading-the-router-auditurl">The Router: audit_url()</h2>
<p>The router is the public interface. Everything else is an implementation detail.</p>
<pre><code class="language-python">def audit_url(snapshot: dict, tiered: bool = False) -&gt; dict:
    """
    Route a page snapshot through the appropriate audit tier.

    Args:
        snapshot: Page data from browser.py — must contain final_url,
                  status_code, title, meta_description, h1s, canonical.
        tiered: If False, delegates directly to Tier 3 (Sonnet).
                If True, routes through the cost curve.

    Returns:
        Audit result dict with method field indicating which tier ran.
    """
    if not tiered:
        # Non-tiered mode: call Sonnet directly, same as v1 behavior
        return tier3_check(snapshot)

    # Tier 1: always runs first
    t1_result = tier1_check(snapshot)

    # Check if escalation to Tier 2 is warranted
    title = snapshot.get("title") or ""
    description = snapshot.get("meta_description") or ""
    status_code = snapshot.get("status_code")

    needs_tier2 = (
        # Title present but suspiciously short
        (title and len(title) &lt; AMBIGUOUS_TITLE_MAX) or
        # Description present but suspiciously short
        (description and len(description) &lt; AMBIGUOUS_DESC_MAX) or
        # Redirect status — may need explanation
        (status_code in REDIRECT_CODES)
    )

    if not needs_tier2:
        # Tier 1 result is definitive — return without any API call
        return t1_result

    # Tier 2: Haiku triage
    t2_result = tier2_check(snapshot)

    if not t2_result.get("needs_tier3", False):
        # Haiku determined no semantic judgment needed
        return t2_result

    # Tier 3: Sonnet for semantic judgment
    return tier3_check(snapshot)
</code></pre>
<p>The router logic is explicit and readable. Each decision point is a named condition. When <code>tiered=False</code>, behavior is identical to the v1 naive implementation — this is the backward compatibility guarantee that lets you add the cost curve incrementally without breaking existing audits.</p>
<h2 id="heading-graceful-fallback">Graceful Fallback</h2>
<p>The fallback pattern appears in both Tier 2 and Tier 3. It's worth making explicit:</p>
<pre><code class="language-python"># Pattern used in both tier2_check() and tier3_check()
except Exception as exc:
    logger.warning("[tierN] API error: %s — falling back to Tier 1 result", exc)
    fallback = tier1_check(snapshot)
    fallback["method"] = "tierN-fallback"
    return fallback
</code></pre>
<p>Three things this does:</p>
<ol>
<li><p>Logs the error with enough context to debug later</p>
</li>
<li><p>Returns a valid result — the Tier 1 deterministic check always runs regardless</p>
</li>
<li><p>Tags the result with the fallback method so you can filter these in your report</p>
</li>
</ol>
<p>An agent that crashes on API errors is not production-ready. An agent that degrades gracefully and continues is.</p>
<h2 id="heading-testing-the-cost-curve">Testing the Cost Curve</h2>
<p>Create <code>test_cost_curve.py</code> to verify routing behavior without live API calls:</p>
<pre><code class="language-python">import json
from unittest import mock

from cost_curve import audit_url, tier1_check


def make_snapshot(title="Normal Title Under 60 Chars",
                  description="A normal meta description that is under 160 characters and describes the page content well.",
                  h1s=["Single H1"],
                  canonical="https://example.com/page",
                  status_code=200,
                  final_url="https://example.com/page"):
    return {
        "title": title,
        "meta_description": description,
        "h1s": h1s,
        "canonical": canonical,
        "status_code": status_code,
        "final_url": final_url,
    }


def test_clean_page_returns_tier1_no_api_calls():
    """Clean page: all checks pass deterministically — no API call."""
    snapshot = make_snapshot()
    with mock.patch("anthropic.Anthropic") as mock_client:
        result = audit_url(snapshot, tiered=True)
        assert result["method"] == "deterministic"
        mock_client.assert_not_called()
    print("PASS: clean page → Tier 1, zero API calls")


def test_long_title_returns_tier1_fail_no_api_call():
    """Title &gt;60 chars: FAIL from Tier 1, no API call."""
    snapshot = make_snapshot(title="A" * 70)
    with mock.patch("anthropic.Anthropic") as mock_client:
        result = audit_url(snapshot, tiered=True)
        assert result["method"] == "deterministic"
        assert result["title"]["status"] == "FAIL"
        mock_client.assert_not_called()
    print("PASS: title &gt;60 → Tier 1 FAIL, zero API calls")


def test_suspiciously_short_title_escalates_to_tier2():
    """Title present but 4 chars: escalates to Tier 2."""
    snapshot = make_snapshot(title="SEO")  # 3 chars — under AMBIGUOUS_TITLE_MAX
    mock_response = mock.MagicMock()
    mock_response.content = [mock.MagicMock(
        text='{"needs_tier3": false, "reason": "title is short but not ambiguous"}'
    )]
    with mock.patch("anthropic.Anthropic") as mock_client:
        mock_client.return_value.messages.create.return_value = mock_response
        result = audit_url(snapshot, tiered=True)
        assert result["method"] == "haiku"
        assert mock_client.return_value.messages.create.call_count == 1
    print("PASS: short title → Tier 2 (Haiku called once)")


def test_tiered_false_calls_sonnet_directly():
    """tiered=False: Sonnet called regardless of snapshot content."""
    snapshot = make_snapshot()  # clean page, would be Tier 1 in tiered mode
    mock_response = mock.MagicMock()
    mock_response.content = [mock.MagicMock(text=json.dumps({
        "url": "https://example.com/page",
        "final_url": "https://example.com/page",
        "status_code": 200,
        "title": {"value": "Normal Title Under 60 Chars", "length": 27, "status": "PASS"},
        "description": {"value": "desc", "length": 4, "status": "PASS"},
        "h1": {"count": 1, "value": "Single H1", "status": "PASS"},
        "canonical": {"value": "https://example.com/page", "status": "PASS"},
        "flags": [],
        "human_review": False,
        "audited_at": "2026-04-01T00:00:00+00:00",
    }))]
    with mock.patch("anthropic.Anthropic") as mock_client:
        mock_client.return_value.messages.create.return_value = mock_response
        result = audit_url(snapshot, tiered=False)
        assert result["method"] == "sonnet"
        assert mock_client.return_value.messages.create.call_count == 1
    print("PASS: tiered=False → Sonnet called directly")


def test_haiku_api_failure_falls_back_to_tier1():
    """Haiku failure: falls back to Tier 1 result, no crash."""
    snapshot = make_snapshot(title="SEO")  # triggers Tier 2
    with mock.patch("anthropic.Anthropic") as mock_client:
        mock_client.return_value.messages.create.side_effect = Exception("rate limit")
        result = audit_url(snapshot, tiered=True)
        assert result["method"] == "haiku-fallback"
    print("PASS: Haiku failure → fallback to Tier 1, no crash")


if __name__ == "__main__":
    test_clean_page_returns_tier1_no_api_calls()
    test_long_title_returns_tier1_fail_no_api_call()
    test_suspiciously_short_title_escalates_to_tier2()
    test_tiered_false_calls_sonnet_directly()
    test_haiku_api_failure_falls_back_to_tier1()
    print("\nAll tests passed.")
</code></pre>
<p>Run it:</p>
<pre><code class="language-bash">python test_cost_curve.py
</code></pre>
<p>Expected output:</p>
<pre><code class="language-plaintext">PASS: clean page → Tier 1, zero API calls
PASS: title &gt;60 → Tier 1 FAIL, zero API calls
PASS: short title → Tier 2 (Haiku called once)
PASS: tiered=False → Sonnet called directly
PASS: Haiku failure → fallback to Tier 1, no crash
</code></pre>
<h2 id="heading-applying-this-pattern-to-your-agent">Applying This Pattern to Your Agent</h2>
<p>The cost curve is not SEO-specific. Any agent with mixed-complexity tasks can use it.</p>
<p>The principle: classify tasks by what they actually require before deciding which model to invoke.</p>
<p><strong>Customer support agent:</strong></p>
<ul>
<li><p>Tier 1: keyword matching for known FAQ topics — no model</p>
</li>
<li><p>Tier 2: Haiku for intent classification on ambiguous queries</p>
</li>
<li><p>Tier 3: Sonnet for complex complaints requiring judgment</p>
</li>
</ul>
<p><strong>Code review agent:</strong></p>
<ul>
<li><p>Tier 1: lint rules, syntax checks — no model</p>
</li>
<li><p>Tier 2: Haiku for common pattern detection</p>
</li>
<li><p>Tier 3: Sonnet for architectural review</p>
</li>
</ul>
<p><strong>Content moderation agent:</strong></p>
<ul>
<li><p>Tier 1: blocklist matching — no model</p>
</li>
<li><p>Tier 2: Haiku for borderline cases</p>
</li>
<li><p>Tier 3: Sonnet for context-dependent judgment</p>
</li>
</ul>
<p>The implementation pattern is the same in all three cases. The <code>audit_url()</code> router becomes <code>route_task()</code>. The tier functions change their prompts and escalation conditions. The fallback logic stays identical.</p>
<p>The key question to ask before writing any agent code: what fraction of my inputs are mechanically solvable? That fraction goes to Tier 1. The rest escalate. The cost curve routes everything else.</p>
<h2 id="heading-wrapping-up">Wrapping Up</h2>
<p>The full implementation — including the SEO audit agent that uses this module in production — is at <a href="https://github.com/dannwaneri/seo-agent">dannwaneri/seo-agent</a>. The <code>core/</code> directory is MIT licensed. The tiered routing lives in <code>premium/cost_curve.py</code>.</p>
<p><em>This tutorial is the companion piece to</em> <a href="https://dev.to/dannwaneri/i-was-paying-0006-per-url-for-seo-audits-until-i-realized-most-needed-0-132j">I Was Paying \(0.006 Per URL for SEO Audits Until I Realized Most Needed \)0</a> <em>on DEV.to, which covers the architecture decisions behind the cost curve.</em></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Claude Code Essentials ]]>
                </title>
                <description>
                    <![CDATA[ Cluade Code can supercharge your software development. We just posted a full course on the freeCodeCamp.org YouTube channel that will teach you how to use Claude Code to build real-world agentic codin ]]>
                </description>
                <link>https://www.freecodecamp.org/news/claude-code-essentials-exampro/</link>
                <guid isPermaLink="false">69c5490d10e664c5dae3f95e</guid>
                
                    <category>
                        <![CDATA[ claude-code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Thu, 26 Mar 2026 14:56:13 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5f68e7df6dfc523d0a894e7c/3530a6a9-65d5-4c5c-9a89-0ac85cc2053a.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Cluade Code can supercharge your software development.</p>
<p>We just posted a full course on the <a href="http://freeCodeCamp.org">freeCodeCamp.org</a> YouTube channel that will teach you how to use Claude Code to build real-world agentic coding workflows. Andrew Brown from ExamPro developed this course.</p>
<p>You'll learn the core concepts of agentic coding and the agent loop. You'll also learn how to use the Claude Code CLI, sessions, and workflows. And finally you'll learn about tool usage, context handling, and real-world development patterns.</p>
<p>Here are the sections in the course:</p>
<p><strong>Introduction</strong></p>
<ul>
<li><p>Intro &amp; Meet your Instructor</p>
</li>
<li><p>Claude Code Essentials &amp; Guest Instructor</p>
</li>
</ul>
<p><strong>Core Concepts and Foundations</strong></p>
<ul>
<li><p>Agentic Coding Tools &amp; Comparisons</p>
</li>
<li><p>What is a Code Harness &amp; Claude Code?</p>
</li>
<li><p>The Agentic Loop: Tool Calls &amp; Models</p>
</li>
<li><p>Claude Modes &amp; Additional Resources</p>
</li>
<li><p>Subscription, Usage &amp; Auth Errors</p>
</li>
<li><p>System Requirements &amp; Doctor CLI</p>
</li>
<li><p>Install CLI: PowerShell, CMD, Linux &amp; VSC</p>
</li>
<li><p>Interactive Mode &amp; Ctrl+C</p>
</li>
<li><p>Auth Tokens, Stats &amp; Usage Limits</p>
</li>
<li><p>Sessions: Resume, Fork &amp; Context Commands</p>
</li>
<li><p>Compact, Clear, Rename &amp; Rewind</p>
</li>
<li><p>Status, Logout &amp; Usage Commands</p>
</li>
<li><p>ccusage &amp; API Key Setup</p>
</li>
<li><p>Cost Command &amp; Third-Party Providers</p>
</li>
<li><p>API Keys: Bedrock, Foundry &amp; Vertex AI</p>
</li>
<li><p>btw, Voice &amp; Export Commands</p>
</li>
<li><p>Claude Code Projects &amp; Scope</p>
</li>
<li><p>Status Line &amp; Session Data</p>
</li>
<li><p>Settings &amp; Permission Rules (Bash, MCP, WebFetch)</p>
</li>
<li><p>Permission Modes &amp; CLI/GUI Editing</p>
</li>
<li><p>Sandboxing &amp; Dangerous Scenarios</p>
</li>
<li><p>VIM Mode &amp; Model Configuration</p>
</li>
<li><p>Fast Mode &amp; Image Reasoning</p>
</li>
<li><p>Effort Command &amp; Headless Tasks</p>
</li>
<li><p>Escaping Logic &amp; Debug Mode</p>
</li>
<li><p>Dev Containers with Claude Code</p>
</li>
<li><p>Common Workflow Follow Along</p>
</li>
<li><p>Notification Hooks &amp; Security Hooks</p>
</li>
</ul>
<p><strong>Surfaces</strong></p>
<ul>
<li><p>Claude Code Surfaces: Desktop &amp; Web</p>
</li>
<li><p>Claude Chrome &amp; Browser Extensions</p>
</li>
<li><p>VS Code &amp; JetBrains IDE Integration</p>
</li>
<li><p>GitHub Actions &amp; Remote Control</p>
</li>
<li><p>Computing Follow Along</p>
</li>
</ul>
<p><strong>Advanced</strong></p>
<ul>
<li><p>Security Review &amp; Output Styles</p>
</li>
<li><p>Simplify Command &amp; Scheduling</p>
</li>
<li><p>Code Review &amp; Agent SDK</p>
</li>
<li><p>Persistent Context: Claude.md &amp; Rules</p>
</li>
<li><p>Claude Auto Memory &amp; Troubleshooting</p>
</li>
<li><p>Agent Skills: Activation, Scripts &amp; Dynamic Content</p>
</li>
<li><p>MCP with Claude Code &amp; GG</p>
</li>
<li><p>MCP Doom &amp; Playwright Integration</p>
</li>
<li><p>Sub-agents &amp; Multi-Agent Teams</p>
</li>
</ul>
<p>Watch the full course on the <a href="http://freeCodeCamp.org">freeCodeCamp.org</a> YouTube channel (12-hour watch).</p>
<div class="embed-wrapper"><iframe width="560" height="315" src="https://www.youtube.com/embed/brLhhkUqcn4" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ The Claude Code Handbook: A Professional Introduction to Building with AI-Assisted Development ]]>
                </title>
                <description>
                    <![CDATA[ "I have never enjoyed coding as much as I do today — because I no longer have to deal with the minutia." — Boris Cherny, Head of Claude Code, Anthropic This handbook is a complete, professional intro ]]>
                </description>
                <link>https://www.freecodecamp.org/news/claude-code-handbook/</link>
                <guid isPermaLink="false">69c44e2e10e664c5daf048d3</guid>
                
                    <category>
                        <![CDATA[ AI ]]>
                    </category>
                
                    <category>
                        <![CDATA[ claude-code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ handbook ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Vahe Aslanyan ]]>
                </dc:creator>
                <pubDate>Wed, 25 Mar 2026 21:05:50 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/f9a4a36f-875f-4937-b39b-13f41eab0a75.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <blockquote>
<p><em>"I have never enjoyed coding as much as I do today — because I no longer have to deal with the minutia."</em> — <strong>Boris Cherny</strong>, Head of Claude Code, Anthropic</p>
</blockquote>
<p>This handbook is a complete, professional introduction to Claude Code, Anthropic's AI-powered software development agent – and to the practice of building software with it.</p>
<p>Claude Code isn't a smarter autocomplete. It's an agent: a system that reads your codebase, reasons about what needs to be done, writes and edits files, runs commands, and works through a task from start to finish – with you directing it, verifying its output, and making the decisions that require judgment. It represents a meaningful shift in how software gets built, not an incremental improvement on what came before.</p>
<p>This handbook covers everything from installation and first sessions to parallel agent workflows, MCP integrations, and autonomous loops. It's organized to build competency progressively, as each chapter assumes you've read the previous ones. But it's also written to be a reference you return to as your practice develops. The goal is not to make you familiar with Claude Code. It's to make you capable with it.</p>
<h3 id="heading-what-you-will-learn">What You Will Learn</h3>
<p>By the end of this handbook, you'll be able to do things that previously required either years of engineering experience or a team:</p>
<ul>
<li><p><strong>Build real applications from scratch</strong> – not toy projects or tutorial reproductions, but working software you intend to deploy and use</p>
</li>
<li><p><strong>Stop waiting on developers</strong> – take ideas from concept to working prototype yourself, without depending on someone else's availability or budget</p>
</li>
<li><p><strong>Ship features in hours instead of weeks</strong> – structure sessions with Plan Mode, feature-by-feature building, and prompt discipline so Claude produces what you actually intended</p>
</li>
<li><p><strong>Keep projects alive across dozens of sessions</strong> – manage context windows and maintain continuity so you never lose progress or have to reconstruct context from scratch</p>
</li>
<li><p><strong>Connect your tools</strong> – link Claude Code to GitHub, Notion, Slack, Google Workspace, and other services via the Model Context Protocol (MCP) so you execute entire workflows from a single instruction</p>
</li>
<li><p><strong>Work like a team of one</strong> – run parallel agent workflows that produce the output of three or four engineers running simultaneously, without coordination overhead</p>
</li>
<li><p><strong>Avoid the mistakes that waste days</strong> – understand when and how to use autonomous loops safely, so you don't return to a session to find Claude has gone in the wrong direction for two hours</p>
</li>
<li><p><strong>Produce code you can stand behind</strong> – review and verify AI-generated output to a professional standard, so nothing ships that you do not actually understand and own</p>
</li>
</ul>
<p>If you have wanted to build software and kept hitting the same wall, this handbook is designed to remove it.</p>
<h3 id="heading-who-this-is-for">Who This Is For</h3>
<p>This handbook was written for anyone who intends to work with Claude Code seriously. The audience is broader than it might initially appear – the access barrier to software development is changing, and so is the definition of who should be able to build.</p>
<h4 id="heading-1-developers-who-want-to-operate-at-a-different-scale">1. Developers who want to operate at a different scale</h4>
<p>If you've been writing software for years, Claude Code is not a replacement for your skills – it's a multiplier. The developers getting the most from it aren't using it as an autocomplete tool. They're using it to run parallel sessions, delegate entire feature workstreams, maintain codebases that would have required a team, and ship at a rate that was previously impossible without additional headcount.</p>
<p>This handbook covers the practices – Plan Mode, context management, autonomous loops, Git worktrees – that separate professional-level Claude Code use from basic use.</p>
<h4 id="heading-2-founders-product-people-and-domain-experts-who-want-to-remove-one-specific-blocker">2. Founders, product people, and domain experts who want to remove one specific blocker</h4>
<p>Something important to understand before you read further: writing the code is a small fraction of what actually has to go right for a product to succeed. A working codebase doesn't produce users, doesn't validate a business model, doesn't guarantee product-market fit, and doesn't substitute for the judgment, distribution, and domain knowledge that determine whether software is actually useful to anyone.</p>
<p>Claude Code removes the coding barrier. That barrier was previously significant: for non-technical people, it was often the thing that made building impossible to begin. Removing it matters. But it's not the same as removing every other obstacle between you and a product that works in the world.</p>
<p>What does remain yours, fully, includes: understanding the problem you're solving, determining whether the solution is actually the right one, deciding what to build and in what order, talking to users, understanding why people would or would not use what you're building, and everything involved in getting it in front of the people it's meant for.</p>
<p>This handbook will get you from concept to working software. The rest – the part that actually makes that software valuable – is not a technical problem.</p>
<h4 id="heading-3-anyone-who-has-an-idea-they-have-been-unable-to-act-on">3. Anyone who has an idea they have been unable to act on</h4>
<p>If the thing that has blocked you is specifically the code – not the idea, not the market, not the distribution, but the code itself – then this handbook is for you. It removes that specific obstacle.</p>
<p>It won't remove the others. The expectation going in should be accurate: this gives you a working application faster than was previously possible, not a shortcut to a successful product.</p>
<p>No prior programming experience is required to begin – but prior experience will make the journey faster. What is required in either case is the willingness to engage seriously with what Claude Code produces: to read it, question it, verify it, and direct it toward what you actually need.</p>
<h3 id="heading-why-this-skill-matters">Why This Skill Matters</h3>
<p>People are drawn to Claude Code and AI-assisted development because it unlocks opportunities that were previously unavailable. The ability to build software – to take an idea from concept to working product – has historically required years of training, a funded team, or both. That barrier is changing rapidly.</p>
<p>This is not a tool that will make human judgment irrelevant. AI will automate a great deal, but not everything. The world is too interconnected, too complex, and too dependent on human creativity, domain expertise, and judgment for complete automation to be possible.</p>
<p>There are things beyond writing code that keep the world functioning, and that will remain true. But for the act of building software – bringing your own ideas to life as working applications – Claude Code is genuinely transformative.</p>
<p>As of early 2026, Claude Code authors 4% of all global GitHub commits. Engineers at Spotify have not written code manually since December. Anthropic's own team ships 10–30 pull requests per day per engineer, every one generated by Claude. This is the current state – not a projection.</p>
<p>The skill of directing, evaluating, and building with AI tools is already one of the most valuable capabilities a professional can hold. That value will increase, not decrease, as AI becomes more capable. The developers, builders, and thinkers who build fluency with tools like Claude Code now will carry a structural advantage as the field advances.</p>
<h2 id="heading-table-of-contents">Table of Contents</h2>
<ol>
<li><p><a href="#heading-chapter-1-the-context-that-made-claude-code-necessary">Chapter 1: The Context That Made Claude Code Necessary</a></p>
</li>
<li><p><a href="#heading-chapter-2-anthropic--background-and-purpose">Chapter 2: Anthropic — Background and Purpose</a></p>
</li>
<li><p><a href="#heading-chapter-3-the-claude-model-family">Chapter 3: The Claude Model Family</a></p>
</li>
<li><p><a href="#heading-chapter-4-what-claude-code-is">Chapter 4: What Claude Code Is</a></p>
</li>
<li><p><a href="#heading-chapter-5-why-the-development-community-required-this">Chapter 5: Why the Development Community Required This</a></p>
</li>
<li><p><a href="#heading-chapter-6-installation-and-initial-setup">Chapter 6: Installation and Initial Setup</a></p>
</li>
<li><p><a href="#heading-chapter-7-vs-code-and-the-claude-code-extension">Chapter 7: VS Code and the Claude Code Extension</a></p>
</li>
<li><p><a href="#heading-chapter-8-subscriptions-token-costs-and-usage">Chapter 8: Subscriptions, Token Costs, and Usage</a></p>
</li>
<li><p><a href="#heading-chapter-9-working-in-your-first-session">Chapter 9: Working in Your First Session</a></p>
</li>
<li><p><a href="#heading-chapter-10-prompt-discipline--inputs-determine-outputs">Chapter 10: Prompt Discipline — Inputs Determine Outputs</a></p>
</li>
<li><p><a href="#heading-chapter-11-planning-as-a-core-practice">Chapter 11: Planning as a Core Practice</a></p>
</li>
<li><p><a href="#heading-chapter-12-building-feature-by-feature">Chapter 12: Building Feature by Feature</a></p>
</li>
<li><p><a href="#heading-chapter-13-how-claude-code-actually-works">Chapter 13: How Claude Code Actually Works</a></p>
</li>
<li><p><a href="#heading-chapter-14-architecting-applications-well-with-claude-code">Chapter 14: Architecting Applications Well with Claude Code</a></p>
</li>
<li><p><a href="#heading-chapter-15-plan-mode-edit-mode-and-operational-modes">Chapter 15: Plan Mode, Edit Mode, and Operational Modes</a></p>
</li>
<li><p><a href="#heading-chapter-16-context-windows-and-session-management">Chapter 16: Context Windows and Session Management</a></p>
</li>
<li><p><a href="#heading-chapter-17-mcp-servers-and-external-integrations">Chapter 17: MCP Servers and External Integrations</a></p>
</li>
<li><p><a href="#heading-chapter-18-agents-sub-agents-and-parallel-workflows">Chapter 18: Agents, Sub-Agents, and Parallel Workflows</a></p>
</li>
<li><p><a href="#heading-chapter-19-skills-rules-and-persistent-instructions">Chapter 19: Skills, Rules, and Persistent Instructions</a></p>
</li>
<li><p><a href="#heading-chapter-20-autonomous-loops--conditions-for-use">Chapter 20: Autonomous Loops — Conditions for Use</a></p>
</li>
<li><p><a href="#heading-chapter-21-code-review-security-and-verification">Chapter 21: Code Review, Security, and Verification</a></p>
</li>
<li><p><a href="#heading-chapter-22-starter-project-blueprints">Chapter 22: Starter Project Blueprints</a></p>
</li>
<li><p><a href="#heading-chapter-23-the-current-frontier-of-claude-code">Chapter 23: The Current Frontier of Claude Code</a></p>
</li>
<li><p><a href="#heading-chapter-24-software-engineering-as-a-discipline">Chapter 24: Software Engineering as a Discipline</a></p>
</li>
<li><p><a href="#heading-chapter-25-a-structured-path-forward">Chapter 25: A Structured Path Forward</a></p>
</li>
</ol>
<h2 id="heading-chapter-1-the-context-that-made-claude-code-necessary">Chapter 1: The Context That Made Claude Code Necessary</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter1/1200/400" alt="Chapter 1 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Software development has historically been access-restricted. Building a working application like a web service, a data tool, or a user-facing product required either years of technical training or a funded team of engineers. The knowledge barrier was steep, the required time investment was significant, and the population of people who could build was correspondingly small.</p>
<p>This constraint began to erode with the emergence of large language models capable of generating functional code from natural-language descriptions. What started as an augmentation of individual developers has, within the span of a few years, become a structural transformation of how software is built.</p>
<p>As of early 2026, the scale of this shift is measurable and substantial, and its significance extends beyond productivity metrics. The ability to build software is becoming accessible to a broader range of people – not because the underlying complexity has been eliminated, but because much of the mechanical translation between intent and implementation can now be delegated to an AI agent.</p>
<p>What this unlocks, in human terms, is closer to what the printing press unlocked for written communication: a dramatic expansion of who can participate.</p>
<p>Boris Cherny frames it precisely: "I imagine a world where everyone is able to program. Anyone can just build software anytime." He draws the parallel to the printing press explicitly – a technology that transferred a capability previously held by a small, specialized group to the general population, and that preceded an explosion of human creative and intellectual output.</p>
<p>This handbook exists to help you become a capable participant in that transition.</p>
<h2 id="heading-chapter-2-anthropic-background-and-purpose">Chapter 2: Anthropic — Background and Purpose</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter2/1200/400" alt="Chapter 2 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Claude Code is a product of Anthropic. To understand the product fully, it's useful to understand the organization that built it.</p>
<h3 id="heading-founding-and-mission">Founding and Mission</h3>
<p>Anthropic was founded in 2021 by Dario Amodei, Daniela Amodei, and several colleagues who had previously worked at OpenAI. The founding motivation was not competitive positioning. It was a principled disagreement about how AI development should proceed.</p>
<p>The founders believed – and continue to believe – that building powerful AI systems without a rigorous, primary commitment to safety constitutes one of the most consequential risks humanity has introduced. Their response was to establish an organization whose central purpose is to develop AI capability and AI safety in parallel, treating the latter not as a constraint on the former but as an equal and inseparable objective.</p>
<p>Three of Anthropic's co-founders co-authored the <a href="https://arxiv.org/abs/2001.08361">original scaling laws paper</a>, one of the foundational documents of modern AI research. It describes mathematically how model capability scales with size and compute. These are people who understood the trajectory of AI capability before most of the industry had internalized it. Their choice to build an organization focused on safety reflects informed conviction, not just caution.</p>
<h3 id="heading-what-safety-means-in-practice">What Safety Means in Practice</h3>
<p>At Anthropic, safety research manifests across multiple layers. The deepest is <strong>mechanistic interpretability</strong>: the scientific effort to understand what is actually happening inside a model at the level of individual computational components.</p>
<p>This is not an abstract exercise. As Boris Cherny describes it:</p>
<blockquote>
<p>"We can identify a neuron related to deception. We are starting to get to the point where we can monitor it and understand that it's activating."</p>
</blockquote>
<p>This work informs how models are trained, how they're evaluated, and how they're deployed. It also shapes Claude Code directly. Before public release, Claude Code ran internally at Anthropic for four to five months, with behavior studied carefully before any external release. This was not a formality. It reflected genuine uncertainty about how an agentic AI system would behave in conditions that training-time evaluations cannot fully anticipate.</p>
<h3 id="heading-scale-and-influence">Scale and Influence</h3>
<p>By early 2026, Anthropic reached a valuation of over \(350 billion. Claude Code is reported to generate over \)2 billion in annual revenue and continues to accelerate: daily active users doubled in the month prior to this writing.</p>
<p>The company's models, particularly Claude Sonnet 4.6 and Claude Opus 4.6, are the current standard for serious AI-assisted software development across organizations from early-stage startups to the largest technology companies in the world.</p>
<h2 id="heading-chapter-3-the-claude-model-family">Chapter 3: The Claude Model Family</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter3/1200/400" alt="Chapter 3 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Claude Code is powered by Anthropic's Claude models. The models are the intelligence underlying the system. Claude Code provides the environment – the tools, the interface, the scaffolding – but the models determine the quality of reasoning, planning, and execution.</p>
<h3 id="heading-claude-sonnet-46">Claude Sonnet 4.6</h3>
<p>Claude Sonnet 4.6 is Anthropic's mid-tier model. It delivers strong performance across coding tasks – planning, implementation, debugging, documentation – at a meaningfully lower cost per token than Opus.</p>
<p>Sonnet 4.6 represents the inflection point at which Claude Code became broadly useful. Prior to this generation, models were capable but insufficiently reliable for production workflows. Sonnet 4.6 changed that, providing the reasoning depth required for real engineering work at a price accessible to individual developers and small teams.</p>
<p>For most development tasks of moderate complexity, Sonnet 4.6 is adequate. It handles single-feature implementations, debugging sessions, and documentation generation well. Where it reaches its limits (like in extended autonomous sessions, deeply architectural decisions, complex multi-step reasoning), Opus 4.6 becomes the appropriate choice.</p>
<h3 id="heading-claude-opus-46">Claude Opus 4.6</h3>
<p>Claude Opus 4.6 is Anthropic's most capable model. Research measuring its performance on real software engineering tasks found that it achieves a time horizon of approximately 14.5 hours at 50% task completion rate – meaning it can handle unattended work that would occupy a skilled engineer for most of a working day.</p>
<p>Boris Cherny uses Opus 4.6 exclusively, with maximum effort enabled, and never reduces capability to save tokens. His reasoning is precise:</p>
<blockquote>
<p>"Because a less capable model is less intelligent, it requires more tokens to do the same task. It is not obvious that using a cheaper model is actually cheaper. Often, the most capable model is cheaper and less token-intensive because it completes the task faster with less correction."</p>
</blockquote>
<p>Opus 4.6 is Anthropic's first ASL-3 class model – a designation in their safety classification framework applied to models of sufficient power that the most rigorous safety protocols are warranted before and after release.</p>
<h3 id="heading-claude-haiku">Claude Haiku</h3>
<p>Claude Haiku is Anthropic's lightest model that's fast, inexpensive, and suited to simple tasks: summarization, brief lookups, lightweight generation. For Claude Code work, Haiku is rarely the right choice. It lacks the reasoning depth required for meaningful software development.</p>
<h3 id="heading-model-selection-guide">Model Selection Guide</h3>
<table>
<thead>
<tr>
<th>Task Characteristics</th>
<th>Recommended Model</th>
</tr>
</thead>
<tbody><tr>
<td>Initial exploration, learning Claude Code</td>
<td>Sonnet 4.6</td>
</tr>
<tr>
<td>Moderate complexity development work</td>
<td>Sonnet 4.6</td>
</tr>
<tr>
<td>Complex architectural decisions</td>
<td>Opus 4.6</td>
</tr>
<tr>
<td>Extended autonomous sessions</td>
<td>Opus 4.6</td>
</tr>
<tr>
<td>Multi-agent parallel workflows</td>
<td>Opus 4.6</td>
</tr>
<tr>
<td>Simple lookups, trivial queries</td>
<td>Haiku</td>
</tr>
</tbody></table>
<p>The practical guidance is straightforward: if you can, don't select a model primarily based on cost. A less capable model that requires more correction cycles, more context clarification, and more tokens to reach an acceptable output frequently costs more in total than a more capable model that completes the task in fewer passes.</p>
<h2 id="heading-chapter-4-what-claude-code-is">Chapter 4: What Claude Code Is</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter4/1200/400" alt="Chapter 4 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Claude Code is an AI agent for software development. That definition requires unpacking.</p>
<h3 id="heading-the-distinction-from-conversational-ai">The Distinction from Conversational AI</h3>
<p>A conversational AI system – ChatGPT, Claude.ai in basic form, most early AI products – produces text in response to text. It can explain, summarize, translate, draft. It generates output that a human then acts upon. The AI does not itself act in the world.</p>
<p>Claude Code is categorically different. It is an <strong>agent</strong>: an AI system equipped with tools that allow it to act. In a Claude Code session, the model doesn't merely generate a code snippet and return it to you. It reads the files in your project, writes and modifies those files, executes terminal commands, installs packages, runs tests, searches the web, commits to version control, opens pull requests...the list goes on.</p>
<p>The distinction matters. When you engage Claude Code on a development task, you aren't prompting a text generator. You're directing an autonomous agent that can execute sequences of actions, make decisions about which tools to employ, and produce material results in your codebase.</p>
<h3 id="heading-the-agent-architecture">The Agent Architecture</h3>
<p>Most AI-powered development tools are built by constraining the model: defining rigid workflows, controlling what the model can see, specifying precisely which tools it can use in which sequence. This creates predictability at the cost of flexibility and capability.</p>
<p>Claude Code's architecture inverts this. As Boris Cherny describes it: "The product is the model." The approach is to expose the model as directly as possible, with a minimal set of tools and minimal scaffolding, and allow the model to determine the best approach for a given task. The model decides which tools to use, in what order, and how to combine them.</p>
<p>This approach trusts the model's judgment. With Claude Opus 4.6, that trust is warranted. The model can assess a complex problem, formulate a strategy, execute it using available tools, and adapt when it encounters unexpected conditions — without constant human intervention.</p>
<h3 id="heading-where-claude-code-runs">Where Claude Code Runs</h3>
<p>Claude Code is available across multiple surfaces:</p>
<ul>
<li><p>Terminal (Mac, Windows, Linux)</p>
</li>
<li><p>VS Code extension</p>
</li>
<li><p>Claude desktop application (Code tab)</p>
</li>
<li><p>Claude iOS and Android applications</p>
</li>
<li><p>GitHub integration (automated code review and PR management)</p>
</li>
<li><p>Slack integration</p>
</li>
</ul>
<p>The underlying agent is identical across all surfaces. The interface differs, but the capability does not.</p>
<p>This breadth is a deliberate expression of product philosophy: bring the tool to wherever people already work, rather than requiring people to adapt to a new environment. Boris describes this as "latent demand" – a principle that shaped both Claude Code's original terminal deployment and its subsequent expansion.</p>
<h3 id="heading-current-impact">Current Impact</h3>
<ul>
<li><p>4% of all global GitHub commits are authored by Claude Code (early 2026)</p>
</li>
<li><p>Projected to reach 20% of all commits by end of 2026</p>
</li>
<li><p>Anthropic's daily active users doubled in the preceding month</p>
</li>
<li><p>Engineering productivity at Anthropic has increased 200% since Claude Code adoption</p>
</li>
<li><p>100% of pull requests at Anthropic are reviewed by Claude before human review</p>
</li>
</ul>
<p>Boris describes the growth trajectory as still accelerating: "It's not just going up – it's going up faster and faster."</p>
<h2 id="heading-chapter-5-why-the-development-community-required-this">Chapter 5: Why the Development Community Required This</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter5/1200/400" alt="Chapter 5 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Claude Code did not emerge from a product strategy. It emerged from a genuine need in how software is built, and from an observation about where friction in that process actually lives.</p>
<h3 id="heading-the-mechanical-burden">The Mechanical Burden</h3>
<p>Professional software development involves significant mechanical work that has nothing to do with the intellectual challenge of building good systems. A large portion of a developer's day, in a typical codebase, involves:</p>
<ul>
<li><p>Looking up documentation for APIs whose syntax changes between versions</p>
</li>
<li><p>Writing authentication and authorization boilerplate for the hundredth time</p>
</li>
<li><p>Setting up database connections, environment configurations, REST endpoints</p>
</li>
<li><p>Decoding opaque error messages</p>
</li>
<li><p>Searching for solutions to problems that are, with near certainty, already solved somewhere</p>
</li>
<li><p>Writing tests for behavior whose correctness is already known</p>
</li>
<li><p>Managing dependency conflicts and breaking changes</p>
</li>
</ul>
<p>None of this is where engineering expertise is exercised. It is the overhead of translation: converting understanding into syntax, correct syntax, in the right files. Boris describes it as "the minutia" and "the tedious parts" – things that consumed time without demanding the faculties that matter.</p>
<p>Claude Code eliminates this overhead. The mechanical translation is handled by the agent. What remains for the engineer is the part that requires judgment: what to build, how to architect it, whether it is correct, whether it serves its purpose.</p>
<h3 id="heading-the-access-barrier">The Access Barrier</h3>
<p>Beyond the tedium experienced by professional developers, there is the structural barrier facing everyone else. Building functional software has required years of technical training. The ideas exist broadly. The capacity to execute them has been concentrated in a small technical population.</p>
<p>Claude Code redistributes that capacity. It doesn't eliminate the need for understanding and judgment (a point this handbook will return to repeatedly), but it dramatically lowers the threshold at which someone can produce working software. A product manager, a scientist, a business owner, a domain expert with a clear idea can now begin building in a way that was not previously available to them.</p>
<h3 id="heading-the-feedback-loop-problem">The Feedback Loop Problem</h3>
<p>Senior engineers frequently know exactly what they want but find it difficult to convey that precisely enough to produce it consistently. The distance between a specification and its implementation – what engineers call the specification gap – is one of the chronic sources of friction in engineering teams.</p>
<p>With Claude Code, that gap narrows substantially. The developer remains in the loop throughout, reviewing plans before they are executed, inspecting output as it is produced, redirecting when necessary. The feedback cycle collapses from days to minutes. Misalignments are caught early, when they are cheap to fix.</p>
<h2 id="heading-chapter-6-installation-and-initial-setup">Chapter 6: Installation and Initial Setup</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter6/1200/400" alt="Chapter 6 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>This chapter covers everything required to have Claude Code running on your machine from a position of zero prior configuration.</p>
<h3 id="heading-step-1-set-up-a-claude-account">Step 1: Set Up a Claude Account</h3>
<p>Before installing Claude Code, you will need an account on Claude.ai.</p>
<ol>
<li><p>Navigate to <strong>claude.ai</strong> in a browser</p>
</li>
<li><p>Select "Sign Up" and create an account using your email address</p>
</li>
<li><p>Confirm your email address</p>
</li>
<li><p>Your account is now active</p>
</li>
</ol>
<p>This account authenticates you across all Anthropic products, including Claude Code.</p>
<h3 id="heading-step-2-select-a-subscription-plan">Step 2: Select a Subscription Plan</h3>
<p>Claude Code requires a paid subscription. The available tiers as of 2026:</p>
<h4 id="heading-claude-pro-20-per-month">Claude Pro: $20 per month</h4>
<p>The Pro plan provides access to Claude's models with a daily usage limit. When you reach that limit, you wait until the following day to continue.</p>
<p>For someone beginning with Claude Code building small projects, learning the system, running sessions of moderate intensity, the Pro plan is sufficient. It isn't designed for sustained professional use, but it's an appropriate entry point.</p>
<h4 id="heading-claude-max-100-or-200-per-month">Claude Max: \(100 or \)200 per month</h4>
<p>The Max plan substantially increases or effectively removes usage limits. At the $200 tier, Anthropic's own team describes never encountering the usage ceiling under normal working conditions.</p>
<p>If Claude Code becomes a primary instrument in your workflow – which it will, if you use it consistently – the Pro plan will constrain you. Upgrade to Max when you begin hitting limits regularly.</p>
<p><strong>On the cost question</strong>: Claude Code at the \(20 tier represents a low threshold for access to something that materially changes what one person can build. The question is not whether the tool is worth the cost. The question is whether you will use it consistently enough to benefit from it. Begin at \)20. The answer will be evident within a few weeks.</p>
<h3 id="heading-step-3-access-the-installation-documentation">Step 3: Access the Installation Documentation</h3>
<p>Navigate to <strong>code.claude.ai</strong>. This is Anthropic's official installation hub for Claude Code. It provides:</p>
<ul>
<li><p>Installation commands for Mac and Linux (via npm)</p>
</li>
<li><p>Installation instructions for Windows (via PowerShell)</p>
</li>
<li><p>Links to IDE extensions</p>
</li>
</ul>
<p>If you are comfortable in a terminal, the single-line npm installation command is sufficient. If not, proceed to the VS Code method described in the following chapter.</p>
<h2 id="heading-chapter-7-vs-code-and-the-claude-code-extension">Chapter 7: VS Code and the Claude Code Extension</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter7/1200/400" alt="Chapter 7 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>For those without a prior terminal workflow, Visual Studio Code provides the most accessible entry point into Claude Code. This chapter covers that setup completely.</p>
<h3 id="heading-why-vs-code">Why VS Code</h3>
<p>Visual Studio Code is a free, open-source code editor distributed by Microsoft. It holds over 70% market share among developers and is the environment in which the majority of professional software development occurs today – not because it's technically superior to all alternatives, but because it is well-designed, extensible, and broadly supported.</p>
<p>The Claude Code extension for VS Code provides a graphical interface to the same underlying agent you would access through a terminal. Within this interface:</p>
<ul>
<li><p>Your project files are visible in a persistent sidebar</p>
</li>
<li><p>Claude's file edits appear in a diff view (additions in green, removals in red) before they are applied</p>
</li>
<li><p>You can review, approve, or reject individual changes</p>
</li>
<li><p>You can open any file Claude references directly from the Claude panel</p>
</li>
<li><p>The full terminal, if you need it, remains accessible</p>
</li>
</ul>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450372/nveiz5viekwzy0syue81.png" alt="Diff View of Proposed Edit" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>This environment is appropriate for any skill level. Experienced developers benefit from the tight integration. Those new to development benefit from the visibility, as it's always clear what Claude is doing and why.</p>
<h3 id="heading-installing-vs-code">Installing VS Code</h3>
<ol>
<li><p>Navigate to <strong>code.visualstudio.com</strong></p>
</li>
<li><p>Download the installer for your operating system</p>
</li>
<li><p>Run the installer and accept the default configuration at each step</p>
</li>
<li><p>Launch VS Code at completion</p>
</li>
</ol>
<h3 id="heading-installing-the-claude-code-extension">Installing the Claude Code Extension</h3>
<ol>
<li><p>In VS Code, locate the Extensions panel in the left sidebar. The icon resembles four squares, three arranged in an L with one offset</p>
</li>
<li><p>In the search field, enter <strong>Claude Code</strong></p>
</li>
<li><p>Select the official Anthropic extension and confirm it shows several million downloads</p>
</li>
<li><p>Click Install</p>
</li>
</ol>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450398/yfyweplqjhb8kp3j1ohp.jpg" alt="VS Code Extensions Search" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>When installation completes, a Claude Code icon will appear in the VS Code toolbar. This opens the Claude Code panel.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450364/zmtqp79kuujulnf5nohq.png" alt="Claude Code Icon in Activity Bar" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h3 id="heading-opening-a-project">Opening a Project</h3>
<p>Claude Code operates within a directory – a folder containing your project files. Before beginning, create a folder for your project and open it in VS Code:</p>
<ol>
<li><p>Create a new folder anywhere on your system</p>
</li>
<li><p>In VS Code: <strong>File → Open Folder</strong></p>
</li>
<li><p>Select and open the folder</p>
</li>
</ol>
<p>VS Code will display the (currently empty) folder in its sidebar. Claude Code will read from and write to this directory throughout your session.</p>
<p>Click the Claude Code icon. The Claude Code panel opens. You're ready to begin.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450369/lm22je4xc4dbzfw32z6o.png" alt="Empty Claude Code Side Panel" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h3 id="heading-initial-configuration">Initial Configuration</h3>
<p>The first time you open Claude Code, type <code>/model</code> to select which model you want to use. For initial sessions, Sonnet 4.6 provides a reasonable starting point.</p>
<p>Next, review permissions by typing <code>/permissions</code>. The default setting requires Claude to ask before modifying any file. This is appropriate until you are comfortable with how Claude operates.</p>
<p>You can type <code>/help</code> to see all available commands.</p>
<h2 id="heading-chapter-8-subscriptions-token-costs-and-usage">Chapter 8: Subscriptions, Token Costs, and Usage</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter8/1200/400" alt="Chapter 8 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Having a working understanding of token economics will help you make better decisions about how you use Claude Code.</p>
<h3 id="heading-what-tokens-are">What Tokens Are</h3>
<p>Every interaction with a Claude model consumes tokens. A token corresponds roughly to three-quarters of a word – so a prompt of 100 words and a response of 300 words represents approximately 530 tokens total.</p>
<p>Token consumption accumulates across a session. Each message you send, each response Claude generates, each file Claude reads – all of this is tokenized and counted. On subscription plans, this accumulated usage is measured against your plan's daily allowance.</p>
<h3 id="heading-where-token-consumption-accumulates">Where Token Consumption Accumulates</h3>
<p>Brief queries consume trivially few tokens. But the kind of work Claude Code is built for (reading through an existing codebase, planning a feature, implementing it, correcting course, running verification) can consume tens of thousands of tokens in a single session.</p>
<p>Advanced users running multiple parallel agents consume far more. Boris Cherny notes that some engineers at Anthropic spend hundreds of thousands of dollars monthly in token costs. For those devs, Claude Code has replaced what would otherwise require entire engineering teams.</p>
<p>For someone beginning, usage will be modest. Token costs at the Pro tier are not a practical concern during the learning phase.</p>
<h3 id="heading-the-cost-of-capability-reduction">The Cost of Capability Reduction</h3>
<p>As I mentioned above, Boris Cherny's advice on model selection addresses a counterintuitive point: using a less capable model to reduce token costs often increases total token consumption. A model with weaker reasoning requires more correction passes, generates more context clarification, and takes longer to converge on an acceptable result. The less capable model costs less per token and often costs more per task.</p>
<p>His recommendation: use the most capable model available. Currently, that is Opus 4.6. Reduce model capability only when performance requirements are demonstrably lower and the trade-off is understood.</p>
<p>The broader principle he articulates: "Don't try to optimize too early. Give engineers as many tokens as they need. At the point where something is proven and scaling, then optimize. Not before."</p>
<h3 id="heading-practical-guidance">Practical Guidance</h3>
<table>
<thead>
<tr>
<th>Profile</th>
<th>Plan</th>
</tr>
</thead>
<tbody><tr>
<td>Learning, initial projects</td>
<td>Pro ($20)</td>
</tr>
<tr>
<td>Regular personal development</td>
<td>Max ($100)</td>
</tr>
<tr>
<td>Professional, sustained use</td>
<td>Max ($200)</td>
</tr>
<tr>
<td>Team or API-level usage</td>
<td>Anthropic API (usage-based)</td>
</tr>
</tbody></table>
<p>The rule is this: begin at the plan that doesn't actively frustrate your usage. If you reach limits and want to continue, that's information. It means you have integrated the tool into your work. Upgrade at that signal.</p>
<h2 id="heading-chapter-9-working-in-your-first-session">Chapter 9: Working in Your First Session</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter9/1200/400" alt="Chapter 9 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>With Claude Code installed and a project directory open, the first session is an exercise in learning how the system communicates and responds.</p>
<h3 id="heading-beginning-simply">Beginning Simply</h3>
<p>The appropriate starting point is a project with immediately visible output. If you're new to software development, web projects are optimal: you write files, open a browser, and see the result directly. The feedback loop is fast and unambiguous.</p>
<p>A minimal first task might look like this:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393590/nhhwhgzaykgi1q2nfb2p.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Build a personal homepage. Include a name, a short biographical description,
and links to LinkedIn and Twitter. The design should be clean and dark-themed.
Use HTML and CSS only — no JavaScript frameworks.
</code></pre>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450366/t344t6vua9ttf6sfn3sq.png" alt="Claude Code with First Prompt" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Claude Code will:</p>
<ol>
<li><p>Assess the request and formulate a plan</p>
</li>
<li><p>Request permission to create the specified files (if operating in default mode)</p>
</li>
<li><p>Write the HTML and CSS files</p>
</li>
<li><p>Confirm what was produced</p>
</li>
</ol>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450385/qhsdyrglgtex4ffd9sic.png" alt="Claude Code Plan Mode Output" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Open the resulting <code>index.html</code> file in a browser. Assess whether it meets your intent. Where it does not, state precisely what needs to change. This cycle – prompt, output, assessment, refinement – is the fundamental working method.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450376/repz9nmalciyupzxw4p2.gif" alt="Generated index.html File visible" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h3 id="heading-learning-through-iteration">Learning Through Iteration</h3>
<p>Proficiency with Claude Code develops through use, not through reading. Each each cycle of prompt, output, and refinement builds judgment about how to specify intent clearly, how to evaluate Claude's output, and how to correct course efficiently.</p>
<p>This is not unique to AI tools. It's how expertise in any instrument develops. Begin with modest scope, observe closely, and adjust. The speed at which fluency develops is proportional to how actively you engage with each result rather than accepting or rejecting it without analysis.</p>
<h2 id="heading-chapter-10-prompt-discipline-inputs-determine-outputs">Chapter 10: Prompt Discipline — Inputs Determine Outputs</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter10/1200/400" alt="Chapter 10 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>The relationship between prompt quality and output quality is direct and consistent. This is not a limitation of Claude Code. Rather, it's a property of any system that must translate intent into action. The more precisely intent is expressed, the more accurately it can be executed.</p>
<h3 id="heading-the-core-principle">The Core Principle</h3>
<p>Poor results from Claude Code are almost never attributable to model incapability. They are attributable to underspecified prompts. When Claude produces something that doesn't match what you wanted, the correct diagnostic question is: <em>was my specification sufficient to produce what I wanted?</em></p>
<p>In most cases, it was not.</p>
<p>Claude operates on what it receives. If you provide an abstract description of a product, Claude fills the gaps with its own reasonable assumptions. Where those assumptions deviate from your expectations – and they will – the output disappoints. The gap is not between what Claude can do and what you need. It is between what Claude knew and what it needed to know.</p>
<h3 id="heading-what-specification-requires">What Specification Requires</h3>
<p>Effective prompts are specific, contextual, and feature-oriented. Consider the difference:</p>
<p><strong>Underspecified:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393596/srkxpcu3yws6bzdrw6vs.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Build a task management app.
</code></pre>
<p><strong>Adequately specified:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393602/y6w7wajcdonsziuxl9d4.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Build a task management application for a three-person team. Requirements:

1. Tasks have a title, optional description, due date, and priority level (low, medium, high)
2. Each task can be assigned to one of three hardcoded users: Alice, Bob, or Carol
3. Tasks can be marked complete, with the completion timestamp recorded
4. The task list can be filtered by assignee or by priority
5. All data persists in localStorage — no backend required
6. Interface: clean, light theme; no external CSS frameworks

Technology: HTML, CSS, vanilla JavaScript only.
</code></pre>
<p>The second version closes all the significant decision points Claude would otherwise resolve by assumption. It produces a result substantially closer to intent on the first pass.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450389/zxcbnirpxy8mezetgqbt.png" alt="Underspecified vs Well-Specified Prompt" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h3 id="heading-explicit-over-implicit">Explicit Over Implicit</h3>
<p>State what you want Claude to do even when it seems obvious. If you want Claude to examine documentation before writing code, say so. If you want specific library versions, specify them. If you want no changes to existing files, make that explicit. If you want a particular file structure, describe it.</p>
<p>Implicit expectations are expectations that are frequently not met. Explicit instructions are instructions that are consistently followed.</p>
<h3 id="heading-the-specificity-standard">The Specificity Standard</h3>
<p>A practical test: if a competent engineer read your prompt with no other context, could they build exactly what you have in mind? If not, the prompt is not yet specific enough.</p>
<p>This standard is useful because it surfaces the actual gaps: the decisions you haven't yet made, the constraints you haven't yet articulated, the behavior you haven't yet defined. Filling those gaps before Claude begins building is far more efficient than discovering them in the output.</p>
<h2 id="heading-chapter-11-planning-as-a-core-practice">Chapter 11: Planning as a Core Practice</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter11/1200/400" alt="Chapter 11 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Planning is the highest-leverage activity in Claude Code development. It's also the most commonly underinvested.</p>
<h3 id="heading-why-planning-determines-outcomes">Why Planning Determines Outcomes</h3>
<p>A well-specified plan, reviewed and approved before any code is written, produces three effects:</p>
<ol>
<li><p>Claude invests its reasoning in the right problem</p>
</li>
<li><p>Misalignments between intent and approach are caught before they are embedded in code</p>
</li>
<li><p>The resulting implementation is coherent, because it follows a coherent design</p>
</li>
</ol>
<p>Without adequate planning, Claude makes architectural and implementation decisions autonomously, based on what it infers from limited input. Some of those decisions will be correct. Some will not. Discovering which ones were wrong after the codebase has been built around them is expensive. It requires reading, understanding, and correcting code that was generated at significant token cost.</p>
<p>The ratio of planning time to development time that produces optimal outcomes is higher than most people initially expect. Thirty minutes of structured planning frequently reduces a ten-hour build to three hours. The mathematics are not subtle.</p>
<h3 id="heading-plan-mode">Plan Mode</h3>
<p>Claude Code includes a dedicated <strong>Plan Mode</strong>. In this mode, Claude reasons through the task and produces a structured plan – which files will be affected, what the implementation sequence will be, how data will flow, what edge cases need to be handled – without writing a single line of code.</p>
<p>You review the plan. You can question it, modify it, reject portions of it, or add constraints. Only when the plan reflects your actual intent do you release Claude to begin implementation.</p>
<p>Boris Cherny uses Plan Mode for approximately 80% of his sessions. The mechanism itself is disarmingly simple: a single sentence injected into the model's context: <em>"Please do not write any code yet."</em> That single instruction changes Claude's behavior from execution to structured reasoning.</p>
<p>To activate Plan Mode:</p>
<ul>
<li><p><strong>In the terminal</strong>: press Shift+Tab twice</p>
</li>
<li><p><strong>In VS Code or the desktop app</strong>: click the Plan Mode button in the interface</p>
</li>
</ul>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450384/jnx8iaptfvqh5gzp3hjz.png" alt="Plan Mode Button in VS Code" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>The discipline here is important: actually read the plan Claude produces. Don't approve it reflexively. The plan is the point at which you can intervene at minimum cost.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450374/sjhn2dk2tz2tdqouclte.png" alt="Example Plan Mode Detail" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h3 id="heading-the-product-requirements-document">The Product Requirements Document</h3>
<p>The formal output of a planning session is a <strong>Product Requirements Document</strong> (PRD). For individual projects, this need not be elaborate. It should contain:</p>
<ol>
<li><p>A clear statement of what is being built and for whom</p>
</li>
<li><p>A specific list of features, each described in behavioral terms</p>
</li>
<li><p>Technical requirements: technology stack, database, external APIs, browsers to support</p>
</li>
<li><p>Interface parameters: visual style, layout decisions, interaction model</p>
</li>
<li><p>Explicit criteria for what constitutes a feature being complete</p>
</li>
</ol>
<p>A <code>PRD.md</code> file at the project root, readable by Claude Code at the start of each session, provides consistent context that persists across sessions. The quality of this document directly determines the quality of every subsequent build session.</p>
<h3 id="heading-the-interview-approach">The Interview Approach</h3>
<p>A useful technique for generating a complete PRD is to instruct Claude to interview you about the project before planning anything:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393607/bxif8vtof8hna3cppgmh.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">I want to build [project description]. Before writing any plan or code,
please use the Ask User Question tool to interview me systematically —
covering technical requirements, feature specifications, UI decisions,
data model, and any trade-offs I should consider.
Do not proceed to planning until the interview is complete.
</code></pre>
<p>This surfaces decisions you may not have consciously formulated. Some questions will have obvious answers. Others will reveal gaps in your own thinking – gaps you would prefer to close before they manifest as incorrect implementation decisions.</p>
<h2 id="heading-chapter-12-building-feature-by-feature">Chapter 12: Building Feature by Feature</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter12/1200/400" alt="Chapter 12 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>A planned project is built incrementally. You should resist the instinct to attempt complete implementation in a single pass. Feature-by-feature development isn't slower – it's more reliable, more verifiable, and ultimately faster.</p>
<h3 id="heading-the-case-for-incremental-development">The Case for Incremental Development</h3>
<p>Each feature implemented is a unit of behavior that can be verified independently. If Feature 2 is built on top of Feature 1 without verifying Feature 1, defects compound. A flaw in the foundation propagates upward, embedding itself in everything built above it. Discovering that flaw late multiplies the cost of correcting it.</p>
<p>Each verified feature is also a stable platform from which the next feature can be built with confidence. The accumulation of verified, working behavior is what a production system is.</p>
<p>There is also the matter of understanding. A developer who has watched – and reviewed – Claude build each feature, one at a time, understands how the system works. That understanding is necessary for directing effective corrections, making informed architectural decisions, and explaining the system to others.</p>
<h3 id="heading-the-build-cycle">The Build Cycle</h3>
<p>For each feature in the PRD:</p>
<ol>
<li><p><strong>Specify the feature in detail.</strong> Provide the feature description and any supplemental context: files that will be involved, constraints on implementation, acceptance criteria.</p>
</li>
<li><p><strong>Enter Plan Mode and review the plan.</strong> Read Claude's proposed approach. Is it consistent with your design intent? Will it affect files it shouldn't touch? Is the data flow correct? Revise the plan if necessary.</p>
</li>
<li><p><strong>Approve and release to implementation.</strong> Once the plan is sound, release Claude to implement. Review the diff view for each file change.</p>
</li>
<li><p><strong>Test the feature.</strong> Manually exercise the feature's intended behavior. Deliberately test boundary conditions. Does it behave correctly when data is missing? When values are at their limits? When the user does something unexpected?</p>
</li>
<li><p><strong>Address any discrepancies.</strong> State precisely what is incorrect and ask Claude to correct it. Specificity in correction is as important as specificity in the original specification.</p>
</li>
<li><p><strong>Confirm and advance.</strong> When the feature works correctly, move to the next one.</p>
</li>
</ol>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450373/j2xawotofpz70wsumrvv.png" alt="Diff View of Single Feature Change" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h3 id="heading-appropriate-starting-projects">Appropriate Starting Projects</h3>
<p>If you're new to software development, the best initial projects are small, web-based, and produce immediately visible output. Examples:</p>
<table>
<thead>
<tr>
<th>Project</th>
<th>Rationale</th>
</tr>
</thead>
<tbody><tr>
<td>Personal homepage</td>
<td>Immediate visual feedback, single HTML/CSS file</td>
</tr>
<tr>
<td>Simple calculator</td>
<td>Concrete logic, verifiable output</td>
</tr>
<tr>
<td>Task list application</td>
<td>Multi-feature structure, foundational CRUD pattern</td>
</tr>
<tr>
<td>Static portfolio</td>
<td>Practical result, shareable immediately</td>
</tr>
<tr>
<td>Data display dashboard</td>
<td>Introduction to structured data and layout</td>
</tr>
</tbody></table>
<p>Web projects require no server configuration, no deployment setup, and no build pipeline. Open a browser, load a file, observe the result. The feedback cycle is as short as possible, which makes the learning cycle as short as possible.</p>
<h2 id="heading-chapter-13-how-claude-code-actually-works">Chapter 13: How Claude Code Actually Works</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter13/1200/400" alt="Chapter 13 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Understanding the mechanics of Claude Code at a technical level changes how you use it. When you know what's happening inside a session, you write better prompts, diagnose problems faster, and make better decisions about when to intervene and when to let the agent proceed.</p>
<h3 id="heading-the-agent-loop">The Agent Loop</h3>
<p>At its core, Claude Code operates as a <strong>reasoning loop</strong>. Every session, at every step, follows the same underlying cycle:</p>
<ol>
<li><p><strong>Receive input</strong>: a message from you, or the result of a previous tool call</p>
</li>
<li><p><strong>Reason</strong>: determine what action to take next</p>
</li>
<li><p><strong>Select a tool</strong>: choose which capability to invoke</p>
</li>
<li><p><strong>Execute the tool</strong>: take the action</p>
</li>
<li><p><strong>Observe the result</strong>: receive what the tool returned</p>
</li>
<li><p><strong>Reason again</strong>: determine the next action given the new information</p>
</li>
<li><p><strong>Repeat</strong>: until the task is complete or input is required</p>
</li>
</ol>
<p>This cycle is not visible in the interface. You see messages and file edits. Internally, Claude is running through this loop many times per task: reading a file, thinking about what it implies, reading another file, forming a plan, writing a change, running a command to verify it, reading the output, and deciding whether to adjust.</p>
<p>The model is the reasoning engine. The tools provide the hands. The loop provides the structure.</p>
<h3 id="heading-how-tool-calls-work">How Tool Calls Work</h3>
<p>Claude Code has access to a specific set of tools. From the model's perspective, these are callable functions, each with a name, a set of parameters, and a return value.</p>
<p>When Claude decides to read a file, it doesn't "see" the file. It generates a structured tool call: <code>read_file(path="src/auth.js")</code>. The tool executes and returns the file's contents. Claude receives that content and continues reasoning.</p>
<p>The tools available to Claude Code include, in simplified form:</p>
<table>
<thead>
<tr>
<th>Tool</th>
<th>What It Does</th>
</tr>
</thead>
<tbody><tr>
<td><code>read_file</code></td>
<td>Returns the contents of a file as text</td>
</tr>
<tr>
<td><code>write_file</code></td>
<td>Writes content to a file, creating it if it does not exist</td>
</tr>
<tr>
<td><code>edit_file</code></td>
<td>Applies a specific change to an existing file</td>
</tr>
<tr>
<td><code>run_command</code></td>
<td>Executes a shell command and returns stdout and stderr</td>
</tr>
<tr>
<td><code>list_directory</code></td>
<td>Returns the file and directory structure of a path</td>
</tr>
<tr>
<td><code>search_files</code></td>
<td>Searches file contents for a pattern</td>
</tr>
<tr>
<td><code>web_search</code></td>
<td>Queries the web and returns results</td>
</tr>
<tr>
<td><code>ask_user</code></td>
<td>Pauses and requests input from you</td>
</tr>
<tr>
<td><code>browser</code></td>
<td>Opens a browser and interacts with a web page</td>
</tr>
</tbody></table>
<p>When Claude Code runs a test suite, it issues <code>run_command("npm test")</code>, receives the output, reads which tests failed, then uses <code>edit_file</code> to apply corrections. Then it runs the command again. When it is exploring an unfamiliar codebase, it issues <code>list_directory</code> to understand the structure before opening specific files.</p>
<p>This is why Plan Mode is so powerful: it lets Claude perform the reasoning portion of the loop – deciding which tools it would use, in what sequence, for what purpose – without actually executing those tools. You see the proposed sequence before anything happens.</p>
<h3 id="heading-how-claude-reads-a-codebase">How Claude Reads a Codebase</h3>
<p>When you open a project in Claude Code, Claude does not automatically read all your files. It reads selectively, on demand, as the loop requires.</p>
<p>A typical codebase exploration sequence:</p>
<ol>
<li><p>Claude issues <code>list_directory</code> on the root and sees the top-level folder structure</p>
</li>
<li><p>It identifies meaningful directories (<code>src/</code>, <code>app/</code>, <code>components/</code>, etc.) and reads those</p>
</li>
<li><p>For the specific task at hand, it reads the files most likely to be relevant: the component being modified, the service being called, the configuration being adjusted</p>
</li>
<li><p>If it encounters an import or reference to something it has not read yet, it reads that file too</p>
</li>
</ol>
<p>This selective, on-demand reading is efficient but has implications you should understand:</p>
<p>First, Claude's view of your codebase is always partial. At any given point in a session, Claude has read some of your files and not others. If something relevant exists in a file Claude has not read, Claude doesn't know about it.</p>
<p>This is why being explicit in your prompts matters: if a constraint or convention lives in a file Claude has not been asked to read, it will not apply that constraint unless you tell it to or point it to the file.</p>
<p>Second, the CLAUDE.md file is read first, always. Because of this, your <code>CLAUDE.md</code> is the most reliable place to encode conventions. It is the one piece of context Claude has before it reads anything else.</p>
<p>And finally, you can direct Claude's attention. In your prompts, you can name specific files: "Before implementing this feature, read <code>src/auth/middleware.js</code> and <code>src/db/schema.js</code>." Claude will read those files first, incorporate their content into its understanding, and apply that understanding to the task.</p>
<h3 id="heading-how-claude-assembles-context-for-each-step">How Claude Assembles Context for Each Step</h3>
<p>Each step of the loop constructs what is called a <strong>context</strong> – the full set of information the model receives before generating its next response. This context includes:</p>
<ul>
<li><p>The conversation history so far (your messages, Claude's responses)</p>
</li>
<li><p>The results of all tool calls in this session</p>
</li>
<li><p>The contents of any files Claude has read</p>
</li>
<li><p>The <code>CLAUDE.md</code> file (if present)</p>
</li>
<li><p>Any system-level instructions from Anthropic</p>
</li>
</ul>
<p>This entire assembled context is what the model "sees." There is no memory outside it. Nothing persists from one session to the next except what exists in files on disk.</p>
<p>This is why context management matters. A session with a long conversation history, multiple large file reads, and extensive tool output will have a full context by the time it reaches 40–50% of the window limit. The model reasons over everything in context simultaneously — when that window is too full, the model begins to weight recent inputs more heavily than earlier ones, and coherence with decisions made early in the session can degrade.</p>
<h3 id="heading-why-the-models-judgment-matters">Why the Model's Judgment Matters</h3>
<p>Because Claude Code's architecture exposes the model directly – without tight scripted workflows constraining what it can decide – the model must exercise genuine judgment at each step of the loop. It decides:</p>
<ul>
<li><p>Which files are worth reading given the task</p>
</li>
<li><p>Whether a plan needs adjustment based on what it discovered in a file</p>
</li>
<li><p>Whether a test failure is a real bug or a test that needs updating</p>
</li>
<li><p>Whether to ask you a question or make a reasonable assumption and proceed</p>
</li>
<li><p>When a task is genuinely complete vs. when further verification is warranted</p>
</li>
</ul>
<p>This is the practical meaning of "the product is the model." Claude Code's quality is the model's quality. The tools are consistent. The loop is consistent. What varies from one model generation to the next is the quality of reasoning at each decision point. And that is everything.</p>
<h2 id="heading-chapter-14-architecting-applications-well-with-claude-code">Chapter 14: Architecting Applications Well with Claude Code</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter14/1200/400" alt="Chapter 14 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Writing a prompt that produces a feature is one skill. Designing an application that Claude Code can build reliably, maintain coherently, and extend over time is another, deeper skill.</p>
<p>This chapter covers the structural principles that make Claude Code development efficient and the codebases it produces maintainable.</p>
<h3 id="heading-the-connection-between-structure-and-prompt-quality">The Connection Between Structure and Prompt Quality</h3>
<p>There is a direct relationship between how a codebase is organized and how well Claude Code can work within it. A well-structured codebase is one in which:</p>
<ul>
<li><p>Each file has a single, identifiable responsibility</p>
</li>
<li><p>File and directory names accurately reflect their contents</p>
</li>
<li><p>Dependencies between components flow in one direction</p>
</li>
<li><p>Configuration is separated from logic</p>
</li>
<li><p>External integrations are isolated in defined boundaries</p>
</li>
</ul>
<p>When a codebase has this kind of structure, Claude can read a small number of files to understand a given component, make targeted changes, and produce output that fits coherently with what already exists.</p>
<p>When a codebase is disorganized – logic mixed with presentation, files responsible for multiple unrelated things, dependencies tangled across layers – every change Claude makes requires reading more context to understand the system, and the probability of an unintended side effect increases. The prompts required become longer and more prescriptive. The review burden increases.</p>
<p>Good structure is not organization for its own sake. It is a productivity investment. A codebase that Claude Code can navigate efficiently is one that produces higher-quality output in fewer tokens.</p>
<h3 id="heading-the-single-responsibility-principle-applied">The Single Responsibility Principle, Applied</h3>
<p>The most important structural principle for Claude Code projects is also one of the most important in software engineering generally: each module should do one thing.</p>
<p>In practice, for a web application:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393613/nrgid48zdrowab0jqpmd.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">src/
  components/      — UI components: each component renders one thing
  services/        — Business logic: each service owns one domain
  api/             — HTTP handlers: each handler manages one route group
  db/              — Data access: each module owns one entity
  utils/           — Pure utility functions: no side effects, no state
  config/          — All configuration: no configuration scattered elsewhere
</code></pre>
<p>When you ask Claude to "add email validation to the signup form," Claude reads <code>components/SignupForm.jsx</code> (the component), <code>services/auth.js</code> (the auth logic), and possibly <code>utils/validation.js</code> (shared validators). Three files. Focused change. Clean result.</p>
<p>If signup logic were embedded in a single large <code>app.js</code> file with all other logic, Claude would need to read everything, reason about what to touch and what not to, and work in a context where a single misplaced edit can affect unrelated behavior. The change is the same – the cost of making it is not.</p>
<h3 id="heading-layer-separation-as-a-claude-code-multiplier">Layer Separation as a Claude Code Multiplier</h3>
<p>The pattern that consistently produces the best outcomes with Claude Code is a strict separation between layers of an application:</p>
<ol>
<li><p><strong>Presentation layer</strong>: what the user sees and interacts with. Components, pages, templates. No business logic. No data fetching beyond what the component directly needs.</p>
</li>
<li><p><strong>Business logic layer</strong>: what the application does. Services, use cases. No knowledge of the database interface. No UI-specific concerns.</p>
</li>
<li><p><strong>Data access layer</strong>: how data is stored and retrieved. Repository pattern or service layer specific to database interaction. No business logic. No presentation concerns.</p>
</li>
<li><p><strong>Integration layer</strong>: connections to external services (APIs, email providers, payment processors). Strictly isolated so that the rest of the system does not depend on the implementation details of external services.</p>
</li>
</ol>
<p>When these layers are enforced, both in the file structure and in the <code>CLAUDE.md</code> conventions, Claude Code respects them automatically. It knows that a feature touching the UI does not require changes to the data access layer. It knows that an email integration lives in one place and is called through a defined interface. Changes are targeted. Side effects are minimal. Reviews are coherent.</p>
<h3 id="heading-how-to-structure-a-new-project-for-claude-code">How to Structure a New Project for Claude Code</h3>
<p>When beginning a new project, spend time on the directory structure before asking Claude to write any code. Establish the structure, write the <code>CLAUDE.md</code>, and then begin feature implementation.</p>
<p>A practical sequence:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393619/pmst7xkmdo0cqcbboluu.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">1. Create the directory structure manually (or ask Claude to create it from a spec)
2. Write CLAUDE.md with: stack, conventions, layer rules, library choices
3. Create a PRD.md with the full feature list
4. Ask Claude to implement a skeleton — empty files in the right places,
   with the right imports and class/function signatures, but no real logic yet
5. Review the skeleton — is the structure right? — before building on it
6. Implement features one at a time into this established structure
</code></pre>
<p>Step 4 is particularly valuable: a skeleton gives you a complete view of the application's shape before any logic exists. Structural mistakes – like a component in the wrong layer, a misplaced dependency, a missing interface – are visible and cheap to fix. Once logic is written into the wrong structure, correcting the structure requires rewriting the logic too.</p>
<h3 id="heading-what-claude-codes-file-edits-tell-you-about-your-design">What Claude Code's File Edits Tell You About Your Design</h3>
<p>Pay attention to which files Claude touches when implementing a feature. Specifically:</p>
<p>If Claude is modifying more than 3–5 files for a single feature, the feature may not be coherently scoped, or the application structure may have too many dependencies between components.</p>
<p>If Claude is modifying the same files repeatedly across different features, those files are taking on too much responsibility.</p>
<p>If Claude asks clarifying questions before beginning, the specification was not complete enough or the existing structure is ambiguous about where the feature should live.</p>
<p>Each of these is a signal. Read it as information about the design, not as criticism of the instruction. Well-designed systems produce focused changes. Tangled systems produce sprawling changes.</p>
<h3 id="heading-naming-and-the-navigation-problem">Naming and the Navigation Problem</h3>
<p>Claude Code navigates your codebase by reading file and directory names, examining import statements, and searching for patterns. Names are therefore not cosmetic. They are structural.</p>
<p>A file named <code>utils.js</code> tells Claude almost nothing about what is inside it. A file named <code>validation.js</code>, <code>dateFormatters.js</code>, or <code>currencyUtils.js</code> tells Claude exactly where to look when it needs that functionality.</p>
<p>Enforce these naming standards in your <code>CLAUDE.md</code>:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393625/phsjtcs30y4eqgbfcdxq.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-markdown">## Naming Conventions

- Components: PascalCase, descriptive noun (UserProfileCard, TaskListItem)
- Services: camelCase, domain noun (authService, notificationService)
- Utilities: camelCase, descriptive of the concern (dateFormatters, currencyUtils)
- API handlers: camelCase, resource-oriented (userHandlers, taskHandlers)
- Test files: same name as the file being tested, with `.test.js` suffix
</code></pre>
<p>With these rules in <code>CLAUDE.md</code>, Claude will follow them consistently. Your code will be navigable, both by Claude in a session, and by developers (including yourself) returning to the project later.</p>
<h3 id="heading-defining-done-in-your-claudemd">Defining Done in Your CLAUDE.md</h3>
<p>One of the highest-value additions to any <code>CLAUDE.md</code> is a clear definition of what "done" means for a feature. Developers use different standards. Claude Code should use yours:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393631/nzg0zgbr3klbc5f70akz.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-markdown">## Definition of Done

A feature is complete when:

1. The specified behavior works correctly across all described scenarios
2. Edge cases identified in the specification are handled
3. All new functions have JSDoc comments
4. A corresponding unit test exists and passes
5. No linting errors are introduced
6. The feature works correctly at desktop and mobile viewport widths
</code></pre>
<p>With this definition present, Claude will not declare a feature finished when the happy path works and the edge cases have not been tested. It will complete all steps in the definition before telling you the task is done.</p>
<h2 id="heading-chapter-15-plan-mode-edit-mode-and-operational-modes">Chapter 15: Plan Mode, Edit Mode, and Operational Modes</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter15/1200/400" alt="Chapter 15 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Claude Code's operational modes govern how it behaves when executing a task. Understanding these modes prevents common errors and allows you to calibrate the level of oversight appropriate to your context.</p>
<h3 id="heading-plan-mode">Plan Mode</h3>
<p>We talked about this in detail in Chapter 11. Claude reasons – it doesn't write. Use it to begin any task of non-trivial complexity. The cost of a few minutes in Plan Mode is invariably lower than the cost of correcting a misaligned implementation.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450384/jnx8iaptfvqh5gzp3hjz.png" alt="Plan Mode Button Location" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h3 id="heading-ask-before-edits">Ask Before Edits</h3>
<p>This is the default mode. Before modifying any existing file or creating new ones, Claude presents the proposed change and requests explicit approval.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450382/vr7dzinokvwf2devzxkq.png" alt="Permissions Mode Selector Toggle" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>The presentation takes the form of a diff view: proposed additions displayed in green, proposed deletions in red. You can approve or reject each change individually.</p>
<p>This mode is appropriate whenever:</p>
<ul>
<li><p>You're working in an unfamiliar codebase</p>
</li>
<li><p>You're building something for the first time with Claude Code</p>
</li>
<li><p>The consequences of an incorrect edit are significant</p>
</li>
</ul>
<p>The overhead of reviewing and approving each change is not waste. It is learning. You understand what is being built because you have reviewed every element of it.</p>
<h3 id="heading-automatic-edit-mode">Automatic Edit Mode</h3>
<p>In this mode, Claude writes files without asking for approval between each change. This is appropriate only after you've used Plan Mode and you've reviewed and approved the plan. Once you've confirmed that Claude's approach is correct, there's no additional value in approving each individual file write – the strategy has already been established.</p>
<p>Boris describes the transition:</p>
<blockquote>
<p>"Once the plan looks good, I just let the model execute. I auto-accept edits after that. With Opus 4.6, it oneshots it correctly almost every time."</p>
</blockquote>
<p>Don't default to this mode. Earn it by developing confidence in your own plan review. Automatic edits without plan review is the condition in which errors most readily compound.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450388/l6gv5xs5nvty5znotidf.png" alt="Shift+Tab Shortcut for Plan Mode" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h2 id="heading-chapter-16-context-windows-and-session-management">Chapter 16: Context Windows and Session Management</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter16/1200/400" alt="Chapter 16 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Every Claude session operates within a context window, which is the total volume of information the model can hold simultaneously. When that window fills, older information is compressed or lost. Understanding this constraint is necessary for managing long sessions and multi-session projects effectively.</p>
<h3 id="heading-the-context-window">The Context Window</h3>
<p>For Claude Opus 4.6, the context limit is 200,000 tokens – equivalent to roughly 150,000 words, or approximately 200–300 pages of text.</p>
<p>In a long development session, this fills faster than it appears to. Reading a large codebase consumes tokens. A lengthy conversation accumulates them. Plans, implementations, test outputs, corrections – all tokenized, all counting toward the window.</p>
<p>The symptom of context saturation is drift: Claude begins making decisions inconsistent with constraints it established early in the session. It forgets architectural decisions. It reverts to default assumptions. If you notice this, the session has likely consumed most of its available context.</p>
<h3 id="heading-the-50-practice">The 50% Practice</h3>
<p>A working convention among experienced Claude Code users: when context usage reaches 40–50%, begin a new session. This is conservative enough to avoid the degradation zone and preserves clarity throughout the active session.</p>
<p>Claude Code displays context usage as a percentage. Monitor it during long sessions.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450370/v9gfdbzwt4pmkfgycecf.png" alt="Context Usage Percentage Indicator" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h3 id="heading-cross-session-continuity">Cross-Session Continuity</h3>
<p>Beginning a new session does not mean beginning from zero. Every file you have written, every architectural decision encoded in your codebase, and every convention documented in plain text is still on disk. Claude can read all of it fresh at the start of a new session. What it cannot do is recall the conversation that produced it. That context lives only in the session that created it.</p>
<p>The solution is to make your project self-documenting. When a project is properly documented, a new session can reach productive context in under a minute, without reconstruction from memory.</p>
<h4 id="heading-the-four-continuity-documents">The Four Continuity Documents</h4>
<p>The most effective approach uses four files, each serving a distinct purpose:</p>
<p><code>CLAUDE.md</code> <strong>— Project conventions and architecture context</strong></p>
<p>This file lives at the project root. Claude Code reads it automatically at the start of every session, before reading anything else. It is the most reliable channel for encoding project-level context that must always be present.</p>
<p>A well-maintained <code>CLAUDE.md</code> contains:</p>
<ul>
<li><p>Technology stack and why specific choices were made</p>
</li>
<li><p>Directory structure and what each major directory contains</p>
</li>
<li><p>Coding conventions (naming patterns, async style, error handling approach)</p>
</li>
<li><p>Library choices: what is used and what is explicitly prohibited</p>
</li>
<li><p>Layer rules (for example, "all database access goes through <code>db/repos/</code> – no SQL in route files")</p>
</li>
<li><p>Security requirements specific to this project</p>
</li>
<li><p>Definition of done for a completed feature</p>
</li>
</ul>
<p><code>PRD.md</code> <strong>— What is being built</strong></p>
<p>The Product Requirements Document defines the complete feature set in behavioral terms. It is the authoritative answer to "what should this system do." Claude reads the PRD at the start of any feature session to establish alignment between your intent and its implementation plan.</p>
<p>A PRD entry for a feature should include:</p>
<ul>
<li><p>Feature title and one-line description</p>
</li>
<li><p>Behavioral specification (what happens when X, what happens when Y)</p>
</li>
<li><p>Acceptance criteria: what must be true for this feature to be considered complete</p>
</li>
<li><p>Edge cases that must be handled</p>
</li>
</ul>
<p><code>README.md</code> <strong>— Current implementation status</strong></p>
<p>The README serves two purposes: it describes the project for anyone encountering it for the first time, and – for Claude Code purposes – it maintains a running record of what has been built and what remains. Update it as features are completed. A README with an accurate implementation status section allows a new session to pick up mid-project without needing a reconstruction conversation.</p>
<p>A practical status section looks like:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393637/cdmpj9cj5d4gvgkqxklc.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-markdown">## Implementation Status

### Completed

- [x] User authentication (JWT, register, login, logout)
- [x] Task creation and persistence (SQLite, full CRUD)
- [x] Task filtering by status and priority

### In Progress

- [ ] Email notification on task assignment (backend logic done; email provider integration pending)

### Remaining

- [ ] Team management (invite members, manage roles)
- [ ] Export to CSV
</code></pre>
<p><code>progress.md</code> <strong>— Session-level notes and decisions</strong></p>
<p>This is optional but valuable on longer projects. It serves as a journal: decisions made during development, approaches that were tried and rejected, open questions that require resolution, and notes on anything that will affect future implementation decisions.</p>
<p>Unlike the PRD (which is specification) and the README (which is completion status), <code>progress.md</code> captures the reasoning behind decisions — the things that would otherwise exist only in the chat history of a session that has since ended.</p>
<h4 id="heading-where-these-files-live">Where These Files Live</h4>
<p>All four files live at the project root: the top-level directory that Claude Code is working within. This is where Claude looks first when it reads a project.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393643/mavsc0sqzvg4dv79onf3.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">my-project/
  CLAUDE.md        ← read automatically every session
  PRD.md           ← read at the start of feature sessions
  README.md        ← updated as features complete
  progress.md      ← optional; captures decisions and open questions
  src/
    ...
</code></pre>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450386/p2inh8dukuomcei47llp.png" alt="Session Files in VS Code Sidebar" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h4 id="heading-how-claude-accesses-them">How Claude Accesses Them</h4>
<p>Claude Code reads <code>CLAUDE.md</code> automatically. For the other files, you provide an explicit instruction at the start of the session:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393649/deng8wquqaiqmvovwlft.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">New session. Read the following files in order:
1. CLAUDE.md
2. PRD.md
3. README.md (specifically the Implementation Status section)
4. progress.md

Confirm your understanding of the project state and tell me where we left off.
</code></pre>
<p>This instruction takes thirty seconds to write. Claude reads all four documents, synthesizes their content, and returns a summary of the project's current state. You correct any misunderstanding before proceeding. Then you begin the session from a position of shared, accurate context.</p>
<p>The discipline of maintaining these files – updating them as features complete, adding to <code>progress.md</code> when significant decisions are made – is the single most valuable habit you can build for multi-session projects. It costs minutes per session. It saves hours of reconstruction.</p>
<h2 id="heading-chapter-17-mcp-servers-and-external-integrations">Chapter 17: MCP Servers and External Integrations</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter17/1200/400" alt="Chapter 17 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>MCP (the <strong>Model Context Protocol</strong>) is Anthropic's open protocol for connecting AI agents to external tools, services, and systems. It was developed by the same team that built Claude Code and released as an open standard.</p>
<h3 id="heading-what-mcp-enables">What MCP Enables</h3>
<p>Out of the box, Claude Code can read and write files, execute terminal commands, and search the web. MCP extends this to include virtually any application or service that exposes a compatible interface.</p>
<p>When an MCP server is installed and connected, Claude Code gains the ability to act on that service directly – reading data from it, modifying data within it, triggering actions in it – without requiring any manual data transfer between Claude and the external system.</p>
<p>This is the difference between Claude handing you a LinkedIn post to publish manually and Claude publishing it directly, including scheduling and image attachment.</p>
<h3 id="heading-representative-mcp-applications">Representative MCP Applications</h3>
<p><strong>GitHub (included by default):</strong></p>
<ul>
<li><p>Opens pull requests directly from the Claude session</p>
</li>
<li><p>Reviews incoming PRs and adds inline comments</p>
</li>
<li><p>Monitors CI/CD failures and proposes corrections</p>
</li>
<li><p>No browser navigation required</p>
</li>
</ul>
<p><strong>Notion:</strong></p>
<ul>
<li><p>Reads project notes and specifications</p>
</li>
<li><p>Updates task status as work is completed</p>
</li>
<li><p>Creates documentation pages</p>
</li>
</ul>
<p><strong>Google Workspace:</strong></p>
<ul>
<li><p>Reads from and writes to Google Docs and Sheets</p>
</li>
<li><p>Composes and sends email via Gmail</p>
</li>
</ul>
<p><strong>Playwright (browser automation):</strong></p>
<ul>
<li><p>Opens a real browser session</p>
</li>
<li><p>Navigates to URLs and completes form interactions</p>
</li>
<li><p>Extracts structured data from web pages</p>
</li>
</ul>
<p><strong>Airtable / database integrations:</strong></p>
<ul>
<li><p>Reads from structured data sources</p>
</li>
<li><p>Writes results and updates records</p>
</li>
</ul>
<p>Boris uses Claude to pay parking fines, cancel subscriptions, send Slack messages, maintain project tracking spreadsheets, and send reminders to team members – all via plain English instructions to an agent that executes these tasks through connected MCP servers.</p>
<h3 id="heading-installing-an-mcp-server-step-by-step">Installing an MCP Server — Step by Step</h3>
<p>Installing an MCP server connects Claude Code to an external service. Here is a complete walkthrough using the Filesystem MCP server, one of the most broadly useful and a good one to install first.</p>
<h4 id="heading-step-1-find-the-mcp-server">Step 1: Find the MCP server</h4>
<p>Anthropic maintains an official registry of MCP servers at <a href="https://github.com/modelcontextprotocol/servers">github.com/modelcontextprotocol/servers</a>. Each server has an installation command and a configuration format. For third-party services, the service's own documentation will provide the MCP configuration.</p>
<h4 id="heading-step-2-install-the-server-via-claude-code">Step 2: Install the server via Claude Code</h4>
<p>Open a Claude Code session and type:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393655/dglv67rougyzxaepmxya.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Add the following MCP server at user scope so it is available across all my projects:

npx -y @modelcontextprotocol/server-filesystem /path/to/your/allowed/directory
</code></pre>
<p>The <code>user scope</code> flag means the server applies to all your projects — not just the current one. Use <code>project scope</code> if you want the server active only for the current directory.</p>
<h4 id="heading-step-3-provide-configuration-if-required">Step 3: Provide configuration if required</h4>
<p>Some MCP servers require API keys or configuration. For example, connecting to Notion:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393661/dtgik1lgmw5yomvugasw.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Add the Notion MCP server at user scope with the following configuration:
- Server package: @notionhq/notion-mcp-server
- API key: [your Notion integration token]
</code></pre>
<p>Claude Code writes the configuration to <code>~/.claude/mcp_settings.json</code> automatically. You do not need to edit this file manually.</p>
<h4 id="heading-step-4-restart-the-session">Step 4: Restart the session</h4>
<p>After installation, type <code>/restart</code> or close and reopen your Claude Code session. The MCP server initializes on startup. You can verify connected servers by typing:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393666/mgg7egyuirhygugxldjp.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">/mcp
</code></pre>
<p>This lists all active MCP servers and their available tools. If the server appears in this list, it is connected and available for Claude to use.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450378/gozp1kjn99oyqjz1r030.jpg" alt="MCP Command List Output" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h4 id="heading-step-5-use-it-in-a-session">Step 5: Use it in a session</h4>
<p>Once connected, you interact with the MCP-enabled service using plain English. Claude selects the appropriate MCP tool automatically:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393672/cyzkqmolfgyniyov2lxr.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Create a new Notion page in the "Projects" database titled "Sprint 14 Planning"
and add sections for Goals, Tasks, and Blockers.
</code></pre>
<p>Claude issues the appropriate Notion API call through the MCP server, creates the page, and returns the result – without you opening a browser.</p>
<h3 id="heading-practical-mcp-integrations">Practical MCP Integrations</h3>
<p><strong>GitHub: the most immediately valuable</strong></p>
<p>GitHub MCP is included in Claude Code by default and is worth using from your first day. Common usage:</p>
<ul>
<li><p>"Open a pull request for the feature branch <code>feature/auth-redesign</code> into <code>main</code>. Title: 'Auth: JWT token refresh'. Description: summarize the changes you made in this session."</p>
</li>
<li><p>"Review the open pull requests in this repository and tell me which ones have unresolved review comments."</p>
</li>
<li><p>"Check the CI pipeline status for the last commit on <code>main</code>."</p>
</li>
<li><p>"Create a GitHub Issue for the validation bug I just described and assign it to me."</p>
</li>
</ul>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450380/oqnjdsya3z969sahcvea.png" alt="GitHub MCP Action Executed" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p><strong>Playwright — for anything web-based</strong></p>
<p>Playwright gives Claude a real browser. Useful for:</p>
<ul>
<li><p>Extracting data from sites without public APIs</p>
</li>
<li><p>Testing your own deployed application by interacting with it as a user would</p>
</li>
<li><p>Completing multi-step web workflows (form submission, navigation, login)</p>
</li>
</ul>
<p>A practical example: "Go to our staging environment at staging.myapp.com, log in with the test credentials in <code>.env</code>, create a new task, and verify it appears in the task list."</p>
<p><strong>Slack</strong></p>
<ul>
<li><p>"Send a message to the #engineering channel: 'Auth service deployment is live. Monitor for errors over the next 30 minutes.'"</p>
</li>
<li><p>"Check the #bug-reports channel for any messages from the last 24 hours and summarize the issues reported."</p>
</li>
</ul>
<p><strong>Google Workspace</strong></p>
<ul>
<li><p>"Read the latest version of the Product Requirements in the 'Q2 Roadmap' Google Doc and create a Markdown version of it in PRD.md."</p>
</li>
<li><p>"Add a row to the 'Sprint Tracker' spreadsheet for today's date with columns: feature completed, time spent, issues encountered."</p>
</li>
</ul>
<p><strong>Filesystem Server</strong></p>
<p>The filesystem MCP extends Claude's file access beyond the current project directory. Useful for:</p>
<ul>
<li><p>Reading a reference implementation in another project directory</p>
</li>
<li><p>Accessing template files stored elsewhere on your machine</p>
</li>
<li><p>Writing output to a shared directory</p>
</li>
</ul>
<h3 id="heading-mcp-security-considerations">MCP Security Considerations</h3>
<p>MCP servers extend Claude Code's reach. This means they extend the potential impact of mistakes – or of malicious instructions – proportionally. A connected server can take real actions in real services. Treat that capability with corresponding care.</p>
<h4 id="heading-1-grant-only-the-access-required">1. Grant only the access required</h4>
<p>When configuring a filesystem MCP server, specify the directories it can access rather than granting root-level access. When configuring a Notion or Google Workspace server, use an integration token scoped to the specific pages or folders Claude needs – not a token that grants full account access.</p>
<h4 id="heading-2-review-before-executing">2. Review before executing</h4>
<p>When Claude proposes an action through an MCP server – particularly one that modifies data, sends messages, or affects production systems – read the proposed action before approving. A misunderstood instruction that creates twenty Notion pages or sends a Slack message to the wrong channel is recoverable. An action that deletes records from a production database may not be.</p>
<h4 id="heading-3-be-specific-in-your-instructions">3. Be specific in your instructions</h4>
<p>Vague instructions are more likely to produce unexpected actions through MCP. "Update the project tracker" is ambiguous. "Add a row to the Sprint Tracker sheet with today's date and the values X, Y, Z in columns B, C, D" is not. Precise instructions produce predictable actions.</p>
<h4 id="heading-4-do-not-store-credentials-in-prompts">4. Do not store credentials in prompts</h4>
<p>If Claude asks for an API key or authentication credential in order to configure an MCP server, provide it once during setup. Do not include live credentials in recurring prompts. Store them in the MCP configuration file, which Claude Code writes to your local machine's config directory.</p>
<h3 id="heading-starting-mcp-integrations">Starting MCP Integrations</h3>
<p>Connect MCP servers that correspond to tools you already use. There is no value in connecting services you don't work with. The value of MCP is in reducing friction in existing workflows, not in creating new ones.</p>
<p>Begin with GitHub. It is pre-configured, immediately useful, and demonstrates the core value of MCP within the first session you use it.</p>
<h2 id="heading-chapter-18-agents-sub-agents-and-parallel-workflows">Chapter 18: Agents, Sub-Agents, and Parallel Workflows</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter18/1200/400" alt="Chapter 18 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>As your competency with Claude Code develops and improves, the natural extension is parallel operation: multiple Claude sessions running simultaneously, each handling a distinct workstream.</p>
<h3 id="heading-parallel-session-structure">Parallel Session Structure</h3>
<p>A software project typically involves multiple independent workstreams that don't require sequential execution. Frontend implementation, backend logic, test coverage, documentation – these can often proceed in parallel without introducing conflicts, provided each session works on different files.</p>
<p>Multiple Claude Code sessions, each assigned a specific scope, replicate the parallel capacity of a small team. One session builds the authentication system. Another builds the data visualization layer. A third writes tests for features already completed. Each operates independently; all write to the same disk.</p>
<p>Boris Cherny operates with five or more parallel sessions routinely. His description of the workflow: "I kick off one task, then something else, then something else, and go get a coffee while they run."</p>
<h3 id="heading-running-parallel-sessions-a-concrete-example">Running Parallel Sessions — A Concrete Example</h3>
<p>Suppose you are building the notes application from Blueprint 4 in Chapter 25. You have completed the backend REST API and now want to build the frontend and write API tests simultaneously. Here is exactly how that works.</p>
<h4 id="heading-window-1-frontend-session">Window 1: Frontend session</h4>
<p>Open VS Code. Open the Claude Code panel. Type:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393678/i696fqkwfgfdtdn7n91x.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">We are building the frontend for the notes application. The backend REST API is
already running on port 3001. Your scope for this session is the client/ directory only.

Read CLAUDE.md and PRD.md first. Then implement the three-panel frontend layout
described in the PRD:
- Sidebar with the note list (read from GET /api/notes)
- Editor panel for the active note (with auto-save on keystroke debounce)
- Empty state when no note is selected

Do not touch any files in the server/ directory.

Enter Plan Mode first. Show me your implementation plan before writing anything.
</code></pre>
<h4 id="heading-window-2-test-suite-session">Window 2: Test suite session</h4>
<p>Open a second VS Code window (or a second terminal). Open a new Claude Code session. Type:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393685/m3vtzap5km1vanzg2dtp.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">We are writing integration tests for the notes application REST API. Your scope
for this session is the server/tests/ directory (create it if it doesn't exist).

Read CLAUDE.md and the server/routes/notes.js file. Write integration tests that
cover:
1. GET /api/notes — returns array, returns empty array when no notes exist
2. POST /api/notes — creates note, returns it with an id, rejects missing title
3. PUT /api/notes/:id — updates note, returns 404 for nonexistent id
4. DELETE /api/notes/:id — deletes note, returns 204, returns 404 if not found

Use the jest + supertest stack. Create server/tests/notes.test.js.

Do not modify any files outside server/tests/.
</code></pre>
<p>Both sessions now run simultaneously. Session 1 builds the frontend. Session 2 writes the tests. Neither touches the other's files. You review both when they complete.</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774450381/vcbjireiujfwhbwzuzcx.png" alt="Parallel Claude Code Sessions in VS Code" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<h4 id="heading-the-discipline-that-makes-this-safe">The discipline that makes this safe:</h4>
<p>Each session receives an explicit scope boundary ("your scope is the client/ directory only") and an explicit prohibition ("do not touch any files in the server/ directory"). These constraints prevent the primary failure mode of parallel sessions: two sessions modifying the same file in incompatible ways.</p>
<h3 id="heading-sub-agents">Sub-Agents</h3>
<p>Claude Code can spawn sub-agents internally – additional Claude instances dedicated to specific components of a larger task. This happens automatically when Claude determines that parallel execution of sub-tasks is appropriate.</p>
<p>For example: given the instruction "audit the entire codebase for security vulnerabilities," Claude may spawn sub-agents for different modules, each producing a findings report, which Claude then aggregates into a single document. You submit one instruction and receive one coherent result.</p>
<p>This capability scales with model capability. Opus 4.6 operates autonomous sessions for 10 to 30 minutes reliably. Extended sessions of hours or more are reported in advanced deployments.</p>
<h3 id="heading-git-worktrees-for-safe-parallel-development">Git Worktrees for Safe Parallel Development</h3>
<h4 id="heading-what-a-git-worktree-is">What a Git worktree is</h4>
<p>Normally, a Git repository has one working directory: the folder where your files live and where you make changes. A Git worktree is an additional working directory linked to the same repository. Each worktree checks out a different branch, and each has its own set of files on disk.</p>
<p>The result is that you can have multiple branches of the same repository active simultaneously, each in its own folder. A Claude Code session pointed at one folder sees only that branch's files. It cannot accidentally modify another branch's files because those files are in a different directory.</p>
<p>This is the cleanest available mechanism for running parallel agent sessions on a shared codebase.</p>
<h4 id="heading-setting-up-worktrees-for-parallel-agents">Setting up worktrees for parallel agents</h4>
<p>Say your main branch is <code>main</code> and you want two agents working in parallel – one on the authentication feature and one on the notification system.</p>
<p>Step 1: create a worktree for each feature branch:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393691/oss4btljrgqkcgo9gqnp.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-bash"># From the repository root on main
git worktree add ../my-project-auth feature/authentication
git worktree add ../my-project-notifications feature/notifications
</code></pre>
<p>This creates two new directories at the same level as your project root:</p>
<ul>
<li><p><code>../my-project-auth/</code> – a full copy of the repository, checked out to <code>feature/authentication</code></p>
</li>
<li><p><code>../my-project-notifications/</code> – a full copy, checked out to <code>feature/notifications</code></p>
</li>
</ul>
<p>Step 2: open each worktree in its own Claude Code session:</p>
<p>Open VS Code. Open <code>../my-project-auth</code> as the project folder. Start a Claude Code session scoped to the authentication feature.</p>
<p>Open a second VS Code window. Open <code>../my-project-notifications</code>. Start a Claude Code session scoped to notifications.</p>
<p>Both sessions run against the same repository but in isolated branches. File conflicts are impossible, as each session's changes live in a separate directory. When work is complete, you merge normally:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393696/ssh55mpqp8zboy9xt6vk.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-bash">cd my-project
git merge feature/authentication
git merge feature/notifications
</code></pre>
<h4 id="heading-when-to-use-worktrees">When to use worktrees</h4>
<p>Worktrees are appropriate when:</p>
<ul>
<li><p>You are working on a production codebase where conflicts are costly</p>
</li>
<li><p>Multiple sessions will be touching overlapping parts of the directory structure</p>
</li>
<li><p>You need clean version history with each feature isolated on its own branch</p>
</li>
</ul>
<p>They aren't necessary for simpler parallel sessions with clearly bounded scopes. A single working directory, divided among sessions by explicit file-scope instructions, is sufficient for most work. When a branch's work is complete and verified, it's merged into the main branch through the standard review process.</p>
<p>This requires familiarity with the Git workflow. It's not necessary at the beginning, but it becomes important as the scale and complexity of parallel workstreams increases.</p>
<h2 id="heading-chapter-19-skills-rules-and-persistent-instructions">Chapter 19: Skills, Rules, and Persistent Instructions</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter19/1200/400" alt="Chapter 19 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Claude Code can be given project-specific instructions that persist across sessions – applied consistently without requiring re-specification in each new conversation. These are called <strong>Skills</strong> (in Anthropic's terminology) or, more simply, <strong>rules</strong>.</p>
<h3 id="heading-what-persistent-instructions-accomplish">What Persistent Instructions Accomplish</h3>
<p>Every project has standards: how files are named, what libraries are used and which are prohibited, what the testing coverage requirements are, how authentication must be implemented, what the database access patterns are. These standards exist to ensure that the codebase remains coherent across contributions, sessions, and time.</p>
<p>Without persistent instructions, you re-specify these standards in each session. With them, Claude knows the project's conventions from the moment a session begins. The quality of output aligns with your standards without requiring constant specification.</p>
<h3 id="heading-the-claudemd-file">The CLAUDE.md File</h3>
<p>The primary mechanism for persistent instructions is a file named <code>CLAUDE.md</code> at the project root. Claude Code reads this file at the start of every session.</p>
<p>A well-written <code>CLAUDE.md</code> contains:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393702/jivygbd7c53gsgp7tv6m.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-markdown"># Project: [Name] — Claude Context

## Architecture

[Technology stack, infrastructure, auth mechanism, external services]

## Conventions

- [Naming conventions]
- [File organization]
- [Async patterns — e.g., always async/await]
- [Data access patterns — e.g., all DB calls through service layer]

## Libraries

[What is used, what is prohibited]

## Testing

[Framework, coverage requirements, testing patterns]

## Security

[Specific security requirements — credential handling, input sanitization specifics]

## Definition of Done

[What constitutes a completed feature before it can be marked complete]
</code></pre>
<p>With this file in place, every Claude session for this project begins with full knowledge of the codebase's standards. You don't need to repeat yourself. The codebase doesn't drift from its own conventions.</p>
<h3 id="heading-ecosystem-level-skills">Ecosystem-Level Skills</h3>
<p>Organizations and platforms are beginning to publish standardized Skills. These are pre-written instruction sets that encode best practices for building on their platforms. Vercel has launched this initiative for their hosting and deployment platform, enabling Claude Code to make correct deployment decisions without explicit guidance.</p>
<p>This represents a direction in which the ecosystem will develop further: a library of verified, platform-specific instruction sets that any developer can include in their project, encoding decades of accumulated engineering judgment into Claude's available context.</p>
<h2 id="heading-chapter-20-autonomous-loops-conditions-for-use">Chapter 20: Autonomous Loops — Conditions for Use</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter20/1200/400" alt="Chapter 20 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>Autonomous loop operation – where Claude Code executes a task sequence without human approval between steps – is frequently discussed and frequently misapplied. This chapter describes the conditions under which it is appropriate and the conditions under which it is not.</p>
<h3 id="heading-the-structure-of-a-loop">The Structure of a Loop</h3>
<p>In autonomous operation, Claude Code receives a task list and works through it sequentially without pausing for approval. It makes decisions, encounters obstacles, adapts, and continues. The human observer reviews the aggregate output, not individual steps.</p>
<p>The efficiency gain is real. A well-constructed loop running against a well-specified task list can accomplish hours of repetitive work – documentation, test generation, systematic refactoring – without human supervision.</p>
<h3 id="heading-the-compounding-risk">The Compounding Risk</h3>
<p>A loop amplifies both the quality of its instructions and the defects within them. If a misunderstanding exists in the task specification, the loop will execute all subsequent tasks consistently with that misunderstanding. The error doesn't self-correct. It accumulates.</p>
<p>This is why loops are inappropriate for ambiguous, underspecified, or creatively demanding tasks. The absence of human review between steps removes the checkpoints that catch drift early.</p>
<p>The practical advice from practitioners who have learned this: <strong>build without loops first</strong>. Develop a repertoire of projects in which you have reviewed each plan, approved each edit, and understood each output. Build the judgment needed to distinguish a well-specified task from an underspecified one. Only then introduce autonomous loops, and only for the class of tasks – well-bounded, repetitive, clearly defined – that they serve well.</p>
<h3 id="heading-tasks-where-loops-are-appropriate">Tasks Where Loops Are Appropriate</h3>
<ul>
<li><p>Adding documentation to a systematically defined set of functions</p>
</li>
<li><p>Generating tests for components with clear, specified behavior</p>
</li>
<li><p>Applying a defined refactor pattern across a consistent set of files</p>
</li>
<li><p>Running a specified analysis against a set of inputs and recording results</p>
</li>
</ul>
<h3 id="heading-tasks-where-loops-are-not-appropriate">Tasks Where Loops Are Not Appropriate</h3>
<ul>
<li><p>Building new features where scope or behavior is not fully defined</p>
</li>
<li><p>Architecture or design work requiring creative decision-making</p>
</li>
<li><p>Any task where the acceptability of the result is not specifiable in advance</p>
</li>
<li><p>Work in unfamiliar codebases where unexpected conditions are likely</p>
</li>
</ul>
<p>The loop is a tool for known problems. It is not a substitute for understanding or oversight.</p>
<h3 id="heading-what-an-autonomous-loop-looks-like-a-concrete-example">What an Autonomous Loop Looks Like — A Concrete Example</h3>
<p>The best way to understand the difference between a supervised workflow and an autonomous loop is to see the same task done both ways.</p>
<p><strong>The task:</strong> Add JSDoc documentation comments to every function in a codebase's <code>utils/</code> directory. There are twelve utility files, each containing between three and ten functions.</p>
<h4 id="heading-without-a-loop-supervised-step-by-step">Without a loop — supervised, step-by-step:</h4>
<p>You open a session and say:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393708/dle78koktlf7ay7iipw7.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Document all functions in utils/dateFormatters.js with JSDoc comments.
For each function, include: @param (name, type, description) for each parameter,
@returns (type, description), and a one-line @description.
Show me the diff before applying changes.
</code></pre>
<p>Claude produces the documentation, you review the diff, approve it. Then you repeat the process for <code>utils/currencyUtils.js</code>, and so on across all twelve files. You review every change as it happens.</p>
<p>This approach is appropriate when you are unfamiliar with the codebase, when the functions have unclear behavior that requires interpretation, or when you want to catch any misunderstanding early.</p>
<p>The cost: twelve back-and-forth cycles, each requiring your attention.</p>
<h4 id="heading-with-a-loop-autonomous-batch-execution">With a loop — autonomous, batch execution:</h4>
<p>You have already supervised several files and confirmed that Claude is interpreting the functions correctly and producing clean JSDoc. The pattern is clear, the behavior is consistent, and the same operation applies uniformly across all files. Now you introduce the loop:</p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393714/vf3ecksuqo7xeuyerojd.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">You are going to add JSDoc documentation to every function in the utils/ directory.

Rules:
- For each function, add: @description (one line), @param (name, type, description)
  for each parameter, and @returns (type, description)
- Do not change any logic — only add documentation comments
- Do not modify any files outside of utils/
- Process one file at a time, in alphabetical order
- After completing all files, output a summary: which files were modified,
  and how many functions were documented in total

Begin with utils/analyticsHelpers.js and proceed through all files in utils/
without stopping for approval between files. Apply changes to each file before
moving to the next.
</code></pre>
<p>Claude works through all twelve files autonomously. You review the aggregate output when it finishes: a summary of changes made, which you can verify with a <code>git diff</code>.</p>
<h4 id="heading-what-made-the-loop-safe-here">What made the loop safe here:</h4>
<ul>
<li><p>The task was repetitive and uniform – the same operation applied to each file</p>
</li>
<li><p>You had already verified Claude's judgment on a representative sample</p>
</li>
<li><p>The specification was complete – there was no ambiguity about what "done" meant for each function</p>
</li>
<li><p>The scope was bounded – "do not modify any files outside of utils/"</p>
</li>
<li><p>The operation was additive only – "do not change any logic"</p>
</li>
</ul>
<p>Change any of these conditions and the loop becomes riskier. An unfamiliar codebase, an ambiguous definition of done, or a task that requires creative judgment means supervised execution is the right approach.</p>
<h2 id="heading-chapter-21-code-review-security-and-verification">Chapter 21: Code Review, Security, and Verification</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter21/1200/400" alt="Chapter 21 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>The capabilities of Claude Code don't eliminate the requirement for verification. AI-generated code is held to the same standards as any other code. And those standards require review.</p>
<h3 id="heading-known-categories-of-failure">Known Categories of Failure</h3>
<p>Claude Code generates code based on patterns learned during training. Across a wide range of tasks, this produces correct, functional, secure output. In a defined set of conditions, it does not.</p>
<ol>
<li><p><strong>API hallucination</strong>: Claude may reference functions, parameters, or library versions that don't exist or have changed since its training data was collected. This is most common in libraries that evolve rapidly.</p>
</li>
<li><p><strong>Edge case omission</strong>: Claude generates implementations that handle the primary flow correctly and may not fully address boundary conditions – empty inputs, null values, network failures, malformed data.</p>
</li>
<li><p><strong>Security vulnerability introduction</strong>: Common vulnerability classes – SQL injection, inadequate input sanitization, insecure random number generation, improper credential handling – can be present in generated code that passes visual inspection. These require deliberate security review to detect.</p>
</li>
<li><p><strong>Confident incorrectness</strong>: Claude presents output with consistent confidence regardless of its correctness. The tone of a response is not a reliable indicator of its accuracy.</p>
</li>
</ol>
<h3 id="heading-the-verification-standard">The Verification Standard</h3>
<p>Here are some important ways you can review Claude's output to make sure it's up to your standards and security protocols:</p>
<ol>
<li><p><strong>Read the code.</strong> Not exhaustively, but substantively. Understand what each significant section does. Could you explain it? Is the logic consistent with your stated requirements?</p>
</li>
<li><p><strong>Test the behavior.</strong> Manually exercise the functionality. Test the primary flow. Test the edges. Does it behave correctly when inputs are missing? When values are at their extremes? When dependencies are unavailable?</p>
</li>
<li><p><strong>Use automated verification.</strong> Request that Claude generate tests for the code it writes. Ask for coverage that includes edge cases explicitly. Automated tests are not a substitute for code review, but they catch regressions systematically.</p>
</li>
<li><p><strong>Apply heightened scrutiny to sensitive domains.</strong> Authentication, authorization, payment processing, medical data handling, privacy-related data storage – these areas require security expertise and careful review beyond what automated checks provide.</p>
</li>
</ol>
<h3 id="heading-claude-code-security">Claude Code Security</h3>
<p>Anthropic has released <strong>Claude Code Security</strong>, a capability in preview as of 2026 that scans codebases for known vulnerability patterns and generates proposed corrections.</p>
<p>This represents the direction of security tooling: integrated, automated, and AI-assisted. For production systems, treat it as an additional layer, not a replacement for expert review.</p>
<h3 id="heading-the-continued-role-of-writing-code">The Continued Role of Writing Code</h3>
<p>Experience across the Claude Code community consistently confirms: developers who write some code themselves, rather than delegating all implementation, maintain significantly better understanding of their systems.</p>
<p>This understanding is not incidental. It's what allows correct review of Claude's output. It's what surfaces subtle errors that are invisible to anyone without domain knowledge. And it's what produces systems that remain maintainable when the context of their creation is no longer fresh.</p>
<p>Use Claude Code to eliminate mechanical overhead: the boilerplate, the repetitive patterns, the documentation that takes time but requires no judgment. Don't use it to replace engagement with the system you are building. That engagement is where your expertise lives, and where the quality of the system is ultimately determined.</p>
<h2 id="heading-chapter-22-starter-project-blueprints">Chapter 22: Starter Project Blueprints</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter22/1200/400" alt="Chapter 22 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>The following six project blueprints provide complete specifications – technology choices, directory structure, feature list, and implementation sequence – ready to hand directly to Claude Code. Each is designed for a specific stage of development competency and a specific class of use case.</p>
<p>These are not toy examples. They are real projects that produce genuinely useful software, chosen because they introduce important patterns in a controlled scope.</p>
<h3 id="heading-blueprint-1-personal-homepage">Blueprint 1: Personal Homepage</h3>
<p><strong>Appropriate for:</strong> Absolute beginners. First session with Claude Code.</p>
<p><strong>What it teaches:</strong> HTML/CSS file structure, dark-themed UI, responsive layout, link components.</p>
<p><strong>Technology:</strong> HTML5, CSS3, no JavaScript required.</p>
<p><strong>Directory structure:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393720/wq8ropa2ea8eclynuxym.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">my-homepage/
  index.html
  style.css
  assets/
    avatar.jpg       (add your own photo)
</code></pre>
<p><strong>Prompt to give Claude Code:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393726/djqbkd7bmtnj5kvekyo5.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Build a personal homepage. Specifications:

1. Single-page HTML/CSS site — no JavaScript, no frameworks
2. Sections: hero with name and one-line description, short bio (2–3 sentences),
   links section with icons for LinkedIn, GitHub, and Twitter/X, footer with year
3. Design: dark background (#0f0f13), light body text (#e2e2e2),
   accent color (#6366f1 — indigo), sans-serif typography (Inter via Google Fonts)
4. Responsive: readable and clean on both desktop and mobile
5. File structure: index.html and style.css only

Placeholder text is fine for bio — I will replace it. Use placeholder links (#)
for the social links — I will update them.

Enter Plan Mode first. Show me the plan before writing any files.
</code></pre>
<p><strong>What to verify after it builds:</strong></p>
<ul>
<li><p>Open in browser – does it look correct?</p>
</li>
<li><p>Resize the window to mobile width – does the layout adapt?</p>
</li>
<li><p>Check that all links exist (even as placeholders)</p>
</li>
<li><p>View the HTML source – can you understand the structure?</p>
</li>
</ul>
<h3 id="heading-blueprint-2-task-manager-with-localstorage">Blueprint 2: Task Manager with localStorage</h3>
<p><strong>Appropriate for:</strong> Early intermediate. First application with state and interactivity.</p>
<p><strong>What it teaches:</strong> JavaScript DOM manipulation, localStorage persistence, CRUD patterns, event handling, filtering.</p>
<p><strong>Technology:</strong> HTML5, CSS3, vanilla JavaScript. No dependencies. No build step.</p>
<p><strong>Directory structure:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393732/tqywok5nqxlyq0cvkl9j.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">task-manager/
  index.html
  style.css
  app.js
  components/
    TaskList.js
    TaskForm.js
    TaskFilter.js
  utils/
    storage.js      (localStorage read/write)
    dateUtils.js    (formatting helpers)
</code></pre>
<p><strong>Prompt to give Claude Code:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393739/gyjzmmlmvssxehfjbtxh.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Build a task manager application. Full specification:

FEATURES:
1. Create task: title (required), description (optional), due date,
   priority (Low / Medium / High)
2. Display tasks as cards in a list, sorted by due date ascending
3. Mark task complete — completed tasks display with strikethrough and 50% opacity
4. Delete task with confirmation
5. Filter tasks: by status (All / Active / Completed), by priority (All / Low / Medium / High)
6. All data persists in localStorage — survives page refresh

TECHNICAL REQUIREMENTS:
- Vanilla JavaScript, ES6 modules
- File structure as specified: index.html, style.css, app.js,
  components folder with TaskList.js / TaskForm.js / TaskFilter.js,
  utils folder with storage.js and dateUtils.js
- No external libraries, no frameworks, no build step
- storage.js must abstract all localStorage access — no other file reads/writes localStorage directly

DESIGN:
- Clean light theme, comfortable whitespace
- Cards with subtle shadow and hover state
- Priority levels: low = blue, medium = amber, high = red (use colored left border on card)
- Responsive for mobile and desktop

CLAUDE.md content to follow: all localStorage access through storage.js only.
No inline styles — all styling through style.css.

Enter Plan Mode. Show me the complete file tree and implementation plan
before writing anything.
</code></pre>
<p><strong>What to verify after it builds:</strong></p>
<ul>
<li><p>Create several tasks with different priorities and due dates</p>
</li>
<li><p>Verify they sort by due date correctly</p>
</li>
<li><p>Mark some complete – verify visual state</p>
</li>
<li><p>Refresh the page – verify data is preserved</p>
</li>
<li><p>Test filters – each combination should produce correct results</p>
</li>
<li><p>Delete a task – verify confirmation step works</p>
</li>
</ul>
<h3 id="heading-blueprint-3-api-connected-data-dashboard">Blueprint 3: API-Connected Data Dashboard</h3>
<p><strong>Appropriate for:</strong> Intermediate. First project involving an external API and dynamic data display.</p>
<p><strong>What it teaches:</strong> Fetch API, async/await, loading states, error handling, structured data display.</p>
<p><strong>Technology:</strong> HTML5, CSS3, vanilla JavaScript. Uses a free public API with no authentication required.</p>
<p><strong>The API used:</strong> Open-Meteo weather API (free, no key required).</p>
<p><strong>Directory structure:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393745/jzsddps0lpge4ajgqa92.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">weather-dashboard/
  index.html
  style.css
  app.js
  services/
    weatherApi.js   (all API calls isolated here)
  components/
    CurrentWeather.js
    ForecastCard.js
    LocationSearch.js
  utils/
    formatters.js   (unit conversion, date formatting)
</code></pre>
<p><strong>Prompt to give Claude Code:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393752/zaufqz8wlevyxx5w3jn6.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Build a weather dashboard using the Open-Meteo API (https://open-meteo.com).
No API key required. Full specification:

FEATURES:
1. Location search: user types a city name, app geocodes it using
   Open-Meteo's geocoding API and retrieves weather data
2. Current conditions display: temperature (Celsius), feels-like, humidity,
   wind speed, weather description with an icon (use Unicode weather emoji)
3. 7-day forecast: one card per day showing high/low temps and condition
4. Loading state: visible spinner while data is fetching
5. Error state: clear message if location not found or API fails
6. Last searched location persists in localStorage on refresh

TECHNICAL REQUIREMENTS:
- All API calls must go through services/weatherApi.js — no fetch() calls elsewhere
- Async/await throughout — no .then() chaining
- formatters.js handles all unit formatting and date display
- Graceful error handling: network failures and invalid locations display
  user-readable messages (never raw error objects)

API REFERENCE:
- Geocoding: https://geocoding-api.open-meteo.com/v1/search?name={city}&amp;count=1
- Weather: https://api.open-meteo.com/v1/forecast?latitude={lat}&amp;longitude={lon}
  &amp;current=temperature_2m,relative_humidity_2m,wind_speed_10m,weather_code
  &amp;daily=temperature_2m_max,temperature_2m_min,weather_code
  &amp;timezone=auto&amp;forecast_days=7

DESIGN: clean card-based layout, dark theme, readable type hierarchy.

Enter Plan Mode. Describe the complete data flow before writing code:
how a user search triggers the API chain and populates each component.
</code></pre>
<p><strong>What to verify after it builds:</strong></p>
<ul>
<li><p>Search for a known city – does it return weather data?</p>
</li>
<li><p>Search for a nonexistent place – does it show a clean error?</p>
</li>
<li><p>Disconnect your network and search – does it handle the failure gracefully?</p>
</li>
<li><p>Refresh the page – does the last location reload?</p>
</li>
</ul>
<h3 id="heading-blueprint-4-full-stack-notes-application">Blueprint 4: Full-Stack Notes Application</h3>
<p><strong>Appropriate for:</strong> Intermediate-advanced. First project with a real backend and database.</p>
<p><strong>What it teaches:</strong> Node.js/Express server, SQLite database, REST API design, client-server separation, CRUD at every layer.</p>
<p><strong>Technology:</strong> Node.js, Express, better-sqlite3 (synchronous SQLite binding), HTML/CSS/vanilla JS frontend served statically.</p>
<p><strong>Directory structure:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393758/ps1torwcxalytyefkn60.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">notes-app/
  server/
    index.js          (Express app setup)
    db/
      database.js     (SQLite connection and migrations)
      notesRepo.js    (all database queries for notes)
    routes/
      notes.js        (REST routes for /api/notes)
    middleware/
      errorHandler.js
  client/
    index.html
    style.css
    app.js
    services/
      notesApi.js     (all fetch calls to the backend)
    components/
      NoteEditor.js
      NoteList.js
  package.json
  .env
</code></pre>
<p><strong>Prompt to give Claude Code:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393765/beaxsh7tgrpbdxwitesg.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Build a full-stack notes application. Complete specification:

BACKEND (Node.js + Express + SQLite):
1. Express server running on port 3001
2. SQLite database via better-sqlite3 package
3. Notes table: id (integer primary key autoincrement), title (text),
   content (text), created_at (datetime), updated_at (datetime)
4. REST API:
   - GET /api/notes — return all notes, ordered by updated_at descending
   - GET /api/notes/:id — return single note
   - POST /api/notes — create note, return created note
   - PUT /api/notes/:id — update note, return updated note
   - DELETE /api/notes/:id — delete note, return 204
5. Database initialization: create table if not exists on server start
6. Error handling middleware: catch all unhandled errors, return JSON error response

FRONTEND (HTML/CSS/vanilla JS):
1. Three-panel layout: sidebar (note list), editor (active note), empty state
2. Click a note in the sidebar to open it in the editor
3. New Note button creates an empty note and opens it immediately
4. Auto-save: debounce saves to the API 1 second after the user stops typing
5. Delete button on active note with confirmation
6. Note list shows title and first line of content as preview, plus updated date

CONVENTIONS (enforce in CLAUDE.md):
- All database access through notesRepo.js — no SQL in route files
- All API calls through client/services/notesApi.js — no fetch() elsewhere in frontend
- All routes return JSON — no HTML from the API

Enter Plan Mode. Show me the complete architecture: how data flows
from the database through the API to the UI and back on save.
</code></pre>
<p><strong>What to verify after it builds:</strong></p>
<ul>
<li><p>Start the server: <code>node server/index.js</code></p>
</li>
<li><p>Create a note – does it appear in the sidebar?</p>
</li>
<li><p>Edit it – does it save automatically?</p>
</li>
<li><p>Restart the server – is the note still there?</p>
</li>
<li><p>Delete a note – is it removed from the list?</p>
</li>
<li><p>Test with the network tab open – are the API calls correct?</p>
</li>
</ul>
<h3 id="heading-blueprint-5-cli-automation-tool">Blueprint 5: CLI Automation Tool</h3>
<p><strong>Appropriate for:</strong> Developers with command-line comfort. Introduction to scriptable tools.</p>
<p><strong>What it teaches:</strong> Command-line argument parsing, file system automation, structured output, practical tooling.</p>
<p><strong>The tool built:</strong> A project scaffolding tool – given a project type argument, it generates a directory structure with starter files.</p>
<p><strong>Technology:</strong> Node.js, commander (CLI argument library), fs-extra.</p>
<p><strong>Directory structure:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393771/gxuynzrqdph12mptbd0u.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">scaffold-tool/
  src/
    index.js          (entry point, argument definitions)
    commands/
      create.js       (scaffold a new project)
      list.js         (list available templates)
    templates/
      web-basic/      (template directory structure)
      node-api/
      react-app/
    utils/
      fileSystem.js   (file/directory operations)
      logger.js       (colored console output)
  package.json
  README.md
</code></pre>
<p><strong>Prompt to give Claude Code:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393777/nhxfmsj2siaclpnpodk0.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Build a Node.js command-line scaffolding tool. Full specification:

PURPOSE: Running `scaffold create &lt;template-name&gt; &lt;project-name&gt;` generates
a new project directory with a starter file structure.

COMMANDS:
1. scaffold create &lt;template&gt; &lt;name&gt;
   - Creates a new directory named &lt;name&gt; in the current working directory
   - Copies the corresponding template into it
   - Replaces the placeholder {{PROJECT_NAME}} in all template files with &lt;name&gt;
   - Prints a success message with next steps
2. scaffold list
   - Lists all available templates with a one-line description of each

TEMPLATES TO INCLUDE (create each as an actual template directory with starter files):
- web-basic: index.html, style.css, app.js, README.md
- node-api: server.js, routes/index.js, package.json with express, README.md
- react-app: package.json with react/vite, src/App.jsx, src/main.jsx, index.html

TECHNICAL REQUIREMENTS:
- commander package for argument parsing
- fs-extra for file system operations (not native fs)
- All file/directory operations through utils/fileSystem.js
- Colored console output (green = success, red = error, blue = info)
- If the target directory already exists, exit with a clear error — do not overwrite
- Executable via `npx scaffold` (set up package.json bin entry)

Enter Plan Mode. Show me how the create command flow works
end-to-end before writing any files.
</code></pre>
<p><strong>What to verify after it builds:</strong></p>
<ul>
<li><p>Run <code>node src/index.js list</code> – are templates listed?</p>
</li>
<li><p>Run <code>node src/index.js create web-basic my-test-project</code> – does the directory appear?</p>
</li>
<li><p>Check that <code>{{PROJECT_NAME}}</code> was replaced throughout the generated files</p>
</li>
<li><p>Run the same command again – does it reject the duplicate?</p>
</li>
</ul>
<h3 id="heading-blueprint-6-internal-team-tool">Blueprint 6: Internal Team Tool</h3>
<p><strong>Appropriate for:</strong> Advanced intermediate. First project meant for real use by other people.</p>
<p><strong>What it teaches:</strong> User-facing product thinking, data validation, shared state, production-readiness concerns.</p>
<p><strong>The tool built:</strong> A team standup tracker – team members log daily standups (what they did, what they are doing, any blockers), and the tool displays a historical view per person.</p>
<p><strong>Technology:</strong> Node.js, Express, SQLite, vanilla JS frontend.</p>
<p><strong>Directory structure:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393784/hj4wwrqqms7wbfqnqioj.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">standup-tracker/
  server/
    index.js
    db/
      schema.sql      (initial table definitions)
      database.js
      repos/
        standupsRepo.js
        usersRepo.js
    routes/
      standups.js
      users.js
    middleware/
      validate.js     (input validation)
      errorHandler.js
  client/
    index.html
    style.css
    app.js
    services/
      api.js
    components/
      StandupForm.js
      TeamView.js
      PersonHistory.js
  package.json
</code></pre>
<p><strong>Prompt to give Claude Code:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393790/hwg1og2omaaocrnryafz.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Build a team standup tracker. Complete specification:

CONTEXT: A small team (3–10 people) uses this tool to log and view
daily standups. Each standup has three fields: yesterday, today, blockers.

DATABASE SCHEMA:
- users: id, name, email (unique), created_at
- standups: id, user_id (FK), date (date type, one per user per day),
  yesterday (text), today (text), blockers (text, nullable), created_at

BACKEND API:
- GET /api/users — list all users
- POST /api/users — create user (name + email, validate uniqueness)
- GET /api/standups?date=YYYY-MM-DD — all standups for a given date, with user data joined
- GET /api/standups/user/:userId — last 14 days of standups for one user
- POST /api/standups — submit standup (userId, date, yesterday, today, blockers)
  — if standup for that user+date already exists, update it (upsert)

FRONTEND:
- Default view: today's standups for the whole team, one card per person
- Each card: user name, their standup fields, time submitted (or "Not submitted" if absent)
- Date navigation: prev/next day buttons to browse historical dates
- Submit standup: user selects their name from a dropdown, fills three fields, submits
- If the user already submitted today, the form pre-fills their existing standup for editing

VALIDATION (enforce server-side via validate.js middleware):
- yesterday and today: required, non-empty, max 1000 characters
- blockers: optional, max 1000 characters
- date: must be a valid date, not in the future
- userId: must reference an existing user

CONVENTIONS (write into CLAUDE.md before starting):
- All DB access through repos/ — no SQL in route files
- All validation through validate.js middleware — no validation logic in route handlers
- Routes return consistent JSON: { data: ... } on success, { error: ... } on failure

Enter Plan Mode. This is a multi-file, multi-layer project. Show me
the complete plan — architecture, data flow, file list, implementation sequence —
before writing a single file.
</code></pre>
<p><strong>What to verify after it builds:</strong></p>
<ul>
<li><p>Create two or three users via the API (use a REST client or curl)</p>
</li>
<li><p>Submit standups for each – do they appear on the team view?</p>
</li>
<li><p>Navigate to yesterday – does it show an empty state correctly?</p>
</li>
<li><p>Submit a second standup for the same user and date – does it update rather than duplicate?</p>
</li>
<li><p>Submit with a missing "today" field – does the server reject it with a clear error?</p>
</li>
</ul>
<h3 id="heading-progression-through-the-blueprints">Progression Through the Blueprints</h3>
<p>These six projects exist on a deliberate progression:</p>
<table>
<thead>
<tr>
<th>Blueprint</th>
<th>Key Pattern Introduced</th>
</tr>
</thead>
<tbody><tr>
<td>1. Homepage</td>
<td>File structure, static HTML/CSS</td>
</tr>
<tr>
<td>2. Task Manager</td>
<td>JavaScript state, localStorage, component separation</td>
</tr>
<tr>
<td>3. API Dashboard</td>
<td>External API, async/await, loading and error states</td>
</tr>
<tr>
<td>4. Notes App</td>
<td>Backend + frontend, REST, database CRUD</td>
</tr>
<tr>
<td>5. CLI Tool</td>
<td>Command-line interfaces, templating, file system automation</td>
</tr>
<tr>
<td>6. Team Tool</td>
<td>Multi-user, validation layers, production-readiness</td>
</tr>
</tbody></table>
<p>Each blueprint uses the patterns from the previous ones and adds a new dimension. Building them in sequence produces a developer who has encountered and solved the fundamental problems in each tier of application architecture – which is the foundation from which Claude Code can be directed most effectively.</p>
<h2 id="heading-chapter-23-the-current-frontier-of-claude-code">Chapter 23: The Current Frontier of Claude Code</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter23/1200/400" alt="Chapter 23 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>The pace at which Claude Code's capabilities are evolving makes any description of "current" features provisional. What follows is an account of the frontier as of early 2026.</p>
<h3 id="heading-proactive-task-generation">Proactive Task Generation</h3>
<p>Claude Code is beginning to generate actionable suggestions based on observed project signals – not merely executing tasks specified by the developer, but identifying tasks that warrant attention.</p>
<p>Boris describes the current state: Claude reads Slack feedback threads, examines GitHub issue trackers, reviews telemetry data, and surfaces suggestions with associated pull requests: "Here are a few things I can do. I've put up a couple PRs. Want to take a look?"</p>
<p>The developer reviews, approves, and directs. But the initiative no longer flows exclusively in one direction. The agent is beginning to participate in the question of what should be built, not only in the execution of what has been decided.</p>
<h3 id="heading-beyond-software-development">Beyond Software Development</h3>
<p>Boris's assessment of the current state: "Coding is largely solved – at least the kind of coding I do." The frontier, accordingly, is expanding into adjacent domains.</p>
<p>The co-work product extends Claude Code's agentic capabilities – acting on tools, executing multi-step tasks, operating in browser environments – to general knowledge work. The target population is not only developers but anyone who works with digital tools: analysts, product managers, administrators, researchers.</p>
<p>For the development community, this expands the scope of what Claude Code can assist with beyond implementation into the full lifecycle of building a product: user research synthesis, product specification, market analysis, customer communication, project coordination.</p>
<h3 id="heading-build-for-the-model-six-months-ahead">Build for the Model Six Months Ahead</h3>
<p>Boris's most actionable strategic guidance for those building on Claude Code: "Build for the model six months from now, not for the model of today."</p>
<p>Tool use capability, session duration, autonomous operation reliability – these dimensions improve on a predictable trajectory. A workflow designed for today's capability limits will be underpowered six months from now. A workflow designed at the edge of near-future capability will be effective exactly when it matters.</p>
<p>This requires accepting that the current product experience may be slightly ahead of the current model's reliable range. That gap closes. The developers and organizations that have already built the workflows when the model catches up will have a structural advantage.</p>
<h2 id="heading-chapter-24-software-engineering-as-a-discipline">Chapter 24: Software Engineering as a Discipline</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter24/1200/400" alt="Chapter 24 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>This chapter addresses the question that underlies every chapter in this handbook: what does it mean to practice software engineering as an AI-assisted developer?</p>
<h3 id="heading-three-levels-of-engagement-with-software">Three Levels of Engagement with Software</h3>
<p>There are three main ways that software engineers engage with their projects:</p>
<ol>
<li><p><strong>Programming</strong> is the translation of logic into code. It requires knowledge of syntax, libraries, patterns. It is the mechanical layer.</p>
</li>
<li><p><strong>Software engineering</strong> is the design and construction of reliable, maintainable systems. It requires judgment about architecture, testing strategy, operational concerns, and the long-term consequences of current decisions. Code is the medium, and the system is the product.</p>
</li>
<li><p><strong>Software architecture</strong> is the discipline of making structural decisions that determine what a system can become. It requires the ability to translate complex requirements into design, and to anticipate how a system will need to evolve.</p>
</li>
</ol>
<p>Claude Code handles a significant portion of the programming layer. The engineering and architecture layers remain human responsibilities – and their importance, if anything, increases when the mechanical translation is delegated to an agent.</p>
<p>With Claude generating implementation rapidly, the quality of what gets built is almost entirely a function of the quality of the design guiding it.</p>
<h3 id="heading-what-remains-essential-to-learn">What Remains Essential to Learn</h3>
<p>So as a developer, what do you need to know these days? What should you focus on learning and improving?</p>
<h4 id="heading-how-systems-work">How systems work</h4>
<p>Understanding why a query index matters, what a foreign key constraint enforces, how a session token is validated, what a memory leak actually is – this knowledge is what allows you to direct Claude Code correctly and evaluate its output accurately. You don't need to implement these things by hand. You need to understand them.</p>
<h4 id="heading-why-design-decisions-exist">Why design decisions exist</h4>
<p>Separation of concerns, dependency inversion, input validation, layered access control aren't just bureaucratic conventions. They're solutions to recurring engineering problems. When you understand why a pattern exists, you can direct Claude to implement it correctly and catch deviations.</p>
<h4 id="heading-what-quality-looks-like">What quality looks like</h4>
<p>Readable code. Consistent behavior. Graceful error handling. Clear interfaces. Adequate test coverage. These evaluations require judgment that is developed through experience, and that judgment is what separates software that works from software that lasts.</p>
<h3 id="heading-taste-and-standard">Taste and Standard</h3>
<p>Boris speaks of "audacity and taste" as properties he looks for in the products his team builds – software that stops users in place, that solves a problem with an elegance that makes the solution feel inevitable. This standard cannot be delegated.</p>
<p>Taste is developed through sustained engagement with excellent work. Reading good software. Using well-designed products with a critical eye. Understanding what produces the feeling of quality, and being able to articulate that understanding precisely enough to direct Claude toward it.</p>
<p>The developers who produce remarkable software with Claude Code are not using it as a replacement for their own judgment. They are using it as an execution instrument for a vision that is entirely theirs.</p>
<h3 id="heading-originality-over-imitation">Originality Over Imitation</h3>
<p>Reproducing existing products – building another version of something that already exists – is a reasonable learning exercise. But it's a poor use of what Claude Code actually makes possible.</p>
<p>The barrier to building novel software has changed. A working prototype of a genuinely original idea can be produced in a weekend. The cost of exploring an unusual approach is dramatically lower than it was. The ability to try something that has never been tried, and to have a working version of it in hours, is new.</p>
<p>This creates an obligation to think more ambitiously about what to build, not to settle for the comfort of known ground. The question worth asking is not "what already exists that I could rebuild?" but "what should exist that does not?"</p>
<h2 id="heading-chapter-25-a-structured-path-forward">Chapter 25: A Structured Path Forward</h2>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://picsum.photos/seed/chapter25/1200/400" alt="Chapter 25 Header" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<p>This final chapter provides a concrete sequence for applying everything in this handbook.</p>
<h3 id="heading-beginning-this-week">Beginning This Week</h3>
<p>The learning begins with a real project: not an exercise, not a tutorial reproduction, but something you intend to exist and potentially to use.</p>
<p>The size should be minimal. A personal homepage. A simple tool for a specific personal workflow. A landing page for an idea you have been carrying. The constraint is that it be real – that its completion produces something with actual value to you.</p>
<p>A structured first week:</p>
<p><strong>Day 1:</strong> Install VS Code and the Claude Code extension. Configure your account. Ask Claude Code what it can do. Understand the interface.</p>
<p><strong>Day 2:</strong> Define your first project. Write down five specific features. Make them as concrete as you can. Don't begin building yet.</p>
<p><strong>Day 3:</strong> Use Plan Mode to discuss the project with Claude. Refine the plan until it reflects your intent accurately. Implement Feature 1.</p>
<p><strong>Day 4:</strong> Test Feature 1 until you are confident it works correctly. Implement Feature 2.</p>
<p><strong>Day 5:</strong> Refine the project. Ask Claude to review it against the original specification. Close any gaps.</p>
<p><strong>Day 6:</strong> Share the project with someone who can give you honest feedback. Note the gap between what you built and what would have been better.</p>
<p><strong>Day 7:</strong> Assess the week. What was harder than expected? Where did Claude's output surprise you? What would you do differently? What do you want to build next?</p>
<p>This cycle – one week, one small project, one complete iteration – produces more learning than any amount of reading about Claude Code.</p>
<h3 id="heading-the-development-sequence">The Development Sequence</h3>
<p>Competency with Claude Code develops in stages. The sequence that I've found to be most effective and reasonable is:</p>
<p><strong>Stage 1 — Orientation (Weeks 1–4)</strong>: Web-based projects. Single-feature scope. Emphasis on learning to communicate with Claude Code precisely and to evaluate its output critically.</p>
<p><strong>Stage 2 — Construction (Months 1–3)</strong>: Multi-feature projects. Introduction to databases, APIs, and multi-file architecture. Emphasis on planning discipline and feature-by-feature verification.</p>
<p><strong>Stage 3 — Professional Practice (Months 3–6)</strong>: Full-stack applications. Deployment and production considerations. Multi-session workflows. MCP integrations. Emphasis on reliability, security, and maintainability.</p>
<p><strong>Stage 4 — Advanced Operation (Months 6 and beyond)</strong>: Parallel agent workflows. Autonomous loops for defined tasks. Custom Skills and project-level configuration. Open-source contribution and team-level Claude Code integration.</p>
<p>Each stage depends on the previous one. The temptation to skip ahead produces gaps that become expensive later.</p>
<h3 id="heading-principles-for-continued-growth">Principles for Continued Growth</h3>
<p>Start by analyzing every unexpected output. When Claude produces something different from what you expected – better or worse – understand why. This is how your model of Claude's behavior becomes accurate and your prompting becomes precise.</p>
<p>Make sure you read and understand the code Claude writes. Not line by line, but substantively. Passive acceptance of output that you do not understand produces a codebase you cannot maintain, direct, or explain.</p>
<p>You should also study software that you consider excellent. The standard against which you direct Claude is the standard you can articulate. Develop that standard through sustained exposure to well-built systems.</p>
<p>And don't neglect to write some code yourself. Maintain active engagement with implementation. The judgment that comes from building directly is what makes your direction of Claude effective.</p>
<h3 id="heading-on-the-professional-implications">On the Professional Implications</h3>
<p>Boris Cherny's assessment of the professional landscape is direct: the role boundaries between software engineers, product managers, and designers are becoming less distinct.</p>
<p>The engineers, product managers, and designers on his team all write code. The value contributed by each is shifting from specialized technical execution toward the cross-disciplinary judgment that only comes from understanding the full system – user needs, technical constraints, business context, design quality.</p>
<p>His recommendation: cultivate breadth. The ability to reason across domains – to hold technical, product, and design considerations simultaneously – is what produces the most coherent decisions. AI handles the mechanical execution. The human provides the understanding.</p>
<p>The accumulation that matters is not the code you have written. It is the judgment you have developed through building real things, studying what others have built, and understanding the standards that separate work that endures from work that does not. That accumulation is not replicable by an AI agent. It is yours.</p>
<h2 id="heading-appendix-a-claude-code-command-reference">Appendix A: Claude Code Command Reference</h2>
<table>
<thead>
<tr>
<th>Command</th>
<th>Function</th>
</tr>
</thead>
<tbody><tr>
<td><code>/help</code></td>
<td>Display all available commands</td>
</tr>
<tr>
<td><code>/model</code></td>
<td>Select active model (Sonnet, Opus, Haiku)</td>
</tr>
<tr>
<td><code>/permissions</code></td>
<td>Review and modify Claude Code's permissions</td>
</tr>
<tr>
<td><code>/clear</code></td>
<td>Reset the current session context</td>
</tr>
<tr>
<td><code>Shift+Tab (×2)</code></td>
<td>Activate Plan Mode (terminal)</td>
</tr>
<tr>
<td><code>Ctrl+C</code></td>
<td>Interrupt the current operation</td>
</tr>
<tr>
<td><code>@filename</code></td>
<td>Reference a specific file in a prompt</td>
</tr>
<tr>
<td><code>/mcp</code></td>
<td>Manage connected MCP servers</td>
</tr>
</tbody></table>
<h2 id="heading-appendix-b-standard-prompt-templates">Appendix B: Standard Prompt Templates</h2>
<p><strong>Beginning a new feature:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393797/dhcsxet25nhqszhkveh9.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">I want to implement the following feature:

[Feature title]
[Behavioral specification from PRD]

Enter Plan Mode and show me your proposed approach before writing any code.
Include: files to be affected, implementation sequence, data flow, edge cases.
</code></pre>
<p><strong>Diagnosing a defect:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393802/dyprngdfillzhhp56gij.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">A defect exists with the following characteristics:

Expected behavior: [description]
Observed behavior: [description]
Steps to reproduce: [sequence]
Relevant files: [if known]

Diagnose the cause and propose a correction. Do not implement until I have
reviewed your diagnosis.
</code></pre>
<p><strong>Code review:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393808/zu6j4kuzge5bij6ihnge.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">Review the implementation you produced for [feature] against the following
criteria:

1. Are there edge cases not handled by the current implementation?
2. Are there security considerations that require attention?
3. Is the code readable and maintainable for someone encountering it without context?
4. Is error handling adequate for the failure modes this code may encounter?

Provide your assessment before I approve this feature as complete.
</code></pre>
<p><strong>Context loading for a new session:</strong></p>
<p><a href="https://www.lunartech.ai/download/the-ai-engineering-handbook"><img src="https://res.cloudinary.com/dc6qud7v9/image/upload/v1774393814/vsult5zqo2pgzj0now63.png" alt="Code Snippet" style="display:block;margin:0 auto" width="600" height="400" loading="lazy"></a></p>
<pre><code class="language-plaintext">New session. Begin by reading the following files in order:
1. PRD.md
2. CLAUDE.md
3. README.md

Confirm your understanding of the project's current state and identify
where we left off, so we can proceed without reconstructing context manually.
</code></pre>
<h2 id="heading-appendix-c-reference-material">Appendix C: Reference Material</h2>
<p><strong>Anthropic Documentation</strong></p>
<ul>
<li><p><a href="https://claude.ai">claude.ai</a> — Account management and Claude.ai access</p>
</li>
<li><p><a href="https://code.claude.ai">code.claude.ai</a> — Claude Code installation and official documentation</p>
</li>
</ul>
<p><strong>Foundational Reading</strong></p>
<ul>
<li><p><a href="http://www.incompleteideas.net/IncIdeas/BitterLesson.html">The Bitter Lesson</a> — Rich Sutton. Essential reading for understanding why general models outperform specialized systems.</p>
</li>
<li><p><a href="https://www.goodreads.com/book/show/39996759-a-philosophy-of-software-design">A Philosophy of Software Design</a> — John Ousterhout. The clearest account of what makes software maintainable.</p>
</li>
<li><p><a href="https://fundamentalsofsoftwarearchitecture.com/">Fundamentals of Software Architecture</a> — Mark Richards and Neal Ford. Practical treatment of architectural decision-making.</p>
</li>
</ul>
<p><strong>For Those New to Web Development</strong></p>
<ul>
<li><p><a href="https://www.theodinproject.com/">The Odin Project</a> — free, project-based curriculum</p>
</li>
<li><p><a href="https://www.freecodecamp.org/">freeCodeCamp</a> — free, structured curriculum</p>
</li>
</ul>
<p>Both provide sufficient foundation to understand what Claude Code is building and to evaluate its output critically.</p>
<h2 id="heading-closing">Closing</h2>
<p>This handbook was written in February 2026. The specifics of Claude Code – its features, its model capabilities, its interface – will continue to evolve. Some of what is written here will require updating within months.</p>
<p>The underlying principles will not.</p>
<p>The quality of what you build with Claude Code is determined by the quality of your planning, the precision of your communication, the rigor of your verification, and the clarity of your standards. These are properties of practice, not of tooling. They compound. They do not expire.</p>
<h3 id="heading-the-lunartech-fellowship-bridging-academia-and-industry">The LUNARTECH Fellowship: Bridging Academia and Industry</h3>
<p>Addressing the growing disconnect between academic theory and the practical demands of the tech industry, the LUNARTECH Fellowship was created to bridge this talent gap. Far too often, aspiring engineers are caught in the “no experience, no job” loop, graduating with theoretical knowledge but unprepared for the messy reality of production systems.</p>
<p>To combat this systemic issue and halt the resulting brain drain, the Fellowship invests heavily in promising people, offering a transformative environment that prioritizes hands-on experience, mentorship, and real-world engineering over traditional degrees.</p>
<p>This 6-month, remote-first apprenticeship serves as an immersive odyssey from aspiring talent to AI trailblazer. Rather than paying to learn in isolation, Fellows work on live, high-stakes AI and data products alongside experienced senior engineers and founders. By tackling actual engineering challenges and building a concrete portfolio of production-ready work, participants acquire the job-ready skills needed to thrive in today’s competitive landscape.</p>
<p>If you're ready to break the loop and accelerate your career, you can explore these opportunities and start your journey here: <a href="https://www.lunartech.ai/our-careers">https://www.lunartech.ai/our-careers</a>.</p>
<h3 id="heading-master-your-career-the-ai-engineering-handbook">Master Your Career: The AI Engineering Handbook</h3>
<p>For those ready to transition from theory to practice, we have developed <a href="https://www.lunartech.ai/download/the-ai-engineering-handbook">The AI Engineering Handbook: How to Start a Career and Excel as an AI Engineer</a>. This comprehensive guide provides a step-by-step roadmap for mastering the skills necessary to thrive in the transformative world of AI in 2025. Whether you are a developer looking to break into a competitive field or a professional seeking to future-proof your career, this handbook offers proven strategies and actionable insights that have already empowered countless individuals to secure high-impact roles.</p>
<p>Inside, you will explore real-world industry workflows, advanced architecting methods, and expert perspectives from leaders at companies like NVIDIA, Microsoft, and OpenAI. From discovering the technology behind ChatGPT to learning how to architect systems that transform research into world-changing products, this eBook is your ultimate companion for career acceleration. You can download your free copy above and start mastering the future of AI.</p>
<h3 id="heading-about-lunartech-lab">About LunarTech Lab</h3>
<p><em>“Real AI. Real ROI. Delivered by Engineers — Not Slide Decks.”</em></p>
<p><a href="https://labs.lunartech.ai"><strong>LunarTech Lab</strong></a> is a deep-tech innovation partner specializing in AI, data science, and digital transformation – across software products, data platforms, and AI-driven systems.</p>
<p>We build real systems, not PowerPoint strategies. Our teams combine product, data, and engineering expertise to design AI that is measurable, maintainable, and production-ready. We are vendor-neutral, globally distributed, and grounded in real engineering - not hype. Our model blends Western European and North American leadership with high-performance technical teams offering world-class delivery at 70% of the Big Four's cost.</p>
<h3 id="heading-how-we-work-from-scratch-in-four-phases">How We Work — From Scratch, in Four Phases</h3>
<p><strong>1. Discovery Sprint (2–4 Weeks):</strong> We start with data and ROI – not assumptions to define what’s worth building and what’s not and how much it will cost you.</p>
<p><strong>2. Pilot / Proof of Concept (8–12 Weeks):</strong> We prototype the core idea – fast, focused, and measurable.<br>This phase tests models, integrations, and real-world ROI before scaling.</p>
<p><strong>3. Full Implementation (6–12 Months):</strong> We industrialize the solution — secure data pipelines, production-grade models, full compliance, and knowledge transfer to your team.</p>
<p><strong>4. Managed Services (Ongoing):</strong> We maintain, retrain, and evolve the AI models for lasting ROI. Quarterly reviews ensure that performance improves with time, not decays. As we own <a href="https://academy.lunartech.ai/courses">LunarTech Academy</a>, we also build customised training to ensure clients tech team can continue working without us.</p>
<p>Every project is designed <strong>from scratch</strong>, integrating product knowledge, data engineering, and applied AI research.</p>
<h3 id="heading-why-lunartech-lab">Why LunarTech Lab?</h3>
<p>LunarTech Lab bridges the gap between strategy and real engineering, where most competitors fall short. Traditional consultancies, including the Big Four, sell frameworks, not systems – expensive slide decks with little execution.</p>
<p>We offer the same strategic clarity, but it’s delivered by engineers and data scientists who build what they design, at about 70% of the cost. Cloud vendors push their own stacks and lock clients in. LunarTech is vendor-neutral: we choose what’s best for your goals, ensuring freedom and long-term flexibility.</p>
<p>Outsourcing firms execute without innovation. LunarTech works like an R&amp;D partner, building from first principles, co-creating IP, and delivering measurable ROI.</p>
<p>From discovery to deployment, we combine strategy, science, and engineering, with one promise: We don’t sell slides. We deliver intelligence that works.</p>
<h3 id="heading-stay-connected-with-lunartech">Stay Connected with LunarTech</h3>
<p>Follow LunarTech Lab on <a href="https://substack.com/@lunartech">LunarTech NewsLetter</a> <strong>and</strong> <a href="https://www.linkedin.com/in/tatev-karen-aslanyan/"><strong>LinkedIn</strong></a><strong>,</strong> where innovation meets real engineering. You’ll get insights, project stories, and industry breakthroughs from the front lines of applied AI and software development.</p>
<h3 id="heading-lunartech-academy-build-the-future">LunarTech Academy – Build the Future</h3>
<p>If you are inspired by what Claude Code and AI-assisted development make possible and want to build the skills to operate at the frontier, consider joining <a href="http://academy.lunartech.ai">academy.lunartech.ai</a>. Our programs cover AI engineering, machine learning, data science, and applied development, equipping you with the practical, industry-ready expertise needed to build production systems, direct AI agents effectively, and ship software that actually works.</p>
<p>Whether you are a developer looking to level up, a founder who wants to build without a full engineering team, or a domain expert ready to turn your knowledge into working software - the LunarTech Academy is built for where you are going, not where you have been.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Claude Code Essentials ]]>
                </title>
                <description>
                    <![CDATA[ We just published a massive new course on the freeCodeCamp.org YouTube channel that will change the way you think about programming. Instead of just chatting with an AI, you can now learn how to use C ]]>
                </description>
                <link>https://www.freecodecamp.org/news/claude-code-essentials/</link>
                <guid isPermaLink="false">69c1874230a9b81e3a8f2e6d</guid>
                
                    <category>
                        <![CDATA[ claude-code ]]>
                    </category>
                
                    <category>
                        <![CDATA[ youtube ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Beau Carnes ]]>
                </dc:creator>
                <pubDate>Mon, 23 Mar 2026 18:32:34 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5f68e7df6dfc523d0a894e7c/4ec19e44-4bda-4b9b-bfd3-d8ccec1c7ba0.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>We just published a massive new course on the freeCodeCamp.org YouTube channel that will change the way you think about programming. Instead of just chatting with an AI, you can now learn how to use Claude Code to build real-world agentic workflows. This comprehensive guide was developed by Andrew Brown to take you from a total beginner to a pro who knows how to collaborate with an autonomous coding agent directly in the terminal.</p>
<p>Claude Code isn't your average chatbot. It can read your files, execute terminal commands, and even reason through its own errors to fix bugs without you having to copy and paste code back and forth. This course explains the "Agentic Loop," which is the core logic behind how the AI observes a problem, thinks of a solution, and then uses tools to execute that plan.</p>
<p>Throughout the six-hour deep dive, you will learn everything from basic installation on Windows, Linux, and Mac to advanced concepts like session management. Andrew covers how to resume or fork your coding sessions so you can experiment with different ideas safely. You will also get a handle on the financial side by learning how to monitor your API usage and costs across different providers like AWS Bedrock and Google Vertex AI.</p>
<p>You can watch the full course right now on <a href="https://youtu.be/brLhhkUqcn4">the freeCodeCamp YouTube channel</a> (12-hour watch).</p>
<div class="embed-wrapper"><iframe width="560" height="315" src="https://www.youtube.com/embed/brLhhkUqcn4" style="aspect-ratio: 16 / 9; width: 100%; height: auto;" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen="" loading="lazy"></iframe></div>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Stop Staring at a Blank Deck: How I Use Claude Code + Marp to Think Through Presentations ]]>
                </title>
                <description>
                    <![CDATA[ The hard part of building a presentation is figuring out the story. What are you trying to say? What’s the structure? Which sections build on which? Where does the data go, table or bullets? Before th ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-use-claude-code-and-marp-to-think-through-presentations/</link>
                <guid isPermaLink="false">69bc3429b238fd45a3206764</guid>
                
                    <category>
                        <![CDATA[ writing ]]>
                    </category>
                
                    <category>
                        <![CDATA[ AI ]]>
                    </category>
                
                    <category>
                        <![CDATA[ research ]]>
                    </category>
                
                    <category>
                        <![CDATA[ claude-code ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Omer Rosenbaum ]]>
                </dc:creator>
                <pubDate>Thu, 19 Mar 2026 17:36:41 +0000</pubDate>
                <media:content url="https://cdn.hashnode.com/uploads/covers/5e1e335a7a1d3fcc59028c64/fcbd044d-0add-467c-a9b0-d068584a8197.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>The hard part of building a presentation is figuring out the <em>story</em>. What are you trying to say? What’s the structure? Which sections build on which? Where does the data go, table or bullets? Before the comparison or after?</p>
<p>What <em>would</em> help is having something to <strong>react to</strong>. Starting from zero is hard. Reacting to a draft is fast. “Move this before that” is way easier than “what should I say?”</p>
<p>That’s the workflow I want to show you. I use Claude Code + Marp to think through presentations. Claude helps me brainstorm the story, gives me a first draft to react to, and then I iterate, either through “conversation” or by editing the Markdown directly. The whole thing is a text file. 🎉</p>
<p>(I used a deck to think through this post. You can find it <a href="https://omerr.github.io/claude-skills/presentations/claude-code-marp/">here</a>.)</p>
<h3 id="heading-well-cover">We'll cover:</h3>
<ol>
<li><p><a href="#heading-the-workflow">The Workflow</a></p>
<ul>
<li><p><a href="#heading-brainstorm">Brainstorm</a></p>
</li>
<li><p><a href="#heading-react">React</a></p>
</li>
<li><p><a href="#heading-iterate">Iterate</a></p>
</li>
<li><p><a href="#heading-export">Export</a></p>
</li>
<li><p><a href="#heading-editable-pptx">Editable PPTX</a></p>
</li>
</ul>
</li>
<li><p><a href="#heading-get-started-in-5-minutes">Get Started in 5 Minutes</a></p>
<ul>
<li><p><a href="#heading-1-install-marp-cli">1. Install Marp CLI</a></p>
</li>
<li><p><a href="#heading-2-install-the-skill-via-skillssh">2. Install the skill (via skills.sh)</a></p>
</li>
<li><p><a href="#heading-run-it">Run it</a></p>
</li>
<li><p><a href="#heading-iterate">Iterate</a></p>
</li>
</ul>
</li>
<li><p><a href="#heading-use-case-this-very-article">Use Case: This Very Article</a></p>
</li>
<li><p><a href="#heading-under-the-hood">Under the Hood</a></p>
<ul>
<li><p><a href="#heading-marp-markdown-to-slides">Marp: Markdown to Slides</a></p>
</li>
<li><p><a href="#heading-the-skill-file">The Skill File</a></p>
</li>
<li><p><a href="#heading-section-dividers">Section Dividers</a></p>
</li>
<li><p><a href="#heading-breadcrumb-navigation">Breadcrumb Navigation</a></p>
</li>
</ul>
</li>
<li><p><a href="#heading-wrapping-up">Wrapping Up</a></p>
</li>
</ol>
<h2 id="heading-the-workflow">The Workflow</h2>
<p>The process has four stages: <strong>Brainstorm</strong>, <strong>React</strong>, <strong>Iterate</strong>, <strong>Export</strong>. Let me walk through each one.</p>
<h3 id="heading-brainstorm">Brainstorm</h3>
<p>You kick things off with a slash command (I will provide you with this command later):</p>
<pre><code class="language-plaintext">/create-marp-deck API rate limiting
</code></pre>
<p>Claude starts by interviewing you, asks about the goal, audience, key points, any data you want to include. This partforces you to articulate the story before a single slide exists.</p>
<img src="https://cdn-images-1.medium.com/max/1200/0*HHy7-RCRF_oS8WeU.png" alt="Claude Code interviewing the user about their presentation — asking about the goal, audience, and key&nbsp;sections" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<pre><code class="language-plaintext">~/projects/my-app $ claude
&gt; /create-marp-deck API rate limiting
─────────────────────────────────────────────

Claude: What's this presentation about? What should the audience
        walk away knowing?

User:   How our rate limiting works, which algorithm we chose and
        why, and what they need to know to configure it for their
        services.

Claude: Who's the audience?

User:   Platform engineering team — they know our stack but haven't
        seen the rate limiting internals.

Claude: What are the key points or sections you want to cover?

User:   1. Why we need rate limiting (the incident last month)
        2. Token bucket vs sliding window — our decision
        3. How to configure it per-service
        4. Monitoring dashboard walkthrough
</code></pre>
<p>Think of it as a lightweight brainstorm: you talk through what you’re trying to say, and Claude helps you structure it.</p>
<h3 id="heading-react">React</h3>
<p>Once you’ve aligned on the structure, Claude generates the full Marp Markdown file and exports it. You get a solid first draft you can <em>react to</em> and reshape.</p>
<img src="https://cdn-images-1.medium.com/max/1200/0*pFj4D2py1ATg816C.png" alt="Title slide with dark gradient background showing “API Rate Limiting — A Technical Deep&nbsp;Dive”" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p>That title slide came from this Markdown:</p>
<pre><code class="language-plaintext">&lt;!-- _class: lead title-slide --&gt;
</code></pre>
<pre><code class="language-plaintext"># API Rate Limiting
## A Technical Deep Dive
</code></pre>
<pre><code class="language-plaintext">**Team**: Platform Engineering
**Date**: February 2026
</code></pre>
<p>Is it perfect? Probably not. But now you have something concrete, with sections, structure, and a story, that you can push around. That’s so much faster than starting from a blank canvas.</p>
<p>When you go through the slides, you <em>feel</em> if the story is coherent and clear.</p>
<h3 id="heading-iterate">Iterate</h3>
<p>While reviewing the draft, it'll inevitably spark ideas: “oh, I should add a comparison table here,” “this section is too dense, maybe split it into two,” “move this summary up to the top.”</p>
<p>One way to make such edits is to ask Claude Code to do that:</p>
<pre><code class="language-plaintext">"Slide 6 is too dense. Split the algorithm comparison into
two slides, one for token bucket, one for sliding window."
</code></pre>
<img src="https://cdn-images-1.medium.com/max/1200/0*dVWLJ1hecPviej4D.png" alt="Claude Code splitting a slide and adding a callout, with file&nbsp;diffs" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<pre><code class="language-plaintext">&gt; Slide 6 is too dense. Split the algorithm comparison into two
  slides — one for token bucket, one for sliding window.

Claude: I'll split slide 6 into two separate slides, one per algorithm.

  Edit presentations/api-rate-limiting.md
  ───────────────────────────────────────
  - # Algorithm Comparison
  - | Feature | Token Bucket | Sliding Window |
  + # Token Bucket
  + Tokens refill at a steady rate...
  + ---
  + # Sliding Window
  + Track exact timestamp of every request...

&gt; Add a "Why we chose token bucket" callout to that first slide

Claude: Added a blockquote callout explaining the decision.

  Edit presentations/api-rate-limiting.md
  ───────────────────────────────────────
  + &gt; We chose token bucket because it handles bursty traffic
  + &gt; from our mobile clients without penalizing steady callers
</code></pre>
<p>You can also edit in <strong>VS Code</strong> with the Marp extension for live preview. Open the&nbsp;<code>.md</code> file, hit <code>Ctrl+Shift+V</code>, and you get the source on the left with rendered slides on the right. Claude Code edits the file, VS Code detects the change, and the preview updates automatically. (I keep both open side by side and it just works.)</p>
<img src="https://cdn-images-1.medium.com/max/1200/0*88zY1J4xzeo1vUWS.png" alt="Me editing the deck that I created to help me think through this&nbsp;article" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<h3 id="heading-export">Export</h3>
<p>When you’re done, you get three files:</p>
<ul>
<li><p><code>.md</code> – the source (version-controlled, diffable)</p>
</li>
<li><p><code>.html</code> – open in any browser, share via Slack</p>
</li>
<li><p><code>.pptx</code> – open in PowerPoint, present anywhere</p>
</li>
</ul>
<pre><code class="language-bash">$ marp --no-stdin deck.md -o deck.html
[  INFO ] Converting 1 markdown...
[  INFO ] deck.md =&gt; deck.html

$ marp --no-stdin --pptx deck.md -o deck.pptx
[  INFO ] Converting 1 markdown...
[  INFO ] deck.md =&gt; deck.pptx

$ ls presentations/
api-rate-limiting.md
api-rate-limiting.html   ✓ open in browser, share via Slack
api-rate-limiting.pptx   ✓ open in PowerPoint, present anywhere
</code></pre>
<img src="https://cdn-images-1.medium.com/max/1200/0*XsnHZELJ9w3vovOz.png" alt="marp CLI exporting to HTML and&nbsp;PPTX" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p>The skill runs the export commands automatically after generating the deck. A 15-slide deck converts in about 2 seconds.</p>
<h4 id="heading-editable-pptx">Editable PPTX</h4>
<p>The standard PPTX export renders each slide as an image  –  pixel-perfect, but you can’t edit the text in PowerPoint or Google Slides. If you need editable text, Marp has a <code>--pptx-editable</code> flag that uses LibreOffice under the hood to produce real text boxes.</p>
<p>The catch: LibreOffice creates text boxes that are too narrow, so text wraps and overlaps. The skill includes a python-pptx post-processing script that automatically widens the text boxes to fix this. Just ask for “editable PPTX” and the skill handles the rest  –  the LibreOffice conversion, the text box fix, everything.</p>
<h2 id="heading-get-started-in-5-minutes">Get Started in 5&nbsp;Minutes</h2>
<p>OK, are you ready? Here’s everything you need:</p>
<h3 id="heading-1-install-marp-cli">1. Install Marp CLI:</h3>
<ul>
<li><code>npm install -g @marp-team/marp-cli</code></li>
</ul>
<h3 id="heading-2-install-the-skill-via-skillssh">2. Install the skill (via <a href="http://skills.sh">skills.sh</a>):</h3>
<ul>
<li><code>npx skills add Omerr/claude-skills</code></li>
</ul>
<p>This works with Claude Code, Cursor, GitHub Copilot, and other AI agents. You can also install manually  ( see the <a href="https://github.com/Omerr/claude-skills">repo</a> for details).</p>
<h3 id="heading-3-run-it">3. Run it:</h3>
<ul>
<li><code>/create-marp-deck your topic here</code></li>
</ul>
<h3 id="heading-4-iterate">4. Iterate:</h3>
<p>React to the draft, refine through conversation or VS Code, and export.</p>
<p>That’s it. Four steps. Fork the repo and customize the conventions to match your style.</p>
<h2 id="heading-use-case-this-very-article">Use Case: This Very&nbsp;Article</h2>
<p>Want to see this workflow in practice? You’re looking at it.</p>
<p>I wrote this article by first creating a slide deck using exactly the process I described above. I ran <code>/create-marp-deck</code>, answered the interview questions, got a first draft, and iterated until the story felt right. You can <a href="https://omerr.github.io/claude-skills/presentations/claude-code-marp/">see the deck here</a>.</p>
<p>Why start with slides? Because a deck forces you to be concise and to go through the <em>story</em>. If the story doesn’t flow across 15 slides, it won’t flow across 1,500 words either. The deck became my outline, and once I had a coherent structure there, writing the article was much easier.</p>
<p>So if you’re ever staring at a blank doc thinking “I should write a blog post about X,” try making a deck first. You might be surprised how much faster the writing goes when the story is already figured out. 😎</p>
<h2 id="heading-under-the-hood">Under the&nbsp;Hood</h2>
<p>If you’re curious about what makes this work, read on. If not, you’re all set. 🙌🏻</p>
<h3 id="heading-marp-markdown-to-slides">Marp: Markdown to&nbsp;Slides</h3>
<p><a href="https://marp.app/"><strong>Marp</strong></a> (Markdown Presentation Ecosystem) converts&nbsp;<code>.md</code> files into slides. Your deck starts with frontmatter:</p>
<pre><code class="language-plaintext">---
marp: true
theme: default
paginate: true
size: 16:9
---
</code></pre>
<p>Four lines and you have widescreen, paginated slides. Slide breaks are just <code>---</code> in the Markdown. Your presentation is a text file: version-controlled, diffable, and AI-editable.</p>
<h3 id="heading-the-skill-file">The Skill&nbsp;File</h3>
<p>You <em>could</em> just ask Claude Code to “make me a Marp presentation” every time. But you’d spend half the conversation explaining your preferred format, color palette, and slide structure.</p>
<p>Instead, I created a <strong>Claude Code skill</strong> (see it <a href="https://github.com/Omerr/claude-skills.git">here</a>), a reusable set of instructions that Claude follows whenever you invoke it. It has two parts:</p>
<ol>
<li><p>An <strong>interview phase</strong> that gathers context before generating anything (the 5 questions from the brainstorm step)</p>
</li>
<li><p>A <strong>generation phase</strong> with the full Marp conventions: CSS palette, slide structure, breadcrumb pattern, formatting rules, and export commands</p>
</li>
</ol>
<p>The full skill is about 200 lines. That sounds like a lot, but you write it once and then every deck you create follows the same polished conventions automatically.</p>
<h3 id="heading-section-dividers">Section Dividers</h3>
<p>Each section of the deck gets its own gradient background. So when you’re presenting, the audience intuitively knows when you’ve moved to a new topic:</p>
<img src="https://cdn-images-1.medium.com/max/1200/0*SDRNCJnSw3BDwXUG.png" alt="Section divider slide with blue gradient showing “Part 1: The&nbsp;Problem”" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p>Applied via CSS classes in the skill:</p>
<pre><code class="language-plaintext">&lt;!-- _class: lead part-problem --&gt;
# Part 1: The Problem
</code></pre>
<h3 id="heading-breadcrumb-navigation">Breadcrumb Navigation</h3>
<p>This is my favorite part of the whole setup.</p>
<p>Every content slide has a breadcrumb header at the top that shows where you are in the deck:</p>
<img src="https://cdn-images-1.medium.com/max/1200/0*PaPBdx60ZYJn9G3K.png" alt="Content slide showing breadcrumb “The Problem > Algorithms > Implementation” with the current section highlighted in&nbsp;blue" style="display:block;margin:0 auto" width="600" height="400" loading="lazy">

<p>See that header? “The Problem &gt; <strong>Algorithms</strong> &gt; Implementation”, with “Algorithms” highlighted in blue.</p>
<p>In Marp, this is done with a simple HTML comment:</p>
<pre><code class="language-plaintext">&lt;!-- header: "The Problem &gt; **Algorithms** &gt; Implementation" --&gt;
</code></pre>
<p>The <code>**bold**</code> text renders in blue (via CSS <code>header strong { color: #2563eb; }</code>), while the rest stays gray. You set it once per section and it persists until you change it.</p>
<p>How often have you sat through a presentation wondering “wait, where are we?” 🤔</p>
<h2 id="heading-wrapping-up">Wrapping Up</h2>
<p>The hard part of presentations is telling a coherent story. Get yourself a first draft to react to, iterate until it flows, and export. That’s it.</p>
<p>If you want to try it: <code>npm install -g @marp-team/marp-cli</code>, run <code>npx skills add Omerr/claude-skills</code>, and then <code>/create-marp-deck</code>. You'll have a deck in minutes and a workflow you can reuse for every presentation after that.</p>
<h3 id="heading-about-the-author">About the&nbsp;Author</h3>
<p><a href="https://www.linkedin.com/in/omer-rosenbaum-034a08b9/">Omer Rosenbaum</a> is the author of the <a href="https://youtube.com/@BriefVid">Brief</a> <a href="https://youtube.com/@BriefVid">YouTube Channel</a>. He’s also a cyber training expert and founder of Checkpoint Security Academy. He’s the author of <a href="https://www.freecodecamp.org/news/product-led-research-a-practical-guide-for-randd-leaders-full-book/">Product-Led Research</a>, <a href="https://www.freecodecamp.org/news/gitting-things-done-book/">Gitting Things Done</a> (in English) and <a href="https://data.cyber.org.il/networks/networks.pdf">Computer Networks</a> (in Hebrew). You can find him on <a href="https://twitter.com/Omer_Ros">Twitter</a>.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
