<?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" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by George Taskos on Medium]]></title>
        <description><![CDATA[Stories by George Taskos on Medium]]></description>
        <link>https://medium.com/@georgetaskos?source=rss-c7c0baf47ca2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*2cG2WcJHpjKJ8qnQxviw5Q.jpeg</url>
            <title>Stories by George Taskos on Medium</title>
            <link>https://medium.com/@georgetaskos?source=rss-c7c0baf47ca2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:11:46 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@georgetaskos/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Full Stack Loop: Running Claude on IaC and Application Code Without Drift]]></title>
            <link>https://georgetaskos.medium.com/the-full-stack-loop-running-claude-on-iac-and-application-code-without-drift-6f527ff5861c?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f527ff5861c</guid>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[agentic-development]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[aws-cdk]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 14:01:03 GMT</pubDate>
            <atom:updated>2026-04-28T18:05:34.683Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>CDK Series — Part 6 of 6 | Five articles built the pieces. This one runs them together — and shows where the session boundaries, ownership rules, and human gates are.</em></h4><p>I’ve watched engineers give Claude Code a feature spec and get back working code, updated infrastructure, a revised pipeline config, and three decisions nobody made explicitly. The code shipped. Six weeks later, the VPC had changed in a way nobody remembered authorizing, the ECS task role had accumulated permissions from four different sessions, and the Aurora construct ID had been quietly renamed in a refactor. Everything still worked. Until it didn’t.</p><p>This is not a Claude problem. It is a process problem. When sessions are uncoordinated, the stack drifts — not because Claude is wrong, but because nobody defined the session boundaries, file ownership, and human gates upfront. This article defines them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FkB3pet_M4ExLydkEa7Zpg.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Problem With Uncoordinated Claude Sessions</h3><p>Here is what actually happens when you run Claude on a full-stack repository without a coordination model:</p><ul><li><strong>Session A (feature work):</strong> touches src/**, updates AppStack to add env vars. Looks correct in isolation.</li><li><strong>Session B (infra fix):</strong> touches lib/data-stack.ts, notices the Aurora construct ID &quot;looks wrong,&quot; renames it. Individually reasonable. Collectively: CloudFormation sees a new resource. The old cluster gets deleted.</li><li><strong>Session C (pipeline fix):</strong> adds a new deploy job, uses cdk deploy --all &quot;for simplicity.&quot; Redeploys VPC and Aurora on a pipeline change. 15-minute deploy, invisible risk.</li></ul><p>Three sessions. Each correct in scope. Collectively dangerous.</p><p>The accumulated drift compounds across sessions. The ECS task role gains managed policies from multiple sessions — as we covered in Article 3, AmazonS3FullAccess from one session, Secrets Manager grants from another. The construct ID drift from Session B is silent until it shows up as a cluster replacement in the next PR diff. The pipeline scope creep from cdk deploy --all buries infrastructure changes inside fast-moving feature releases.</p><p>The root cause is not Claude’s capability. It is the absence of a coordination model: which session owns which files, what Claude cannot do without human sign-off, and where the human gates are.</p><h3>The Three-Session Model</h3><p>The coordination model that prevents drift is three Claude session types, each with hard file ownership boundaries.</p><h4>Session Type 1 — Feature Sessions (src/** only)</h4><ul><li><strong>Owned files:</strong> src/**, tests/**, package.json</li><li><strong>Forbidden files:</strong> lib/**, bin/**, .github/**</li><li><strong>Can read:</strong> SSM parameter values (for local .env generation)</li><li><strong>Cannot write:</strong> any CDK stack file, any GitHub Actions YAML</li></ul><p>The CLAUDE.md rule that goes in .claude/agents/feature.md:</p><pre>You are in a feature session. Do not modify infrastructure code.<br>Owned files: src/**, tests/**, package.json.<br>If a feature requires infrastructure changes, write a handoff note. Stop.</pre><h4>Session Type 2 — Infrastructure Sessions (lib/[stack]/** only</h4><p>Each stack gets its own session with its own file ownership boundary:</p><ul><li><strong>NetworkStack session:</strong> owns lib/network-stack/** only — as we built in Article 2</li><li><strong>DataStack session:</strong> owns lib/data-stack/** only — NEVER renames construct IDs without explicit human approval, per Article 4</li><li><strong>AppStack session:</strong> owns lib/app-stack/** only — reads IMAGE_TAG from environment, per Article 3</li></ul><p>The CLAUDE.md rule for DataStack specifically:</p><pre>You own DataStack. Do not modify other stacks.<br>Never rename construct IDs without explicit instruction and human sign-off.<br>Construct ID changes cause CloudFormation replacement. That means data loss.</pre><h4>Session Type 3 — Pipeline Sessions (.github/** only)</h4><ul><li><strong>Owned files: </strong>.github/workflows/**</li><li><strong>Forbidden files:</strong> src/**, lib/**, bin/**</li><li><strong>Can read:</strong> CDK stack names (to update deploy job names)</li></ul><p>The CLAUDE.md rule that goes in .claude/agents/pipeline.md:</p><pre>You own .github/workflows. Never use cdk deploy --all.<br>Deploy by stack name only: cdk deploy NetworkStack, cdk deploy DataStack, cdk deploy AppStack.<br>Stack ordering is enforced by needs: declarations, not by cdk deploy --all.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pkzc0BSeUf49GnU2biCYDg.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The .claude/agents/ Directory</h3><p>Claude Code’s native mechanism for encoding session types is the .claude/agents/ directory. Each file defines one agent configuration — a scoped context window that Claude loads when you invoke that session type.</p><pre>.claude/<br>  agents/<br>    feature.md<br>    network-stack.md<br>    data-stack.md<br>    app-stack.md<br>    pipeline.md</pre><p>Here is the data-stack.md agent file in full — the one that prevents the construct ID drift from the opening story:</p><pre>---<br>description: DataStack infrastructure session. Aurora PostgreSQL 16, credentials, backup, subnet placement.<br>allowed_files:<br>  - lib/data-stack.ts<br>  - lib/constructs/aurora/**<br>forbidden_files:<br>  - lib/network-stack.ts<br>  - lib/app-stack.ts<br>  - src/**<br>  - .github/**<br>---<br><br># DataStack Session Rules<br>You own DataStack. Do not modify any other stack.<br><br>## Non-Negotiable Rules (from Articles 1 and 4)<br>- removalPolicy: RETAIN — always<br>- deletionProtection: true — always<br>- Never rename the construct ID &#39;AuroraCluster&#39; — this causes CloudFormation replacement<br>- Never add AWS managed policies to the ECS task role<br>- Never set publiclyAccessible: true<br>- Backup retention: Duration.days(14) minimum<br><br>## Before ending this session<br>Run: npx cdk synth DataStack --quiet<br>Flag any construct ID changes in the handoff note.<br>Human review required before merging any DataStack PR.</pre><p>The forbidden_files list is what makes this enforceable. Claude Code respects these boundaries when the agent file is loaded. The DataStack session literally cannot write lib/network-stack.ts. Session B&#39;s construct ID rename is structurally prevented — not by hoping Claude won&#39;t do it, but by the agent definition.</p><h3>The Handoff Points — Where Human Review Is Mandatory</h3><p>Five moments in a full-stack loop where Claude stops and a human decides. These are not optional gates. They are the reason the full stack loop works without producing incidents.</p><p><strong>1. Dependency map approval </strong>— before any infrastructure session starts: human signs off on the SSM parameter paths and stack boundaries. As we established in Article 1, SSM decouples the stacks. Before any Claude session writes a construct, the paths are declared. / myapp/prod/vpc-id, /myapp/prod/private-subnet-ids, /myapp/prod/aurora-endpoint. Human verifies the map. Sessions begin.</p><p><strong>2. cdk diff review </strong>— any diff showing resource REPLACEMENT stops the pipeline. This is where Article 4’s Aurora checklist runs. corymhall/cdk-diff-action posts the diff to the PR automatically, as we wired in Article 5. A human reads it. Any replacement — DatabaseCluster, SecurityGroup, IAM Role — is a manual decision, not a merge.</p><p><strong>3. DataStack PR gate</strong> — the 10-point Aurora checklist from Article 4. Every PR touching lib/data-stack.ts. Every single one. removalPolicy: RETAIN, deletionProtection: true, construct ID unchanged, backup retention ≥ 14 days. Claude wrote the code. The human runs the checklist.</p><p><strong>4. IMAGE_TAG confirmation</strong> — confirm the image tag being deployed matches the intended release tag. From Article 3: the ECS task definition takes process.env.IMAGE_TAG. From Article 5: that value flows from build-image job output. A human confirms before deploy-app runs that the tag is correct. v1.4.2 is deploying v1.4.2 — not a cached value from a prior pipeline run.</p><p><strong>5. Post-deploy drift check</strong> — cdk drift after every production deploy. As we covered in Article 5, the weekly scheduled drift check surfaces out-of-band console changes. &quot;I fixed it in the console during the incident&quot; diverges your infrastructure from your code. Monday morning, the drift check makes it visible.</p><h3>A Full Stack Loop, End to End</h3><p>A concrete example: adding a new environment variable that requires an app code change and an ECS task definition update.</p><p><strong>Step 1</strong> — Feature session opens. Owned files: src/**. The engineer writes the feature code, adds the new env var to .env.example. Session ends. Handoff note written: &quot;New env var PAYMENT_WEBHOOK_SECRET added. AppStack needs an SSM parameter for this.&quot;</p><p><strong>Step 2 </strong>— AppStack session opens. Reads the handoff note and .env.example. Adds the env var to the ECS task definition via SSM — not hardcoded, per Article 1. ecs.Secret.fromSecretsManager() for the value, per Article 3. Session ends.</p><p><strong>Step 3 </strong>— Pipeline session is NOT involved. No new deploy job. No YAML change. The existing deploy-app job handles this. Total pipeline sessions: zero.</p><p><strong>Step 4</strong> — PR opened. The validate job runs cdk synth. cdk diff posts the diff: task definition updated, new SSM parameter added. No replacements. No new security group rules. No IAM role changes. Human reviews. Approves.</p><p><strong>Step 5</strong> — Release tag pushed: v1.5.0. Pipeline runs: validate → build-image + (deploy-network skipped by paths-filter — no NetworkStack changes) → deploy-data skipped (no DataStack changes) → deploy-app with IMAGE_TAG=1.5.0.</p><p><strong>Step 6</strong> — Monday drift check confirms no out-of-band changes.</p><p>Total Claude sessions: 2 (feature + AppStack). Total deploy time: approximately 3 minutes. Zero unintended infrastructure changes. This is what the full stack loop looks like when the coordination model holds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2fOYNI2at7p3gSVsKIAVLg.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The CLAUDE.md That Ties the Series Together</h3><p>The master CLAUDE.md at repository root. Every session reads it. Every article in this series contributed rules to it. This is the complete file:</p><pre># CLAUDE.md — Full Stack Rules<br><br>## Session Boundaries (MANDATORY — read before starting any session)<br>Before writing any code, identify your session type: feature | network | data | app | pipeline.<br>Load the corresponding agent from .claude/agents/. Do not cross file ownership boundaries.<br><br>## CDK Rules (all sessions)<br>1. Never hardcode resource names — omit bucketName, queueName, clusterIdentifier<br>2. removalPolicy: RETAIN for all stateful resources. Never DESTROY on anything with user data<br>3. Never rename deployed construct IDs — renaming = CloudFormation delete + recreate<br>4. Use grant methods for IAM: bucket.grantRead(), queue.grantSendMessages()<br>   Never addManagedPolicy() with AWS managed policies on task or execution roles<br>5. Security group chaining only: ALB SG → App SG → DB SG. Never ec2.Peer.anyIpv4() on DB ports<br>6. Always bind stacks to env: { account, region }<br><br>## DataStack Rules (data sessions only)<br>7. removalPolicy: RETAIN + deletionProtection: true — both, always<br>8. Never rename the AuroraCluster construct ID<br>9. Backup retention: Duration.days(14) minimum<br>10. Credentials via fromGeneratedSecret — never hardcoded<br>11. addRotationSingleUser minimum — alternating-users for production ECS/Fargate<br><br>## Pipeline Rules (pipeline sessions only)<br>12. OIDC for AWS credentials — never store AWS_ACCESS_KEY_ID in GitHub Secrets<br>13. Never cdk deploy --all — deploy by stack name<br>14. needs: ordering enforces dependency map: network → data → [app + build-image]<br>15. Release tags (v*) drive production deploys — not push to main<br><br>## Human Gates (never skip)<br>1. Dependency map approval before infrastructure sessions start<br>2. cdk diff replacement review — any replacement = STOP<br>3. DataStack PR — 10-point Aurora checklist (see AURORA-CHECKLIST.md)<br>4. IMAGE_TAG confirmation before deploy-app runs<br>5. Post-deploy drift check</pre><p>This file is the series. Article 1 gave you rules 1–4 and 6. Article 2 gave you rule 5 (the security group chain — the VPC article’s core contribution). Article 3 added the task role / execution role distinction. Article 4 added rules 7–11. Article 5 added rules 12–15. Article 6 added the session boundary model at the top — the frame that makes all the other rules coherent.</p><h3>The Series</h3><ul><li><a href="https://medium.com/@georgetaskos/the-cdk-mental-model-teaching-claude-about-your-stack-4193940faac7">The CDK Mental Model </a>— the 6 CDK defaults, CLAUDE.md foundation, dependency map</li><li><a href="https://medium.com/@georgetaskos/private-by-default-the-network-layer-claude-gets-wrong-every-time-afbfdab37cc5">Private by Default</a> — VPC, subnets, security group chain</li><li><a href="https://medium.com/@georgetaskos/ecs-fargate-with-claude-five-defaults-that-will-fail-you-in-production-43f400a2e824">ECS/Fargate with Claude</a> — task definitions, secrets, autoscaling</li><li><a href="https://medium.com/@georgetaskos/aurora-postgresql-16-the-database-claude-shouldnt-touch-alone-c2bf37da9bad">Aurora PostgreSQL 16</a> — the database Claude shouldn’t touch alone</li><li><a href="https://medium.com/@georgetaskos/the-github-actions-pipeline-trunk-based-dev-release-tags-and-ordered-cdk-deploys-65581b282738">The GitHub Actions Pipeline</a> — trunk-based dev, release tags, OIDC</li><li>The Full Stack Loop — this article</li></ul><p><em>CDK Series — Part 6 of 6</em><br>← <a href="https://medium.com/@georgetaskos/the-github-actions-pipeline-trunk-based-dev-release-tags-and-ordered-cdk-deploys-65581b282738">Part 5: The GitHub Actions Pipeline</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f527ff5861c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The GitHub Actions Pipeline: Trunk-Based Dev, Release Tags, and Ordered CDK Deploys]]></title>
            <link>https://georgetaskos.medium.com/the-github-actions-pipeline-trunk-based-dev-release-tags-and-ordered-cdk-deploys-65581b282738?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/65581b282738</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[aws-cdk]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Sun, 26 Apr 2026 12:01:01 GMT</pubDate>
            <atom:updated>2026-04-28T18:04:20.628Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>CDK Series — Part 5 of 6 | The dependency map you built in Article 1 becomes three words in YAML: needs: [deploy-data]. Here’s the full pipeline.</em></h4><p>Claude writes individual GitHub Actions jobs correctly. What it doesn’t know is your deployment model — trunk-based development, release-tag-driven production deploys, selective stack deployment when only app code changes. Without that context, it writes a monolithic “deploy everything on every push” pipeline. That’s expensive, slow, and dangerous for stateful infrastructure.</p><p>This is where Articles 1–4 converge. The stack dependency ordering you established — NetworkStack → DataStack → AppStack — becomes three GitHub Actions needs: declarations. The CLAUDE.md rules from every previous article become conditional logic in YAML. The Aurora checklist from Article 4 runs as a PR gate on the cdk diff output. Claude can write the individual pieces. Without your deployment model in context, it cannot wire them together correctly.</p><p>This article is the pipeline specification. The YAML is real — copy it, adapt the stack names, wire in your OIDC role ARN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-8WN0MhVslCkiQQANWbhfg.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>Two Triggers, Two Purposes</h3><p>The design decision Claude consistently misses: infrastructure deploys and application deploys need separate triggers.</p><pre>on:<br>  push:<br>    branches: [main]<br>  push:<br>    tags:<br>      - &#39;v[0-9]+.[0-9]+.[0-9]+&#39;<br>  pull_request:<br>    branches: [main]</pre><p><strong>Trigger 1 — push to main runs on every merge:</strong></p><ul><li>Lint, typecheck, unit tests</li><li>cdk synth — validates CDK can synthesize without errors</li><li>cdk diff comment posted directly to the PR</li><li>Does NOT deploy to production</li><li>Does NOT build Docker images (expensive on every commit)</li></ul><p><strong>Trigger 2 — push tags v* is an intentional production release:</strong></p><ul><li>Builds Docker image → pushes to ECR with a versioned tag</li><li>Deploys stacks in dependency order</li><li>Infrastructure stacks only redeploy if CDK code changed (paths-filter)</li><li>Purpose: deliberate, traceable production releases — not accidental pushes from any merged PR</li></ul><p>Trunk-based development means every PR merge goes to main. If you deploy to production on every merge, you create two problems simultaneously: you pressure engineers to keep main perpetually release-ready at every commit, and you generate production incidents from incremental changes that weren’t intended as complete features. Tags are a deliberate decision — the engineer tags when the feature set is complete and tested, not when the PR merges.</p><p>Claude defaults to on: push: branches: [main] wired directly to cdk deploy --all. It maps a single trigger to a single undifferentiated action. That&#39;s the monolith pattern — and it makes every merge a potential production incident.</p><h3>OIDC — The Credential Model Claude Gets Wrong</h3><p>Claude’s default: store AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY in GitHub Secrets. This is a long-lived credential. If GitHub is compromised — or if anyone with repo access accidentally exposes a secret in workflow logs — your AWS account is compromised for as long as those keys remain valid.</p><p>The correct approach is OIDC (OpenID Connect). GitHub generates short-lived tokens for each workflow run. No credentials are stored anywhere. Tokens expire when the job ends.</p><pre>// CDK: set up OIDC provider and scoped deployment role<br>const githubOidcProvider = new iam.OpenIdConnectProvider(this, &#39;GithubOidc&#39;, {<br>  url: &#39;https://token.actions.githubusercontent.com&#39;,<br>  clientIds: [&#39;sts.amazonaws.com&#39;],<br>});<br><br>const deployRole = new iam.Role(this, &#39;GithubActionsDeployRole&#39;, {<br>  assumedBy: new iam.OpenIdConnectPrincipal(githubOidcProvider, {<br>    StringLike: {<br>      &#39;token.actions.githubusercontent.com:sub&#39;:<br>        `repo:${githubOrg}/${repoName}:ref:refs/tags/v*`,<br>    },<br>  }),<br>  description: &#39;Assumed by GitHub Actions release pipeline only&#39;,<br>  maxSessionDuration: Duration.hours(1),<br>  inlinePolicies: {<br>    CdkDeployPolicy: new iam.PolicyDocument({<br>      statements: [<br>        new iam.PolicyStatement({<br>          actions: [&#39;sts:AssumeRole&#39;],<br>          resources: [`arn:aws:iam::${this.account}:role/cdk-*`],<br>        }),<br>      ],<br>    }),<br>  },<br>});</pre><p>Two security constraints worth understanding:</p><p>The sub condition — ref:refs/tags/v* — scopes this role to release tags only. A push to main cannot assume the production deploy role. A PR build cannot assume it. Only a workflow triggered by a v* tag push can call STS and get credentials. Branch pushes are structurally excluded from production deployments.</p><p>The resources constraint — cdk-* — limits what the role can further assume. Claude writes &quot;*&quot; on STS AssumeRole by default. That&#39;s privilege escalation to any role in the account. Scoping to cdk-* limits the role to CDK bootstrap execution roles only — enough to deploy, not enough to do anything else.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pkqttkbNRlWlkPOVOMfwg.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Five-Job Pipeline</h3><p>The full pipeline skeleton, structured to show the decisions that matter:</p><pre>jobs:<br>  validate:<br>    runs-on: ubuntu-latest<br>    permissions:<br>      id-token: write<br>      contents: read<br>      pull-requests: write<br>    steps:<br>      - uses: actions/checkout@v4<br>      - uses: actions/setup-node@v4<br>        with: { node-version: &#39;20&#39; }<br>      - run: npm ci &amp;&amp; npm run build &amp;&amp; npm test<br>      - run: npx cdk synth<br>      - uses: aws-actions/configure-aws-credentials@v4<br>        with:<br>          role-to-assume: ${{ secrets.CDK_DEPLOY_ROLE_ARN }}<br>          aws-region: us-east-1<br>      - uses: corymhall/cdk-diff-action@v2<br>        with:<br>          githubToken: ${{ secrets.GITHUB_TOKEN }}<br>  build-image:<br>    if: startsWith(github.ref, &#39;refs/tags/v&#39;)<br>    needs: [validate]<br>    outputs:<br>      image-tag: ${{ steps.meta.outputs.version }}<br>    steps:<br>      - uses: docker/metadata-action@v5<br>        id: meta<br>        with:<br>          tags: type=semver,pattern={{version}}  # never &#39;latest&#39;<br>      - uses: aws-actions/configure-aws-credentials@v4<br>        with:<br>          role-to-assume: ${{ secrets.CDK_DEPLOY_ROLE_ARN }}<br>          aws-region: us-east-1<br>      - uses: aws-actions/amazon-ecr-login@v2<br>        id: ecr-login<br>      - uses: docker/build-push-action@v5<br>        with:<br>          push: true<br>          tags: ${{ steps.ecr-login.outputs.registry }}/${{ env.ECR_REPO }}:${{ steps.meta.outputs.version }}<br>  deploy-network:<br>    if: startsWith(github.ref, &#39;refs/tags/v&#39;)<br>    needs: [validate]<br>    steps:<br>      - run: npx cdk deploy NetworkStack --require-approval never<br>  deploy-data:<br>    needs: [deploy-network]<br>    steps:<br>      - run: npx cdk deploy DataStack --require-approval never<br>  deploy-app:<br>    needs: [deploy-data, build-image]<br>    env:<br>      IMAGE_TAG: ${{ needs.build-image.outputs.image-tag }}<br>    steps:<br>      - run: npx cdk deploy AppStack --require-approval never</pre><h3>Why deploy-app Needs Both deploy-data AND build-image</h3><p>deploy-app declares two needs: entries — deploy-data and build-image. This single line is the dependency map from Article 1 made executable in YAML.</p><p>deploy-data ensures the Aurora cluster and its security groups exist before AppStack deploys. AppStack imports CloudFormation outputs from DataStack — the security group ID, the secret ARN. If DataStack hasn&#39;t completed, those outputs don&#39;t exist and AppStack fails.</p><p>build-image ensures the new Docker image is in ECR before AppStack references it. The image tag flows as a job output — needs.build-image.outputs.image-tag — and is injected into the CDK deploy as IMAGE_TAG. This connects back to Article 3&#39;s rule: image tags are versioned semver strings from the git tag, never latest.</p><p>GitHub Actions runs deploy-data and build-image in parallel. Both must complete before deploy-app starts. The pipeline enforces the architecture at the execution level, not just as documentation.</p><h3>Selective Deployment — Only Deploy What Changed</h3><p>Claude writes cdk deploy --all everywhere. In production this is wrong. Every release redeploys your VPC and Aurora cluster even when only app code changed. Aurora deploy takes 5–10 minutes on its own.</p><p>Use dorny/paths-filter to make infrastructure deploys conditional:</p><pre>deploy-network:<br>    if: startsWith(github.ref, &#39;refs/tags/v&#39;)<br>    needs: [validate]<br>    steps:<br>      - uses: dorny/paths-filter@v3<br>        id: changed<br>        with:<br>          filters: |<br>            network:<br>              - &#39;lib/network-stack.ts&#39;<br>              - &#39;lib/constructs/vpc/**&#39;<br>      - name: Deploy NetworkStack<br>        if: steps.changed.outputs.network == &#39;true&#39;<br>        run: npx cdk deploy NetworkStack --require-approval never</pre><p>Same pattern for deploy-data — conditional on changes to lib/data-stack.ts or Aurora construct files.</p><p>For an app-only release — a new feature, a bug fix, a Docker image rebuild — only validate, build-image, and deploy-app run. NetworkStack and DataStack skip entirely. Pipeline time drops from 15+ minutes to approximately 3 minutes.</p><p>That’s not a minor optimization. It’s the difference between a deployment that blocks your afternoon and one that completes before you finish reviewing the PR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YBR4KHGI_BBixhYAekKrXg.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>cdk diff in PRs — The IaC Safety Net</h3><p>corymhall/cdk-diff-action posts the CloudFormation diff as a PR comment before any merge. This is the IaC equivalent of a code diff — engineers see exactly what will change in the infrastructure, in the PR, before approval.</p><p>The action runs in the validate job on every push to main and every pull request. It shows additions in green, modifications in yellow, replacements in orange.</p><p>Replacements are the human stop signal. Any diff that shows:</p><ul><li><strong>DatabaseCluster replacement</strong> → CloudFormation deletes the old cluster, creates a new empty one. Every row gone. There is no rollback — only a restore from your last backup.</li><li><strong>SecurityGroup replacement</strong> → traffic drops during the replacement window. Every resource attached to the old security group loses network access until it attaches to the new one.</li><li><strong>IAM Role replacement</strong> → permission gap while the new role is created and attached. Running tasks lose access to secrets, S3 buckets, queues.</li></ul><p>These don’t fail the pipeline. They surface the risk on the PR. A human reviews the cdk diff output and decides whether to approve the merge. This is where Article 4&#39;s 10-point Aurora PR checklist runs — not as manual CDK TypeScript inspection, but as structured review of the diff the pipeline posts for you.</p><h3>Drift Detection — cdk drift (May 2025)</h3><p>AWS CDK shipped cdk drift in May 2025. It detects out-of-band changes — someone edited a security group rule in the console, manually updated an environment variable, changed a parameter to resolve an incident. Changes that diverged your production infrastructure from your CDK code.</p><pre>name: Weekly Drift Detection<br>on:<br>  schedule:<br>    - cron: &#39;0 6 * * 1&#39;  # Monday 6AM UTC<br>jobs:<br>  drift-check:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - uses: actions/checkout@v4<br>      - uses: actions/setup-node@v4<br>        with: { node-version: &#39;20&#39; }<br>      - run: npm ci<br>      - uses: aws-actions/configure-aws-credentials@v4<br>        with:<br>          role-to-assume: ${{ secrets.CDK_DEPLOY_ROLE_ARN }}<br>          aws-region: us-east-1<br>      - run: npx cdk drift NetworkStack DataStack AppStack</pre><p>Any stack where live AWS state diverges from CDK code fails the check. Run it weekly. Wire the failure to a GitHub issue or a Slack alert.</p><p>“I just fixed it in the console” is common incident response. It also creates invisible divergence between your code and your infrastructure — overwritten silently on the next CDK deploy. cdk drift makes it visible on Monday morning, before it becomes Friday&#39;s outage.</p><h3>CLAUDE.md for the Pipeline</h3><pre>## GitHub Actions Pipeline Rules<br><br>1. Use OIDC for AWS credentials — never store AWS_ACCESS_KEY_ID in GitHub Secrets<br>2. Never `cdk deploy --all` — deploy stacks by name with selective conditions<br>3. Dependency ordering via `needs:` — deploy-network before deploy-data before deploy-app<br>4. Always include `cdk synth` in the validate job before any deploy<br>5. Always include `cdk diff` in PR validate — flag replacements as human review required<br>6. Release tags (v*) drive production deploys, not push to main<br>7. IMAGE_TAG passed as job output from build-image — never hardcoded<br>8. OIDC role scoped to release tags only: ref:refs/tags/v*</pre><p>These rules encode the deployment model that Claude cannot infer from your codebase. Without them, Claude writes a functional pipeline that violates every constraint above. With them, Claude works inside your architecture instead of around it.</p><p>Add these to the same CLAUDE.md that carries the rules from Articles 1–4. The file grows with the series — each article adds the constraints for its domain. By Article 6, Claude has a complete specification of the stack, the deployment model, and the safety gates. That context is what separates Claude Code generating working infrastructure from Claude Code generating production infrastructure.</p><h3>The Series</h3><p>Add the pipeline rules above to your project root CLAUDE.md alongside the rules from Articles 1–4. Article 6 shows the complete 15-rule combined file.</p><ul><li><a href="https://medium.com/@georgetaskos/the-cdk-mental-model-teaching-claude-about-your-stack-4193940faac7">The CDK Mental Model</a> — the 6 CDK defaults, CLAUDE.md foundation, dependency map</li><li><a href="https://medium.com/@georgetaskos/private-by-default-the-network-layer-claude-gets-wrong-every-time-afbfdab37cc5">Private by Default </a>— VPC, subnets, security group chain</li><li><a href="https://medium.com/@georgetaskos/ecs-fargate-with-claude-five-defaults-that-will-fail-you-in-production-43f400a2e824">ECS/Fargate with Claude</a> — task definitions, secrets, autoscaling</li><li><a href="https://medium.com/@georgetaskos/aurora-postgresql-16-the-database-claude-shouldnt-touch-alone-c2bf37da9bad">Aurora PostgreSQL 16 </a>— the database Claude shouldn’t touch alone</li><li>The GitHub Actions Pipeline — this article</li><li><a href="https://medium.com/@georgetaskos/the-full-stack-loop-running-claude-on-iac-and-application-code-without-drift-6f527ff5861c">The Full Stack Loop</a> — running everything together without drift</li></ul><p><em>CDK Series — Part 5 of 6</em><br>← <a href="https://medium.com/@georgetaskos/aurora-postgresql-16-the-database-claude-shouldnt-touch-alone-c2bf37da9bad">Part 4: Aurora PostgreSQL 16</a><br>→ <a href="https://medium.com/@georgetaskos/the-full-stack-loop-running-claude-on-iac-and-application-code-without-drift-6f527ff5861c">Part 6: The Full Stack Loop</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65581b282738" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Aurora PostgreSQL 16: The Database Claude Shouldn’t Touch Alone]]></title>
            <link>https://georgetaskos.medium.com/aurora-postgresql-16-the-database-claude-shouldnt-touch-alone-c2bf37da9bad?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2bf37da9bad</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[aws-cdk]]></category>
            <category><![CDATA[cloud-security]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Sat, 25 Apr 2026 17:01:02 GMT</pubDate>
            <atom:updated>2026-04-28T18:03:00.283Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>CDK Series — Part 4 of 6 | The mistakes Claude makes on Aurora aren’t recoverable without a restore. Here’s where the human engineer must be the final gate.</em></h4><p>Claude wrote the Aurora cluster in two minutes. It also set publiclyAccessible: true, put the database in a public subnet, and opened port 5432 to 0.0.0.0/0. The cluster was reachable from the internet within 90 seconds of deploy. I found out during the security review three days later.</p><p>Every other article in this series covers mistakes that are recoverable. Wrong subnet type — redeploy, fix, done. Bad image tag — roll it back. Wrong health check — update and redeploy. Aurora mistakes are different. A wrong removalPolicy deletes your cluster and every row in it the moment someone runs cdk destroy in the wrong terminal. A logical ID rename causes CloudFormation to silently replace the cluster — delete the old one, create a new empty one. publiclyAccessible: true means your database is internet-reachable the moment the stack completes.</p><p>None of these failure modes throw an error. None show up at cdk synth. They all deploy successfully. The damage is done by the time you notice.</p><p>This is the article where the human must be the final gate. Not a rubber stamp. An active, mandatory checkpoint on every PR that touches DataStack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_wVuc3Kw_uOn9WSNaFbjgA.png" /></figure><h3>Why Aurora Is Different</h3><p>Every CDK mistake has a consequence profile. Most resources fail loudly — a deploy error, a permission denied, a failed health check. You see the failure. You fix it. Aurora fails quietly, and the damage is often permanent.</p><p>The five mistake categories that make Aurora uniquely dangerous:</p><ul><li><strong>removalPolicy: DESTROY →</strong> cdk destroy silently wipes the cluster and all data. No warning. No confirmation prompt. It just happens.</li><li><strong>deletionProtection: false →</strong> CloudFormation can delete the cluster during a failed stack update. A rollback gone wrong takes the database with it.</li><li><strong>publiclyAccessible: true →</strong> DB endpoint exposed to the internet, immediately on deploy. Port scanners find it within minutes.</li><li><strong>Logical ID rename</strong> → CloudFormation replaces the cluster (delete + recreate) as a normal resource update. Your data is gone; CloudFormation reports success.</li><li><strong>backup.retention too low →</strong> with the 1-day Aurora default, a slow-burn incident (corrupted data discovered four days later) has no recovery path.</li></ul><p>None of these are caught at cdk synth. All deploy successfully. The damage happens either immediately (publiclyAccessible) or at the exact moment a destroy or update is triggered. There is no &quot;undo.&quot; There is only &quot;restore from the last good backup&quot; — if one exists.</p><h3>The Aurora Configuration Claude Gets Wrong</h3><p>Claude’s defaults come from its training data — and popular CDK tutorials rank on Google and end up in that training data. Here is a real pattern from one of those tutorials (codewithyou.com), nearly verbatim:</p><pre>// ❌ What Claude writes — deploys fine, is dangerous<br>const dbCluster = new rds.DatabaseCluster(this, &#39;DbCluster&#39;, {<br>  engine: rds.DatabaseClusterEngine.auroraPostgres({<br>    version: rds.AuroraPostgresEngineVersion.VER_13_6,<br>  }),<br>  instances: 1,<br>  instanceProps: {<br>    vpc: vpc,<br>    instanceType: new InstanceType(&#39;serverless&#39;),<br>    publiclyAccessible: true,         // ← DB endpoint exposed to internet<br>    securityGroups: [dbSecurityGroup],<br>    vpcSubnets: vpc.selectSubnets({<br>      subnetType: SubnetType.PUBLIC,  // ← database in public subnet<br>    }),<br>  },<br>  port: 5432,<br>  // deletionProtection: not set → defaults to false<br>  // backup.retention: not set → defaults to 1 day<br>});<br><br>// The security group that ships with this:<br>dbSecurityGroup.addIngressRule(<br>  Peer.anyIpv4(),           // ← 0.0.0.0/0 — anyone on the internet<br>  Port.tcp(5432),<br>  &#39;allow inbound traffic from anywhere&#39;<br>);</pre><p>This code deploys. The cluster is reachable. Port 5432 is open to the world. If you run cdk destroy to clean up a dev environment and you happened to deploy this to the wrong account, deletionProtection is false — CloudFormation deletes the cluster without complaint.</p><p>The reason Claude defaults this way is not that it doesn’t know better. It’s that the tutorials in its training data were written to make things work, not to make things production-safe. The author wanted the code to run. It ran. The article ranked. Claude learned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EMVqUaCOP5ZAfAbKOaRDcQ.png" /></figure><h3>The Production Aurora Configuration</h3><pre>import * as rds from &#39;aws-cdk-lib/aws-rds&#39;;<br>import * as ec2 from &#39;aws-cdk-lib/aws-ec2&#39;;<br>import { Duration, RemovalPolicy } from &#39;aws-cdk-lib&#39;;<br><br>const dbCluster = new rds.DatabaseCluster(this, &#39;AuroraCluster&#39;, {<br>  engine: rds.DatabaseClusterEngine.auroraPostgres({<br>    version: rds.AuroraPostgresEngineVersion.VER_16_4,<br>  }),<br><br>  // Credentials from Secrets Manager — never hardcoded, never inline<br>  credentials: rds.Credentials.fromGeneratedSecret(&#39;postgres&#39;, {<br>    secretName: &#39;/myapp/prod/aurora-master-credentials&#39;,<br>  }),<br><br>  // Provisioned writer for predictable write performance<br>  writer: rds.ClusterInstance.provisioned(&#39;Writer&#39;, {<br>    instanceType: ec2.InstanceType.of(<br>      ec2.InstanceClass.R6G,<br>      ec2.InstanceSize.LARGE<br>    ),<br>    enablePerformanceInsights: true,<br>    performanceInsightRetention: rds.PerformanceInsightRetention.MONTHS_1,<br>  }),<br><br>  // Serverless v2 reader — scales with writer for failover readiness<br>  readers: [<br>    rds.ClusterInstance.serverlessV2(&#39;Reader1&#39;, {<br>      scaleWithWriter: true,<br>    }),<br>  ],<br>  serverlessV2MinCapacity: 0.5,<br>  serverlessV2MaxCapacity: 16,<br>  storageEncrypted: true,<br><br>  // Private subnets — use PRIVATE_WITH_EGRESS, not PRIVATE_ISOLATED<br>  // CDK bug #29256: PRIVATE_ISOLATED breaks serverless v2 reader AZ placement<br>  vpc,<br>  vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },<br>  securityGroups: [dbSecurityGroup],<br><br>  backup: {<br>    retention: Duration.days(14),<br>    preferredWindow: &#39;03:00-04:00&#39;,<br>  },<br><br>  // The two gates — both required, explained in the next section<br>  deletionProtection: true,<br>  removalPolicy: RemovalPolicy.RETAIN,<br><br>  preferredMaintenanceWindow: &#39;sun:05:00-sun:06:00&#39;,<br>  autoMinorVersionUpgrade: true,<br>  defaultDatabaseName: &#39;appdb&#39;,<br><br>  parameterGroup: rds.ParameterGroup.fromParameterGroupName(<br>    this, &#39;PG16ParameterGroup&#39;, &#39;default.aurora-postgresql16&#39;<br>  ),<br>})<br><br>// Network access via connections — never open security group rules manually<br>dbCluster.connections.allowFrom(<br>  appSecurityGroup,<br>  ec2.Port.tcp(5432),<br>  &#39;App layer to Aurora&#39;<br>);</pre><p>No publiclyAccessible — it defaults to false for private subnets. No open security group rules — connections.allowFrom() scopes access to the app security group only. storageEncrypted: true is explicit, not implied. Backup retention is 14 days — not the Aurora default of 1. Everything Claude omits or gets wrong is stated here, with intent.</p><p>One more note on the subnet type: there is a closed CDK bug (<a href="https://github.com/aws/aws-cdk/issues/29256">#29256</a>) where PRIVATE_ISOLATED subnets cause serverless v2 reader instances to be placed incorrectly. Use PRIVATE_WITH_EGRESS even if your subnets don&#39;t technically need egress. The Article 2 VPC setup uses PRIVATE_WITH_EGRESS for all private compute — this is consistent with that.</p><h3>removalPolicy vs deletionProtection — Two Different Gates</h3><p>Many engineers know about one of these properties. Almost nobody uses both correctly. They protect against different failure modes, and you need both.</p><h4>removalPolicy: what CDK does when the stack is destroyed</h4><p>removalPolicy tells CDK/CloudFormation what to do with the resource when the stack is deleted:</p><ul><li><strong>DESTROY</strong> — deletes the cluster. Claude’s “dev-friendly” default. One cdk destroy in the wrong terminal takes your production database with it.</li><li><strong>SNAPSHOT</strong> — takes a final snapshot, then deletes the cluster. Feels safe. The cluster is still gone — you’re recovering from a snapshot, not resuming from a running database.</li><li><strong>RETAIN</strong> — stack destroy leaves the cluster untouched. The only correct production setting.</li></ul><h4>deletionProtection: whether CloudFormation can delete the cluster at all</h4><p>deletionProtection is a hard stop at the CloudFormation layer, independent of CDK&#39;s removal policy:</p><ul><li><strong>false</strong> (default) — CloudFormation can delete the cluster during a stack update, stack destroy, or resource replacement. No confirmation. No warning.</li><li><strong>true</strong> — CloudFormation throws an error rather than deleting. The operation fails and the cluster stays intact. This is the behavior you want.</li></ul><h3>Why you need both</h3><p>This is the part nobody writes down clearly enough.</p><p><strong>RETAIN without deletionProtection:</strong> removalPolicy: RETAIN only applies to explicit stack destroy operations. A logical ID rename causes CloudFormation to REPLACE the cluster — treat it as a new resource (delete old, create new). removalPolicy does not protect against replacements. deletionProtection: true does — the replacement attempt fails with an error, your data is safe, and you have time to figure out what happened.</p><p><strong>deletionProtection without RETAIN:</strong> cdk destroy attempts to delete the cluster and gets blocked. Now you have a stack stuck in DELETE_FAILED state that requires manual CloudFormation cleanup. Not data loss — but an unplanned hour of work to untangle.</p><p><strong>Both together: </strong>complete protection. Destroy is blocked. Replacement is blocked. Stack destroy retains the cluster. The only way to remove a production Aurora cluster is to first manually disable deletionProtection in the AWS console — which is exactly the friction you want before anything irreversible happens.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FkB3pet_M4ExLydkEa7Zpg.png" /></figure><h3>Credential Rotation — The Pattern Claude Skips</h3><p>Claude generates the secret. Claude creates the cluster. Claude almost never wires rotation.</p><pre>// ✅ Single-user rotation — minimum for any production database<br>dbCluster.addRotationSingleUser({<br>  automaticallyAfter: Duration.days(30),<br>});</pre><p><strong>Single-user vs alternating-users</strong> — and why the choice matters for ECS/Fargate:</p><p>ECS tasks inject credentials at startup via ecs.Secret.fromSecretsManager(). The value is fetched once, when the task starts, then cached in the container&#39;s environment. Single-user rotation briefly invalidates the old password (roughly one second) while the new one is set. Running tasks survive because Aurora holds existing connections open. But a task that starts exactly during that rotation window gets an authentication failure at startup.</p><p>Alternating-users rotation maintains two database users and rotates between them. Both passwords are always valid during the transition. Zero-downtime rotation — the right choice for production ECS/Fargate workloads that autoscale.</p><pre>// ✅ Alternating-users rotation — zero-downtime for ECS/Fargate<br>const rotationUser = new rds.DatabaseSecret(this, &#39;RotationUserSecret&#39;, {<br>  username: &#39;rotation_user&#39;,<br>  dbname: &#39;appdb&#39;,<br>});<br><br>dbCluster.addRotationMultiUser(&#39;RotationUser&#39;, {<br>  secret: rotationUser,<br>  automaticallyAfter: Duration.days(30),<br>});</pre><p>New tasks starting during rotation always find a valid password — the failure mode (authentication error at startup because the task caught the exact rotation window) is eliminated.</p><h3>The Human Review Gate</h3><p>Claude writes the code. The human runs this checklist. Every single PR that touches DataStack.</p><p>These are the ten things Claude cannot verify — they require comparing to deployed state, exercising architectural judgment, or resisting Claude’s own training defaults:</p><ol><li>removalPolicy is RETAIN — not DESTROY, not SNAPSHOT</li><li>deletionProtection is true</li><li>storageEncrypted is true</li><li>publiclyAccessible is not present — it defaults to false for private subnets, which is correct</li><li>backup.retention is Duration.days(14) minimum — never the 1-day Aurora default</li><li>Credentials use fromGeneratedSecret or fromSecret — never a hardcoded string</li><li>Credential rotation is configured — addRotationSingleUser at minimum</li><li>The construct ID &#39;AuroraCluster&#39; has not changed from the previous deployment</li><li>No managed policies on the ECS task role for DB access — use connections.allowFrom()</li><li>cdk-nag AwsSolutionsChecks passes — catches open ingress rules and missing encryption</li></ol><p>Add this to your PR template. Reference it by name in code review. The damage profile for getting it wrong is not “redeploy and fix in 20 minutes.” It is “restore from backup” — or worse, “the backup window was 1 day and the incident is 4 days old.”</p><p>Claude is the fastest CDK author you will ever work with. The human review gate is not a bottleneck — it’s what makes the speed safe to use.</p><h3>The Series</h3><p>Add the DataStack rules above to your project root CLAUDE.md alongside the rules from Articles 1, 2, and 3. Article 6 shows the complete combined file.</p><ul><li><a href="https://medium.com/@georgetaskos/the-cdk-mental-model-teaching-claude-about-your-stack-4193940faac7">The CDK Mental Model </a>— the 6 CDK defaults, CLAUDE.md foundation, dependency map</li><li><a href="https://medium.com/@georgetaskos/private-by-default-the-network-layer-claude-gets-wrong-every-time-afbfdab37cc5">Private by Default </a>— VPC, subnets, security group chain</li><li><a href="https://medium.com/@georgetaskos/ecs-fargate-with-claude-five-defaults-that-will-fail-you-in-production-43f400a2e824">ECS/Fargate with Claude</a> — task definitions, secrets, autoscaling</li><li>Aurora PostgreSQL 16 — this article</li><li><a href="https://medium.com/@georgetaskos/the-github-actions-pipeline-trunk-based-dev-release-tags-and-ordered-cdk-deploys-65581b282738">The GitHub Actions Pipeline </a>— trunk-based dev, release tags, OIDC</li><li><a href="https://medium.com/@georgetaskos/the-full-stack-loop-running-claude-on-iac-and-application-code-without-drift-6f527ff5861c">The Full Stack Loop </a>— running everything together without drift</li></ul><p><em>CDK Series — Part 4 of 6</em><br>← <a href="https://medium.com/@georgetaskos/ecs-fargate-with-claude-five-defaults-that-will-fail-you-in-production-43f400a2e824">Part 3: ECS/Fargate with Claude</a><br>→ <a href="https://medium.com/@georgetaskos/the-full-stack-loop-running-claude-on-iac-and-application-code-without-drift-6f527ff5861c">Part 5: The Full Stack Loop</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2bf37da9bad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ECS/Fargate with Claude: Five Defaults That Will Fail You in Production]]></title>
            <link>https://georgetaskos.medium.com/ecs-fargate-with-claude-five-defaults-that-will-fail-you-in-production-43f400a2e824?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/43f400a2e824</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[aws-cdk]]></category>
            <category><![CDATA[cloud-architecture]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 17:01:01 GMT</pubDate>
            <atom:updated>2026-04-28T18:01:12.608Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>CDK Series — Part 3 of 6 | Claude writes ECS services fast. Here’s what it gets wrong every time — and the patterns that fix it.</em></h4><p>Claude wrote the ECS service in 90 seconds. Task definition, ALB, autoscaling, secrets injection. It looked production-ready. Then I noticed: image: &#39;latest&#39;, desiredCount: 1, publicLoadBalancer: true, and one IAM role doing the job of two.</p><p>The speed is real. Claude understands CDK deeply — it knows SubnetType.PRIVATE_WITH_EGRESS, wires service principals correctly, and picks the right L2 constructs. The gap between &quot;it ran&quot; and &quot;it belongs in production&quot; is five specific decisions Claude makes without explaining them, every single time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D0aui4qXDu447Hn9dVpslA.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>Two Roles, One Critical Mistake</h3><p>This is the #1 conceptual error in Claude-generated ECS code. Every Fargate task has two IAM roles. Claude either collapses them into one or applies permissions to the wrong one — and the code deploys fine either way, which is exactly what makes the mistake dangerous.</p><h4>The Execution Role — ECS Agent, Not Your App</h4><p>The execution role is used by the ECS infrastructure agent at task startup to:</p><ul><li>Pull the container image from ECR</li><li>Fetch secrets from Secrets Manager and inject them as environment variables before the container runs</li><li>Send logs to CloudWatch</li></ul><p>CDK auto-creates this role. You don’t need to define it. When you use ecs.Secret.fromSecretsManager(), CDK automatically grants the execution role secretsmanager:GetSecretValue on the referenced secret. No manual IAM grant needed. Claude often doesn&#39;t know this — it either adds redundant grants or, worse, applies those permissions to the task role where they don&#39;t belong.</p><h4>The Task Role — Your Application Code</h4><p>The task role is what your application containers use at runtime — after startup, while the app is handling requests:</p><pre>// ✅ Task role — scoped to what app code actually calls<br>const appRole = new iam.Role(this, &#39;AppTaskRole&#39;, {<br>  assumedBy: new iam.ServicePrincipal(&#39;ecs-tasks.amazonaws.com&#39;),<br>  description: &#39;Runtime role for app container — S3, SQS, runtime secret rotation&#39;,<br>});<br>// Grant methods only — never addManagedPolicy<br>assetsBucket.grantReadWrite(appRole);<br>auditQueue.grantSendMessages(appRole);<br>// Only add secretsmanager access here if app re-fetches rotating secrets at runtime</pre><h3>The Mistake Claude Makes</h3><p>Claude adds secretsmanager:GetSecretValue to the task role because it looks like the right place for &quot;anything the app needs.&quot; It isn&#39;t. Secrets injected at startup are fetched by the ECS agent using the execution role — your app code never touches Secrets Manager for those. If your app <em>re-fetches</em> a rotating secret at runtime, that&#39;s a different scenario: task role, SDK call, intentional. But Claude conflates the two and adds the grant regardless.</p><p>There’s also a naming trap Claude falls into repeatedly: ecs.Secret (from aws-ecs) and secretsmanager.Secret (from aws-secretsmanager) are different constructs. ecs.Secret.fromSecretsManager() is the one you want for startup injection — it&#39;s what triggers CDK&#39;s automatic execution role grant.</p><p><strong>CLAUDE.md rule:</strong> Task role = what app code calls at runtime. Execution role = what ECS agent calls at startup. Never combine. Use ecs.Secret.fromSecretsManager() — CDK auto-grants execution role. No manual IAM grant needed.</p><h3>The Five Production Defaults</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HF1IZ_zFpbjOoIzK2A3Ouw.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h4>1. image: ‘latest’</h4><pre>// ❌ WRONG — Claude&#39;s default<br>image: ecs.ContainerImage.fromEcrRepository(repo, &#39;latest&#39;)<br><br>// ✅ CORRECT — immutable, traceable, rollback-safe<br>const imageTag = process.env.IMAGE_TAG!; // git SHA injected by GitHub Actions<br>image: ecs.ContainerImage.fromEcrRepository(repo, imageTag)</pre><p>latest is a moving pointer. A rollback deploys whatever latest currently points to — which may be the broken version you&#39;re rolling back from. Immutable tags (git SHA from CI) are traceable, auditable, and actually reversible. You can look at any deploy and know exactly what commit is running.</p><p><strong>CLAUDE.md rule:</strong> Never use image tag &#39;latest&#39;. Use process.env.IMAGE_TAG injected by the CI/CD pipeline.</p><h4>2. desiredCount: 1</h4><pre>// ❌ WRONG — single task, zero HA, no room for rolling deploys<br>desiredCount: 1<br><br>// ✅ CORRECT — minimum 2 for HA across AZs<br>desiredCount: 2</pre><p>One task means one failure takes down the service. It also means rolling deploys can’t work — ECS needs room to start a new task before stopping the old one. With desiredCount: 1 and default deploy settings, ECS has to stop the running task first, creating downtime. With desiredCount: 2, minHealthyPercent: 100, and maxHealthyPercent: 200, ECS starts two new tasks, waits for them to be healthy, then stops the old two. Zero downtime.</p><p><strong>CLAUDE.md rule:</strong> desiredCount minimum 2. Never 1.</p><h4>3. L3 ApplicationLoadBalancedFargateService</h4><pre>// ❌ WRONG — hides SG creation, ignores your NetworkStack<br>const service = new ecsPatterns.ApplicationLoadBalancedFargateService(this, &#39;Service&#39;, {<br>  cluster,<br>  publicLoadBalancer: true, // ← default: internet-facing ALB, ignores your SG chain<br>  taskImageOptions: {<br>    image: ecs.ContainerImage.fromEcrRepository(repo, &#39;latest&#39;),<br>    secrets: { DB_PASSWORD: ecs.Secret.fromSecretsManager(dbSecret) },<br>  },<br>  desiredCount: 1,<br>});</pre><p>The L3 ApplicationLoadBalancedFargateService creates its own security groups — bypassing your NetworkStack&#39;s SG chain entirely. It puts the ALB in public subnets but doesn&#39;t wire into your pre-built subnet structure. publicLoadBalancer: true is the default. No explicit assignPublicIp declaration. Claude loves this construct because it looks complete. It is — just not the way you want.</p><pre>// ✅ CORRECT — explicit control over every network layer<br>const service = new ecs.FargateService(this, &#39;AppService&#39;, {<br>  cluster,<br>  taskDefinition: taskDef,<br>  desiredCount: 2,<br>  assignPublicIp: false,<br>  securityGroups: [appSecurityGroup],        // ← your NetworkStack SG<br>  vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },<br>  minHealthyPercent: 100,<br>  maxHealthyPercent: 200,<br>});</pre><p><strong>CLAUDE.md rule:</strong> Never use ApplicationLoadBalancedFargateService (L3). Use L2 FargateService + ALB separately.</p><h4>4. No startPeriod on Health Checks</h4><pre>// ❌ WRONG — ECS starts health checks immediately, kills tasks before app boots<br>healthCheck: {<br>  command: [&#39;CMD-SHELL&#39;, &#39;curl -f http://localhost:8080/health || exit 1&#39;],<br>  interval: Duration.seconds(30),<br>  retries: 3,<br>  // missing startPeriod — ECS will fail tasks that are still initializing<br>}<br><br>// ✅ CORRECT — give the app time to initialize before health checks begin<br>healthCheck: {<br>  command: [&#39;CMD-SHELL&#39;, &#39;curl -f http://localhost:8080/health || exit 1&#39;],<br>  interval: Duration.seconds(30),<br>  timeout: Duration.seconds(5),<br>  retries: 3,<br>  startPeriod: Duration.seconds(60), // ← 60s minimum; tune higher for cold starts<br>}</pre><p>Without startPeriod, ECS begins health checks the moment the container starts. If your app takes 20–30 seconds to initialize (loading config, warming connection pools, running migrations), ECS marks it unhealthy and kills it before it ever handles a request. Rolling deployments stall at 50% and never complete. The deploy log shows tasks being cycled repeatedly. The fix is always the same: add startPeriod.</p><p><strong>CLAUDE.md rule:</strong> Container health check startPeriod: 60 seconds minimum. ALB target group health check path: /health (not /).</p><h4>5. assignPublicIp Unset (or Set to true)</h4><pre>// ❌ WRONG — sometimes Claude explicitly sets true; other times omits it entirely<br>assignPublicIp: true<br><br>// ✅ CORRECT — always explicit, always false in private subnets<br>assignPublicIp: false</pre><p>Tasks in private subnets with public IPs can be reachable if security group rules are misconfigured. More importantly, relying on the default and having Claude sometimes set it explicitly to true means you can&#39;t audit your infrastructure by reading the code. Always declare it. Always false for compute in private subnets.</p><p><strong>CLAUDE.md rule: </strong>assignPublicIp: false — always explicit.</p><h3>Rolling Deploys Without Downtime</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jm34uQbqHk6U5FZrtibz5Q.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><p>Three properties control whether a rolling deploy is zero-downtime or not. Claude omits all three or gets them wrong:</p><pre>const service = new ecs.FargateService(this, &#39;AppService&#39;, {<br>  cluster,<br>  taskDefinition: taskDef,<br>  desiredCount: 2,<br>  assignPublicIp: false,<br>  securityGroups: [appSecurityGroup],<br>  vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS },<br>  minHealthyPercent: 100,  // ← keep ALL existing tasks running while new ones start<br>  maxHealthyPercent: 200,  // ← allow double the tasks during rollout<br>});<br><br>const targetGroup = listener.addTargets(&#39;AppTargets&#39;, {<br>  port: 8080,<br>  targets: [service],<br>  healthCheck: {<br>    path: &#39;/health&#39;,<br>    interval: Duration.seconds(30),<br>    timeout: Duration.seconds(5),<br>    healthyThresholdCount: 2,<br>    unhealthyThresholdCount: 3,<br>    healthyHttpCodes: &#39;200&#39;,<br>  },<br>  deregistrationDelay: Duration.seconds(30), // ← drain in-flight requests before kill<br>});</pre><p>minHealthyPercent: 100 means ECS must keep all current tasks healthy during the deploy — it starts new tasks before stopping old ones. maxHealthyPercent: 200 gives ECS room to run double the tasks temporarily. deregistrationDelay: 30 tells the ALB to wait 30 seconds after removing a task from rotation before the task is actually stopped — long enough for in-flight requests to complete.</p><p>Without deregistrationDelay, active requests get dropped. Without minHealthyPercent: 100, ECS stops a running task before the replacement is healthy — brief downtime on every deploy. Without maxHealthyPercent: 200, ECS can&#39;t launch new tasks because it hits the desired count ceiling.</p><h3>Autoscaling That Doesn’t Thrash</h3><p>Claude’s default: CPU-only scaling at 50% utilization, starting from one task. Production needs three dimensions and a cooldown that prevents flapping:</p><pre>const scaling = service.autoScaleTaskCount({<br>  minCapacity: 2,    // ← always 2 minimum — never 1<br>  maxCapacity: 20,<br>});<br><br>scaling.scaleOnCpuUtilization(&#39;CpuScaling&#39;, {<br>  targetUtilizationPercent: 70,  // 70 not 50 — avoids scale-out on normal variance<br>  scaleInCooldown: Duration.seconds(300),<br>  scaleOutCooldown: Duration.seconds(60),<br>});<br><br>scaling.scaleOnMemoryUtilization(&#39;MemoryScaling&#39;, {<br>  targetUtilizationPercent: 70,<br>  scaleInCooldown: Duration.seconds(300),<br>  scaleOutCooldown: Duration.seconds(60),<br>});<br><br>scaling.scaleOnRequestCount(&#39;RequestScaling&#39;, {<br>  requestsPerTarget: 500,        // tune to your p95 request rate<br>  targetGroup: targetGroup,<br>  scaleInCooldown: Duration.seconds(300),<br>  scaleOutCooldown: Duration.seconds(60),<br>});</pre><p>The 300-second scale-in cooldown prevents thrashing — ECS won’t scale down tasks that just scaled up. CPU at 70% responds to real pressure rather than normal load variance. Memory scaling catches workloads that are memory-bound, not CPU-bound. Request count scaling responds to traffic spikes before CPU or memory signals register.</p><h3>CLAUDE.md for AppStack</h3><pre>## AppStack Rules<br>1. Never use image tag &#39;latest&#39; — use process.env.IMAGE_TAG (git SHA from CI)<br>2. desiredCount minimum 2 — never 1<br>3. assignPublicIp: false — always explicit<br>4. Never use ApplicationLoadBalancedFargateService (L3) — use L2 FargateService + ALB separately<br>5. Container health check startPeriod: 60s minimum<br>6. ALB target group health check path: /health (not /)<br>7. minHealthyPercent: 100, maxHealthyPercent: 200 for rolling deploys without downtime<br>8. Task role vs execution role: task role = what app code calls at runtime;<br>   execution role = what ECS agent calls at startup. Never combine.<br>   Use ecs.Secret.fromSecretsManager() — CDK auto-grants execution role.<br>   No manual IAM grant needed.</pre><p>This block goes in your project root CLAUDE.md, under the AppStack section. Every CDK session reads it before touching AppStack. The code samples above are the <em>why</em> — this is what Claude needs loaded to stop repeating the same five mistakes in every session.</p><h3>The Series</h3><p>Add the AppStack rules above to your project root CLAUDE.md alongside the rules from Articles 1 and 2 — the file accumulates rules from each stack in the series.</p><ul><li><a href="https://medium.com/@georgetaskos/the-cdk-mental-model-teaching-claude-about-your-stack-4193940faac7">The CDK Mental Model</a> — the 6 CDK defaults, CLAUDE.md foundation, dependency map</li><li><a href="https://medium.com/@georgetaskos/private-by-default-the-network-layer-claude-gets-wrong-every-time-afbfdab37cc5">Private by Default </a>— VPC, subnets, security group chain</li><li>ECS/Fargate with Claude — this article</li><li><a href="https://medium.com/@georgetaskos/aurora-postgresql-16-the-database-claude-shouldnt-touch-alone-c2bf37da9bad">Aurora PostgreSQL 16</a> — the database Claude shouldn’t touch alone</li><li><a href="https://medium.com/@georgetaskos/the-github-actions-pipeline-trunk-based-dev-release-tags-and-ordered-cdk-deploys-65581b282738">The GitHub Actions Pipeline</a> — trunk-based dev, release tags, OIDC</li><li><a href="https://medium.com/@georgetaskos/the-full-stack-loop-running-claude-on-iac-and-application-code-without-drift-6f527ff5861c">The Full Stack Loop</a> — running everything together without drift</li></ul><p><em>CDK Series — Part 3 of 6</em><br>← <a href="https://medium.com/@georgetaskos/private-by-default-the-network-layer-claude-gets-wrong-every-time-afbfdab37cc5">Part 2: Private by Default</a><br>→ <a href="https://medium.com/@georgetaskos/aurora-postgresql-16-the-database-claude-shouldnt-touch-alone-c2bf37da9bad">Part 4: Aurora PostgreSQL 16</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43f400a2e824" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Private by Default: The Network Layer Claude Gets Wrong Every Time]]></title>
            <link>https://georgetaskos.medium.com/private-by-default-the-network-layer-claude-gets-wrong-every-time-afbfdab37cc5?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/afbfdab37cc5</guid>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[aws-cdk]]></category>
            <category><![CDATA[agentic-development]]></category>
            <category><![CDATA[data-security]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Wed, 22 Apr 2026 17:01:05 GMT</pubDate>
            <atom:updated>2026-04-28T17:59:03.095Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>CDK Series — Part 2 of 6 | Six VPC defaults that look fine in dev, fail in production — and what to encode in CLAUDE.md so they don’t</em></h4><p>I told Claude to deploy our app in a private subnet. It did. It also opened port 5432 to 0.0.0.0/0 on the database security group, added two NAT gateways I didn’t ask for, and left allowAllOutbound: true on every security group. Everything worked. The security review didn&#39;t.</p><p>Claude did exactly what it was asked. “Private subnet” is not the same instruction as “production-secure network.” The gap between those two descriptions is where Claude’s defaults live — and they are specific, predictable, and preventable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFT-0YV0YQKtgpPUmzekMQ.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Six Network Defaults Claude Gets Wrong</h3><p>These aren’t obscure edge cases. They’re the defaults — the choices Claude makes every single time you haven’t told it otherwise.</p><h4>Default #1: Using the Default VPC</h4><pre>// ❌ WRONG — What Claude writes without context<br>const vpc = ec2.Vpc.fromLookup(this, &#39;DefaultVpc&#39;, {<br>  isDefault: true,<br>});</pre><p><strong>Why it’s wrong:</strong> The default VPC has public subnets with routes to an Internet Gateway. Resources placed in it can be assigned public IPs. There’s no subnet isolation, no controlled egress, no separation between compute and data tiers. It exists for prototyping and should never host production workloads.</p><pre>// ✅ CORRECT — Explicit VPC with controlled subnet configuration<br>const vpc = new ec2.Vpc(this, &#39;VPC&#39;, {<br>  maxAzs: 2,<br>  natGateways: 1,<br>  subnetConfiguration: [ /* see Default #2 */ ],<br>});</pre><p><strong>CLAUDE.md rule:</strong> Never use ec2.Vpc.fromLookup with isDefault: true. Always create an explicit VPC with subnetConfiguration.</p><h4>Default #2: No Explicit subnetConfiguration</h4><pre>// ❌ WRONG — Creates 1 public + 1 private subnet per AZ, no data isolation<br>const vpc = new ec2.Vpc(this, &#39;VPC&#39;, {<br>  maxAzs: 2,<br>});</pre><p><strong>Why it’s wrong:</strong> Without subnetConfiguration, CDK creates one PUBLIC and one PRIVATE_WITH_EGRESS subnet per AZ. Your database lands in the same subnet tier as your application. There&#39;s no network boundary between compute and data — security groups are the only isolation layer.</p><pre>// ✅ CORRECT — Three explicit tiers with correct subnet types<br>const vpc = new ec2.Vpc(this, &#39;VPC&#39;, {<br>  maxAzs: 2,<br>  natGateways: 1,<br>  subnetConfiguration: [<br>    {<br>      name: &#39;Public&#39;,<br>      subnetType: ec2.SubnetType.PUBLIC,<br>      cidrMask: 24,<br>    },<br>    {<br>      name: &#39;PrivateCompute&#39;,<br>      subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,<br>      cidrMask: 24,<br>    },<br>    {<br>      name: &#39;PrivateData&#39;,<br>      subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS, // see three-tier section for CDK bug note<br>      cidrMask: 28,<br>    },<br>  ],<br>});</pre><p>CLAUDE.md rule: Always define explicit subnetConfiguration with 3 tiers: PUBLIC (ALB), PRIVATE_WITH_EGRESS (compute), and a data tier subnet. Never rely on CDK defaults.</p><h4>Default #3: natGateways Defaulting to 2</h4><pre>// ❌ WRONG — Claude adds multi-AZ NAT without asking about cost<br>const vpc = new ec2.Vpc(this, &#39;VPC&#39;, {<br>  maxAzs: 2,<br>  // natGateways not specified — CDK defaults to 1 per AZ = 2 NAT gateways<br>});</pre><p><strong>Why it’s wrong:</strong> CDK’s default is one NAT Gateway per AZ. With maxAzs: 2, that&#39;s two NAT gateways. Each costs ~$32/month plus $0.045/GB of processed data. You didn&#39;t ask for HA NAT routing. Claude added $64+/month to your infrastructure bill without a conversation.</p><pre>// ✅ CORRECT — Explicit NAT count with a documented decision<br>const vpc = new ec2.Vpc(this, &#39;VPC&#39;, {<br>  maxAzs: 2,<br>  natGateways: 1, // Single NAT for dev/staging. Change to 2 for production HA — this is a cost decision.<br>  subnetConfiguration: [ /* ... */ ],<br>});</pre><p><strong>CLAUDE.md rule</strong>: Set natGateways: 1 explicitly. Never default to CDK&#39;s per-AZ behavior. Production HA NAT (natGateways: 2) is a separate, explicit decision — not a default.</p><h4>Default #4: allowAllOutbound: true on Every Security Group</h4><pre>// ❌ WRONG — CDK&#39;s SecurityGroup default<br>const appSG = new ec2.SecurityGroup(this, &#39;AppSG&#39;, {<br>  vpc,<br>  description: &#39;ECS Fargate tasks&#39;,<br>  // allowAllOutbound defaults to true<br>});</pre><p><strong>Why it’s wrong:</strong> allowAllOutbound: true means every resource in this security group can initiate outbound connections to anywhere on any port. For a database, there&#39;s no legitimate outbound requirement. For an application container, outbound should be scoped to specific ports (ECR pulls, Secrets Manager, your downstream services). Open outbound is a blast radius problem: a compromised container can reach anything.</p><pre>// ✅ CORRECT — Explicit outbound with false as baseline<br>const appSG = new ec2.SecurityGroup(this, &#39;AppSG&#39;, {<br>  vpc,<br>  description: &#39;ECS Fargate tasks — accepts traffic from ALB only&#39;,<br>  allowAllOutbound: false, // explicit egress rules only<br>});<br>// Only add what the application actually needs<br>appSG.addEgressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(443), &#39;HTTPS for ECR/Secrets Manager&#39;);<br><br>const dbSG = new ec2.SecurityGroup(this, &#39;DbSG&#39;, {<br>  vpc,<br>  description: &#39;Aurora PostgreSQL — no outbound&#39;,<br>  allowAllOutbound: false, // databases have zero outbound requirements<br>});</pre><p><strong>CLAUDE.md rule:</strong> Set allowAllOutbound: false on App and DB security groups. Add explicit egress rules only for documented requirements. Databases have zero outbound requirements.</p><h4>Default #5: Database Ports Open to 0.0.0.0/0</h4><pre>// ❌ WRONG — Database port open to the entire internet<br>const dbSG = new ec2.SecurityGroup(this, &#39;DbSG&#39;, { vpc });<br>dbSG.addIngressRule(<br>  ec2.Peer.anyIpv4(),<br>  ec2.Port.tcp(5432),<br>  &#39;PostgreSQL&#39;<br>);</pre><p><strong>Why it’s wrong:</strong> This rule passes a deploy-time check because the database is in a private subnet — subnet routing blocks external traffic. But the rule itself is wrong. It fails security audits, it masks your actual security posture, and it’s one subnet misconfiguration away from a live database with port 5432 exposed to the internet.</p><pre>// ✅ CORRECT — Database ingress from App SG only<br>const dbSG = new ec2.SecurityGroup(this, &#39;DbSG&#39;, {<br>  vpc,<br>  allowAllOutbound: false,<br>});<br>dbSG.addIngressRule(<br>  appSG,  // reference to the App security group, not a CIDR block<br>  ec2.Port.tcp(5432),<br>  &#39;From app tier only&#39;<br>);</pre><p><strong>CLAUDE.md rule:</strong> Database security groups: ingress from App SG only — never ec2.Peer.anyIpv4(). The database accepts connections from one source: the application security group.</p><h4>Default #6: No VPC Endpoints for ECR, S3, and Secrets Manager</h4><pre>// ❌ WRONG — Fargate in private subnets with no VPC endpoints<br>// Claude writes the VPC, the ECS service, the task definition — and stops.<br>// Tasks will fail to start with: ResourceInitializationError</pre><p><strong>Why it’s wrong:</strong> ECS Fargate tasks in private subnets need to pull their container image from ECR and fetch secrets from Secrets Manager at startup. Both of these are AWS API calls. Without a route to the internet (no public subnet, no NAT gateway), and without VPC endpoints, those API calls fail silently. The task stops before the application starts. The CDK deployment succeeds. The ECS service never becomes healthy.</p><pre>// ✅ CORRECT — VPC endpoints for Fargate in private subnets<br>vpc.addInterfaceEndpoint(&#39;EcrApiEndpoint&#39;, {<br>  service: ec2.InterfaceVpcEndpointAwsService.ECR,<br>});<br>vpc.addInterfaceEndpoint(&#39;EcrDockerEndpoint&#39;, {<br>  service: ec2.InterfaceVpcEndpointAwsService.ECR_DOCKER,<br>});<br>vpc.addInterfaceEndpoint(&#39;SecretsManagerEndpoint&#39;, {<br>  service: ec2.InterfaceVpcEndpointAwsService.SECRETS_MANAGER,<br>});<br>// S3 Gateway endpoint — free, needed for ECR layer pulls<br>vpc.addGatewayEndpoint(&#39;S3Endpoint&#39;, {<br>  service: ec2.GatewayVpcEndpointAwsService.S3,<br>});</pre><p><strong>CLAUDE.md rule: </strong>Add VPC endpoints for ECR API, ECR DKR, S3 (gateway), and Secrets Manager when Fargate runs in private subnets. Without these, tasks fail to start with cryptic ResourceInitializationError.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOlZeb-i6r2AN231Yd4P6w.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Three-Tier Architecture Claude Needs to Know About</h3><p>The correct production VPC for this stack isn’t public/private — it’s three tiers, each with a specific purpose and a specific security boundary.</p><p><strong>PUBLIC:</strong> The internet-facing tier. Only the Application Load Balancer lives here. No compute, no databases, no application logic.</p><p><strong>PRIVATE_WITH_EGRESS (PrivateCompute):</strong> The compute tier. ECS Fargate tasks run here. Outbound traffic routes through the NAT Gateway — or through VPC endpoints for AWS API calls. Inbound traffic comes only from the ALB security group.</p><p><strong>PrivateData:</strong> The data tier. Aurora PostgreSQL lives here. No route to the internet. No NAT. VPC-internal only. The only traffic this tier accepts is from the application security group on port 5432.</p><pre>// ✅ Complete three-tier VPC<br>const vpc = new ec2.Vpc(this, &#39;VPC&#39;, {<br>  maxAzs: 2,<br>  natGateways: 1,<br>  subnetConfiguration: [<br>    {<br>      name: &#39;Public&#39;,<br>      subnetType: ec2.SubnetType.PUBLIC,<br>      cidrMask: 24,<br>    },<br>    {<br>      name: &#39;PrivateCompute&#39;,<br>      subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,<br>      cidrMask: 24,<br>    },<br>    {<br>      name: &#39;PrivateData&#39;,<br>      subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS,<br>      cidrMask: 28, // databases don&#39;t need many IPs — /28 = 11 usable<br>    },<br>  ],<br>});</pre><p><strong>A note on PRIVATE_ISOLATED:</strong> CDK has a known issue (<a href="https://github.com/aws/aws-cdk/issues/29256">#29256</a>) where DatabaseCluster fails subnet group validation when placed in PRIVATE_ISOLATED subnets. The production workaround: use PRIVATE_WITH_EGRESS for the data subnet, and enforce data-tier isolation through security groups — allowAllOutbound: false on the DB security group means zero outbound traffic regardless of what the subnet routing allows. Network isolation enforced at the security group layer, not the subnet type.</p><p>VPC endpoints are the piece that makes this architecture work without a NAT Gateway for AWS API traffic. Interface endpoints for ECR API, ECR DKR, and Secrets Manager run inside your VPC. Fargate tasks call these endpoints directly — no NAT traffic, no internet traversal, lower cost, better security posture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9eDfXBLXO2DAOE-oRVH_vg.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Security Group Chain</h3><p>Security groups are not individual rules — they’re a chain. Traffic flows from the internet into the ALB, from the ALB into the application, from the application into the database. Each hop is an explicit allow from the upstream security group. Nothing else.</p><pre>// ✅ ALB Security Group — the only resource that accepts internet traffic<br>const albSG = new ec2.SecurityGroup(this, &#39;AlbSG&#39;, {<br>  vpc,<br>  description: &#39;ALB — accepts internet traffic on 443&#39;,<br>  allowAllOutbound: false,<br>});<br>albSG.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(443), &#39;HTTPS from internet&#39;);<br>albSG.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(80), &#39;HTTP redirect&#39;);<br>albSG.addEgressRule(appSG, ec2.Port.tcp(8080), &#39;Forward to app tier&#39;);<br><br>// ✅ App Security Group — accepts traffic from ALB only<br>const appSG = new ec2.SecurityGroup(this, &#39;AppSG&#39;, {<br>  vpc,<br>  description: &#39;ECS Fargate — accepts from ALB only&#39;,<br>  allowAllOutbound: false,<br>});<br>appSG.addIngressRule(albSG, ec2.Port.tcp(8080), &#39;From ALB only&#39;);<br>appSG.addEgressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(443), &#39;HTTPS for ECR and Secrets Manager&#39;);<br><br>// ✅ DB Security Group — accepts traffic from App only<br>const dbSG = new ec2.SecurityGroup(this, &#39;DbSG&#39;, {<br>  vpc,<br>  description: &#39;Aurora PostgreSQL — accepts from App only&#39;,<br>  allowAllOutbound: false,<br>});<br>dbSG.addIngressRule(appSG, ec2.Port.tcp(5432), &#39;From app tier only&#39;);<br>// No egress rules — databases have zero outbound requirements</pre><p>The chain matters because each security group is the source for the next ingress rule. The ALB security group is referenced in the App ingress rule. The App security group is referenced in the DB ingress rule. Audit your security posture and you see exactly one traffic path: internet → ALB (443) → App (8080) → DB (5432).</p><h3>CLAUDE.md for NetworkStack</h3><p>These are the six rules that prevent every default covered in this article. Copy this block into your project’s CLAUDE.md before you give Claude Code the first network prompt.</p><pre>## NetworkStack Rules<br><br>1. Always define explicit subnetConfiguration with 3 tiers:<br>   PUBLIC (ALB), PRIVATE_WITH_EGRESS (compute/PrivateCompute), and<br>   PRIVATE_WITH_EGRESS (data/PrivateData — see CDK issue #29256 re: ISOLATED).<br><br>2. natGateways: 1 — not 2. One NAT is sufficient for dev/staging.<br>   Production HA (natGateways: 2) requires an explicit human decision — do not default to it.<br><br>3. allowAllOutbound: false on App SG and DB SG.<br>   Add explicit egress rules only. Databases have zero outbound requirements.<br><br>4. Database security groups: ingress from App SG only.<br>   Never ec2.Peer.anyIpv4() on port 5432 or any database port.<br><br>5. Add VPC endpoints when Fargate runs in private subnets:<br>   ECR API (interface), ECR DKR (interface), Secrets Manager (interface), S3 (gateway, free).<br>   Without these, Fargate tasks fail to pull images — ResourceInitializationError.<br><br>6. Placement rules — never mix tiers:<br>   ALB → PUBLIC subnets<br>   ECS Fargate → PRIVATE_WITH_EGRESS (PrivateCompute)<br>   Aurora → PRIVATE_WITH_EGRESS (PrivateData), isolated at security group layer</pre><p>The format matters. These aren’t suggestions — they’re constraints Claude reads before it touches your network infrastructure. Add this block to your project root CLAUDE.md alongside the rules from Article 1 — the file grows with each stack in the series.</p><h3>The Series</h3><p>This is article two in a six-part series on building production infrastructure with Claude Code as an active collaborator.</p><ul><li><a href="https://medium.com/@georgetaskos/the-cdk-mental-model-teaching-claude-about-your-stack-4193940faac7">The CDK Mental Model </a>— the 6 CDK defaults Claude gets wrong, the CLAUDE.md foundation, dependency map across all stacks</li><li>Private by Default — this article: the network layer, six VPC defaults, security group chain, CLAUDE.md for NetworkStack</li><li><a href="https://medium.com/@georgetaskos/ecs-fargate-with-claude-five-defaults-that-will-fail-you-in-production-43f400a2e824">ECS/Fargate with Claude</a> — task definitions, container secrets, autoscaling, health checks</li><li><a href="https://medium.com/@georgetaskos/aurora-postgresql-16-the-database-claude-shouldnt-touch-alone-c2bf37da9bad">Aurora PostgreSQL 16</a> — the database Claude shouldn’t configure alone: cluster parameters, backup policies, IAM auth</li><li><a href="https://medium.com/@georgetaskos/the-github-actions-pipeline-trunk-based-dev-release-tags-and-ordered-cdk-deploys-65581b282738">The GitHub Actions Pipeline</a> — trunk-based development, release tags, OIDC role assumption, no long-lived credentials</li><li><a href="https://medium.com/@georgetaskos/the-full-stack-loop-running-claude-on-iac-and-application-code-without-drift-6f527ff5861c">The Full Stack Loop</a> — running all six stacks together, cross-stack SSM wiring, drift detection</li></ul><p>NetworkStack comes first — everything else imports from it via SSM. Get it right and every subsequent stack builds on a clean foundation.</p><p><em>CDK Series — Part 2 of 6</em><br>← <a href="https://medium.com/@georgetaskos/the-cdk-mental-model-teaching-claude-about-your-stack-4193940faac7">Part 1: The CDK Mental Model</a><br>→ <a href="https://medium.com/@georgetaskos/ecs-fargate-with-claude-five-defaults-that-will-fail-you-in-production-43f400a2e824">Part 3: ECS/Fargate with Claude</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afbfdab37cc5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The CDK Mental Model: Teaching Claude About Your Stack]]></title>
            <link>https://georgetaskos.medium.com/the-cdk-mental-model-teaching-claude-about-your-stack-4193940faac7?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4193940faac7</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[agentic-development]]></category>
            <category><![CDATA[claude-code-skills]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Tue, 21 Apr 2026 15:13:24 GMT</pubDate>
            <atom:updated>2026-04-21T15:13:24.240Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>CDK Series — Part 1 of 6 | How to give Claude Code enough context to write CDK that matches your architecture — not generic boilerplate</em></h4><p>The first time I asked Claude Code to write a CDK stack, it wrote working infrastructure. It also named every resource explicitly, set removalPolicy: DESTROY on the database “for easy cleanup,” and used AmazonS3FullAccess on the task role. The code deployed. The problems came later.</p><p>That gap — between code that deploys and code that belongs in production — is a context problem, not a capability problem. Claude knows CDK. It doesn’t know <em>your</em> CDK. It doesn’t know your naming conventions, your security posture, your multi-environment topology, or the fact that a cdk destroy run in the wrong terminal window should never be able to take your database with it.</p><p>The fix isn’t a better prompt. It’s a better context file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DeibcXy_rvu3vXI_ciHCXg.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>What Claude Gets Right by Default</h3><p>Claude Code is genuinely capable at CDK. Give it a VPC and ask it to attach an ECS Fargate service, and it wires the subnet references correctly. It knows SubnetType.PRIVATE_WITH_EGRESS for compute, puts databases in isolated subnets, and synthesizes L2 constructs — ecs.FargateService, rds.DatabaseCluster, ec2.ApplicationLoadBalancer — with types that compile and service principals that are right. A stack that would take two hours to stub out correctly comes back in three minutes.</p><h3>The Six Things Claude Gets Wrong Without Context</h3><p>These aren’t obscure edge cases. They’re the defaults — the choices Claude makes every time you haven’t told it otherwise.</p><h4>1. Hardcoded Resource Names</h4><p>Claude names things. It’s trying to be helpful, and the code looks cleaner with a real name. The production problem surfaces the moment you try to deploy to a second environment.</p><pre>// ❌ WRONG — What Claude writes without context<br>new s3.Bucket(this, &#39;AssetsBucket&#39;, {<br>  bucketName: &#39;my-app-assets&#39;,  // hardcoded — deploy this twice and you get BucketAlreadyExists<br>});</pre><p>S3 bucket names are globally unique. Hardcode it, and your second environment — staging, a colleague’s dev account — throws BucketAlreadyExists on deploy. The fix:</p><pre>// ✅ CORRECT — CDK generates &lt;stack-name&gt;-assetsbucket-&lt;unique-hash&gt;<br>new s3.Bucket(this, &#39;AssetsBucket&#39;, {<br>  // no bucketName — unique across environments by default<br>  removalPolicy: RemovalPolicy.RETAIN,<br>  encryption: s3.BucketEncryption.S3_MANAGED,<br>});</pre><p>CLAUDE.md rule: Never hardcode resource names. Omit bucketName, queueName, tableName, clusterIdentifier unless a specific name is architecturally required. Let CDK generate unique names.</p><h4>2. removalPolicy: DESTROY on Stateful Resources</h4><p>Claude sets this for “dev-friendly” stacks. CDK’s actual default is RETAIN — Claude overrides the safe default to be convenient.</p><pre>// ❌ WRONG — One cdk destroy away from data loss<br>new rds.DatabaseCluster(this, &#39;Database&#39;, {<br>  engine: rds.DatabaseClusterEngine.auroraPostgres({<br>    version: rds.AuroraPostgresEngineVersion.VER_16_1,<br>  }),<br>  removalPolicy: RemovalPolicy.DESTROY,  // &quot;for easy cleanup during development&quot;<br>  applyRemovalPolicyToInstances: true,<br>});</pre><p>The production consequence: cdk destroy deletes your database. A mistaken stack deletion via console. A CloudFormation rollback on a failed update. Any of these executes the policy.</p><pre>// ✅ CORRECT — RETAIN is the only acceptable production posture<br>new rds.DatabaseCluster(this, &#39;Database&#39;, {<br>  engine: rds.DatabaseClusterEngine.auroraPostgres({<br>    version: rds.AuroraPostgresEngineVersion.VER_16_1,<br>  }),<br>  removalPolicy: RemovalPolicy.RETAIN,<br>  deletionProtection: true,  // CloudFormation will refuse to delete while this is true<br>});</pre><p>CLAUDE.md rule: removalPolicy: RETAIN for any DatabaseCluster, DatabaseInstance, S3 Bucket with data, or stateful storage. Add deletionProtection: true on database resources. Never set DESTROY on anything that holds user data.</p><h4>3. Logical ID Instability</h4><p>This one is silent until it causes a production incident.</p><pre>// ❌ WRONG — Construct IDs become CloudFormation logical IDs<br>new rds.DatabaseCluster(this, &#39;Database&#39;, { ... });<br><br>// Claude refactors for clarity in a later session:<br>new rds.DatabaseCluster(this, &#39;ProductionDatabase&#39;, { ... });<br>// CloudFormation now sees a NEW resource. It deletes &#39;Database&#39; and creates &#39;ProductionDatabase&#39;.<br>// Your data is gone.</pre><p>CloudFormation uses the construct ID as the logical ID of the resource. Rename it and CloudFormation treats it as a delete + create of a new resource. There’s no warning in the diff. Claude refactors cleanly and without hesitation — which is exactly the problem.</p><pre>// ✅ CORRECT — Construct IDs are permanent contracts, not display names<br>new rds.DatabaseCluster(this, &#39;Database&#39;, {<br>  // This ID cannot be changed on a deployed resource.<br>  // If the name seems wrong, add a comment. Do not rename.<br>  ...<br>});</pre><p>CLAUDE.md rule: Never rename construct IDs of deployed stateful resources. Construct IDs are CloudFormation logical IDs. Renaming = delete + recreate. If a rename seems right, add a comment and stop — bring it to a human decision, do not execute it.</p><h4>4. IAM Managed Policies Instead of Grant Methods</h4><p>AWS managed policies are well-documented and comprehensive. That’s exactly the problem.</p><pre>// ❌ WRONG — AmazonS3FullAccess grants access to EVERY bucket in the account<br>const taskRole = new iam.Role(this, &#39;TaskRole&#39;, {<br>  assumedBy: new iam.ServicePrincipal(&#39;ecs-tasks.amazonaws.com&#39;),<br>});<br>taskRole.addManagedPolicy(<br>  iam.ManagedPolicy.fromAwsManagedPolicyName(&#39;AmazonS3FullAccess&#39;)<br>);</pre><p>A compromised ECS task with this role can read, write, and delete every S3 bucket in your account. Your task needs one bucket. Claude gave it all of them.</p><pre>// ✅ CORRECT — Scope permissions to specific resources using grant methods<br>const taskRole = new iam.Role(this, &#39;TaskRole&#39;, {<br>  assumedBy: new iam.ServicePrincipal(&#39;ecs-tasks.amazonaws.com&#39;),<br>});<br>assetsBucket.grantRead(taskRole);           // read this bucket only<br>uploadsBucket.grantReadWrite(taskRole);     // read/write this bucket only<br>auditQueue.grantSendMessages(taskRole);     // send to this queue only</pre><p>CLAUDE.md rule: Use grant methods for IAM permissions: bucket.grantRead, queue.grantSendMessages, table.grantReadWriteData. Never addManagedPolicy() with AWS managed policies on task roles or execution roles.</p><h4>5. Security Groups with 0.0.0.0/0 Ingress</h4><p>Claude writes security group rules that work — not security group rules that are minimal.</p><pre>// ❌ WRONG — Compute layer accepting traffic from the entire internet<br>const appSG = new ec2.SecurityGroup(this, &#39;AppSG&#39;, { vpc });<br>appSG.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(443), &#39;Allow HTTPS&#39;);</pre><p>In private subnets, routing blocks external traffic — so it doesn’t immediately cause an incident. But it masks your security posture, fails audits, and is already wrong if subnets ever change.</p><pre>// ✅ CORRECT — Security group chaining: internet → ALB → App → DB<br>const albSG = new ec2.SecurityGroup(this, &#39;AlbSG&#39;, { vpc });<br>const appSG = new ec2.SecurityGroup(this, &#39;AppSG&#39;, {<br>  vpc,<br>  allowAllOutbound: false,<br>});<br>const dbSG = new ec2.SecurityGroup(this, &#39;DbSG&#39;, {<br>  vpc,<br>  allowAllOutbound: false,<br>});<br><br>albSG.addIngressRule(ec2.Peer.anyIpv4(), ec2.Port.tcp(443), &#39;Public HTTPS to ALB&#39;);<br>appSG.addIngressRule(albSG, ec2.Port.tcp(8080), &#39;ALB to App only&#39;);<br>dbSG.addIngressRule(appSG, ec2.Port.tcp(5432), &#39;App to DB only&#39;);</pre><p>CLAUDE.md rule: Never use ec2.Peer.anyIpv4() for compute or database security groups. Security group chaining only: ALB SG → App SG → DB SG. Set allowAllOutbound: false unless you have a documented reason. The ALB is the only resource that accepts internet traffic.</p><h4>6. Missing Stack Environment Binding</h4><p>Unbound stacks look fine in development and fail in production in ways that are surprisingly hard to debug.</p><pre>// ❌ WRONG — Environment-agnostic stack<br>new MyStack(app, &#39;MyStack&#39;);<br>// CDK uses dummy account/region values during synth.<br>// Cross-stack references are brittle. AZ-dependent logic produces incorrect output.</pre><p>Unbound stacks get dummy account/region tokens during synthesis. Resources that depend on AZ counts or cross-stack lookups produce outputs that look correct but aren’t — and the misconfiguration surfaces in production.</p><pre>// ✅ CORRECT — Always bind stacks to explicit environment<br>new MyStack(app, &#39;MyStack&#39;, {<br>  env: {<br>    account: process.env.CDK_ACCOUNT ?? process.env.CDK_DEFAULT_ACCOUNT,<br>    region: process.env.CDK_REGION ?? process.env.CDK_DEFAULT_REGION,<br>  },<br>});</pre><p>CLAUDE.md rule: Always bind stacks to env: { account, region }. Use CDK_ACCOUNT and CDK_REGION env vars. Environment-agnostic stacks are not acceptable for production infrastructure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4PavsElfwHA0NweXCmeuQ.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Dependency Map (Before Claude Touches Code)</h3><p>The deployment chain for ECS/Fargate + Aurora is non-negotiable:</p><pre>VPC → Subnets + Security Groups → ECS Cluster → ECS Service + Task Definition<br>                                ↘ Aurora Cluster → Aurora Instances<br>                                ↘ Secrets Manager secret → Task Definition env</pre><p>You cannot deploy ECS before the VPC. You cannot deploy Aurora before the subnet group. This looks like it prevents parallel Claude sessions — but it doesn’t, if you decompose stacks correctly.</p><h3>SSM Parameter Store as the Loose Coupling Pattern</h3><p>CloudFormation Exports (CfnOutput + Fn.importValue) create hard coupling: CloudFormation refuses to update the exporting stack while the importing stack references its output. NetworkStack and AppStack become entangled — a Claude session working on network changes can&#39;t deploy while AppStack is live against the same export.</p><p>SSM Parameter Store breaks that coupling:</p><pre>// NetworkStack — write VPC details to SSM after creation<br>import * as ssm from &#39;aws-cdk-lib/aws-ssm&#39;;<br><br>new ssm.StringParameter(this, &#39;VpcIdParam&#39;, {<br>  parameterName: `/myapp/${props.env}/vpc-id`,<br>  stringValue: this.vpc.vpcId,<br>});<br>new ssm.StringParameter(this, &#39;PrivateSubnetIdsParam&#39;, {<br>  parameterName: `/myapp/${props.env}/private-subnet-ids`,<br>  stringValue: this.vpc.privateSubnets.map(s =&gt; s.subnetId).join(&#39;,&#39;),<br>});<br><br>// AppStack — read from SSM at CloudFormation deploy time (not synth time)<br>const vpcId = ssm.StringParameter.valueForStringParameter(<br>  this,<br>  `/myapp/${props.env}/vpc-id`<br>);</pre><p>SSM resolves at CloudFormation deploy time, not CDK synth time. The stacks are decoupled. Each can be authored, modified, and deployed independently.</p><h3>Three-Track Claude Session Model</h3><p>With SSM decoupling in place, IaC maps cleanly to three independent tracks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*jqLpwswV_gi-z2IswVQwrA.png" /></figure><p>Deployment is still sequential — CloudFormation enforces the dependency order. But authoring is parallel. Three Claude sessions write three stacks simultaneously, no file conflicts, because each track owns its files and reads cross-stack values from SSM.</p><p>Before Claude writes a single construct: declare the dependency map, define the SSM parameter paths, assign file ownership per session.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sVaSOsTvhfExHrtAmlwgxA.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>Your CLAUDE.md for CDK</h3><p>Seven rules. Ready to copy into your project root. These apply to every CDK file in the repository.</p><pre># CDK Rules — Read Before Writing Any Infrastructure Code<br><br>1. Never hardcode resource names. Omit bucketName, queueName, tableName, clusterIdentifier.<br>   Let CDK generate unique names. If a suffix is needed: Stack.of(this).stackName + &#39;-&#39; + purpose.<br><br>2. removalPolicy: RETAIN for all stateful resources — DatabaseCluster, DatabaseInstance,<br>   Bucket (with data), FileSystem. Add deletionProtection: true on databases.<br>   Never set DESTROY on anything that holds user data.<br><br>3. Never rename deployed construct IDs. Construct IDs are CloudFormation logical IDs.<br>   Renaming a deployed resource&#39;s construct ID = CloudFormation deletes and recreates it.<br>   If a name seems wrong, add a comment. Do not rename. Escalate to human decision.<br><br>4. Use grant methods for IAM permissions: bucket.grantRead(role),<br>   queue.grantSendMessages(role), table.grantReadWriteData(role).<br>   Never addManagedPolicy() with AWS managed policies on task or execution roles.<br><br>5. Never use ec2.Peer.anyIpv4() for compute or database security groups.<br>   Security group chaining only: ALB SG → App SG → DB SG.<br>   Set allowAllOutbound: false on compute and data security groups.<br><br>6. Always bind stacks to env: { account: process.env.CDK_ACCOUNT, region: process.env.CDK_REGION }.<br>   Environment-agnostic stacks are not acceptable.</pre><p>CLAUDE.md files stack at every directory level. Project-root rules apply everywhere. Stack-specific rules go in lib/network-stack/CLAUDE.md, lib/data-stack/CLAUDE.md, lib/app-stack/CLAUDE.md — each with the file ownership boundary and SSM parameter paths that Claude session needs.</p><h3>The Gate Claude Must Pass Before Every PR</h3><p>Add cdk-nag to your app entry point. It runs at synth time and catches violations that survive despite the CLAUDE.md rules:</p><pre>// bin/app.ts<br>import { App, Aspects } from &#39;aws-cdk-lib&#39;;<br>import { AwsSolutionsChecks } from &#39;cdk-nag&#39;;<br><br>const app = new App();<br>// All stacks defined here<br>Aspects.of(app).add(new AwsSolutionsChecks({ verbose: true }));</pre><p>cdk-nag catches S3 buckets without encryption, security groups with open ingress, IAM managed policies on task roles, and RDS without deletion protection. It runs during cdk synth — meaning Claude&#39;s output fails the automated gate before it ever reaches a deployment attempt. This is the difference between catching problems in CI and catching them in production.</p><p>Two layers. CLAUDE.md prevents the defaults. cdk-nag validates the output at synth time — the difference between catching problems in CI and catching them in production.</p><h3>The Series</h3><ul><li><a href="https://georgetaskos.medium.com/">The CDK Mental Model</a> — this article</li><li>Private by Default [Coming Soon] — VPC, subnets, security posture</li><li>ECS/Fargate with Claude [Coming Soon] — task definitions, secrets, autoscaling</li><li>Aurora PostgreSQL 16 [Coming Soon] — the database Claude shouldn’t touch alone</li><li>The GitHub Actions Pipeline [Coming Soon] — trunk-based dev, release tags, OIDC</li><li>The Full Stack Loop [Coming Soon] — running everything together without drift</li></ul><p><em>CDK Series — Part 1 of 6 </em>→ Part 2: Private by Default</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4193940faac7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You Made Claude Faster. Then You Made Yourself the Bottleneck.]]></title>
            <link>https://georgetaskos.medium.com/you-made-claude-faster-then-you-made-yourself-the-bottleneck-6e2910632836?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e2910632836</guid>
            <category><![CDATA[agentic-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[claude-code]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 14:52:47 GMT</pubDate>
            <atom:updated>2026-04-13T14:52:47.775Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>The PR review process was designed for human-written code. It’s breaking under AI-generated volume — and the fix isn’t more reviewers.</em></h4><p>Every article in this series has been about making Claude faster. This one is about what happens when you succeed.</p><p>You wrote the spec. You ran the execution loop. You parallelized across five worktrees and conducted the fleet. You shipped. Claude is producing code at a pace your team couldn’t have matched twelve months ago.</p><p>Then your PR queue backed up. Incidents per PR went up. A production regression slipped through review — in code nobody on the team fully understood because nobody wrote it. And somewhere in the middle of reviewing a 600-line diff, you realized: the bottleneck didn’t disappear. It moved.</p><p>You didn’t have a coding problem anymore. You had a review problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_MKmMPE16xHWVZ7g-IRBwA.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Bottleneck Moved</h3><p>The data is hard to argue with.</p><p>According to the Cortex <em>Engineering in the Age of AI: 2026 Benchmark Report</em>, PRs per author are up 20% year-over-year. Incidents per PR are up 23.5%. Change failure rates are up 30%. The Faros AI / DORA 2025 telemetry found PR size increased 154% with AI adoption. Greptile’s <em>State of AI Coding 2025</em> tracked median PR size up 33% from March to November alone.</p><p>The production rate went up. The review rate didn’t.</p><p>This isn’t a criticism of Claude. It’s the expected result of accelerating one stage of a system without touching the rest. You removed the coding bottleneck. The system didn’t get faster — the bottleneck moved downstream, to the human who has to approve what the machine produced.</p><p>More engineers isn’t the answer. The math doesn’t support it. Production velocity is compounding; review throughput is flat. You can’t hire your way out of a structural sampling problem.</p><h3>You Can’t Sample a High-Frequency Signal with a Low-Frequency Process</h3><p>Dave Farley, in his talk on Continuous Delivery, applied the Nyquist-Shannon sampling theorem to software: to accurately represent a signal, you must sample it at least twice as fast as the highest frequency in that signal.</p><p>Applied to code review: your defect detection rate must exceed your production rate, or you will miss problems not occasionally <strong>—</strong> <strong>systematically</strong>.</p><p>That’s the situation you’re in. AI raised the production frequency. Review didn’t raise its frequency. You’re under-sampling — structurally, not randomly. The defects that slip through aren’t bad luck. They’re what Nyquist predicts when the sampling rate can’t keep up.</p><h3>The 400-Line Ceiling</h3><p>There’s a concrete number behind this. SmartBear and Cisco’s research established that human reviewers detect defects well up to roughly 400 lines of diff — then detection ability degrades sharply. Reviewers stop reading and start skimming. They start pattern-matching on structure rather than reasoning about behavior.</p><p>Claude can generate 600+ lines in a single prompt. A single agent session can open a PR that blows past the human review ceiling in one shot.</p><p>You’re not getting a review of that PR. You’re getting a rubber stamp. The reviewer is looking at the diff thinking they’re doing quality control. They’re not. They’re doing document approval.</p><p>This isn’t a staffing problem. It’s a systems problem. The fix is engineering, not headcount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Io_Z0ESFYufbZsaQBFbahQ.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Convention Drift Nobody Talks About</h3><p>The quality problem isn’t just volume. It’s type.</p><p>CodeRabbit’s research puts it precisely: AI generates surface-level correctness. Syntax is right. Tests pass. CI is green. But naming patterns, architectural norms, and formatting conventions drift toward generic defaults. The code looks right. The review passes. Six weeks later, someone discovers the abstraction ignored the one integration quirk that everyone on the team for more than a year knows about — because nobody told Claude, and nobody caught it in review.</p><p>The categories reviewers are supposed to catch — and reliably miss at scale:</p><ul><li>Syntax and style → can be automated</li><li>Security flaws → attack surface too large for manual inspection at volume</li><li>Logic bugs → miss rate spikes past 400 lines</li><li><strong>Architecture drift</strong> → requires knowing intended architecture; most reviewers don’t have that loaded in their head when reviewing AI diffs</li><li>Performance regressions → can’t benchmark in your head at 600 lines</li><li>API breaking changes → downstream impact isn’t visible in the diff</li></ul><h3>You Can’t Review What You Don’t Understand</h3><p>There’s a second-order failure that goes undiscussed. When Claude writes the code and you rubber-stamp the PR, you don’t just risk a bug. You break the knowledge transfer mechanism that makes engineering teams resilient.</p><p>In a traditional workflow, the author understands the code. The reviewer builds understanding through the review. That double-coverage is the institutional knowledge system. It’s how the on-call engineer at 2 AM knows what the code is supposed to do — because they reviewed it, or worked with the person who wrote it.</p><p>When the author is an AI agent and the review is a skim, that mechanism is gone. The code is in production. Nobody owns the mental model. The incident happens. Nobody can explain why the code does what it does because nobody ever understood it.</p><p>This is the long-term cost nobody’s tracking in their DORA metrics.</p><h3>What Actually Helps — Three Layers</h3><p>I’m not going to give you a tool comparison. CodeRabbit vs Qodo isn’t the answer. Here’s the framework that’s actually worked in production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KKm2rjhbNb41zWJEqURZnA.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><p><strong>Layer 1: Automate everything automatable.</strong></p><p>Style enforcement, security pattern scanning, test coverage gates — these should never reach a human reviewer. Every minute a senior engineer spends flagging a missing semicolon or a known vulnerable dependency pattern is a minute not spent on the architectural decision that actually needs a human.</p><p>Tools like Danger.js and Reviewdog run rule-based checks as part of CI. AI-powered reviewers like CodeRabbit and Qodo go further — PR summaries, inline suggestions, codebase-aware analysis. The goal isn’t to replace human review. It’s to raise the feedback sampling rate on everything that can be sampled automatically, so human attention lands on what requires genuine judgment.</p><p>Automated review bots also help with the 400-line problem. A PR summary that collapses a 600-line diff into “auth middleware refactor with three behavior changes” is not a substitute for deep review — but it’s a better starting point than staring at 600 lines cold.</p><p><strong>Layer 2: Codify your conventions explicitly.</strong></p><p>LLMs are stateless. Claude knows nothing about your codebase at session start. CLAUDE.md (or AGENTS.md) is the only file that goes into every single session by default — it’s how you onboard the agent each time: your stack, your patterns, your non-negotiables.</p><p>The catch, and it’s a real one: Claude’s system prompt explicitly says the context file “may or may not be relevant to the current task.” That’s not a documentation quirk. It’s a behavioral flag. Claude will ignore CLAUDE.md if it decides the contents don’t apply. I’ve seen this in production. It’s not rare.</p><p>The practical implication: keep CLAUDE.md tight (150–200 instructions max for frontier models), focused on conventions that apply universally, and use /prime re-injection at phase boundaries rather than relying on the agent to remember session-open context across a long session.</p><p><strong>Layer 3: Reserve humans for what only humans can judge.</strong></p><p>Architectural intent. Domain context. Institutional knowledge. Roadmap alignment. These are the four things that no automated tool can evaluate reliably in 2026 — because they require knowing things that aren’t in the diff.</p><p>The review that matters isn’t “is this code correct?” AI can mostly answer that. The review that matters is “is this code correct <em>for where we’re going</em>?” That requires a human who knows where you’re going.</p><p>At WeAre8, content moderation agents run 24/7. The PR review problem there isn’t abstract — it’s the extreme version of everything described above: high-volume AI output, production consequences, no option to slow down the generation rate. The question we kept coming back to isn’t “how do we read more PRs?” It’s “how do we raise the sampling rate on what actually matters?”</p><p>That’s the right question for any team running production AI at volume.</p><h3>The Unsolved Part</h3><p>Here’s what nobody has cleanly built yet: the semantic convention enforcement layer.</p><p>CLAUDE.md tells the agent what to follow. That’s step one. Step two — verifying that it actually followed your conventions in the output — is effectively unsolved at scale in 2026.</p><p>You can check syntax. You can run linters. You can scan for known vulnerability patterns. What you can’t easily do is run an automated check that asks: “Does this PR’s architecture match the patterns in our codebase? Does the naming align with our domain model? Did the agent honor the service boundary we defined three months ago?”</p><p>Greptile has a version of codebase-aware analysis. Multi-model review pipelines (Claude for generation, a separate model for audit) are emerging. The real question isn’t whether to automate — it’s: <em>have you started building out those review rules yet, or are you still figuring out what to codify?</em></p><p>The honest answer is: figuring out what to codify. That’s where most teams are. The codification layer is ahead of the verification layer by at least a generation of tooling.</p><p>That gap matters because it means the convention drift problem described earlier isn’t going away soon. The best you can do today is narrow it: codify explicitly, automate what’s automatable, and put human attention on the boundary decisions that carry the most architectural weight.</p><p>The alternative — doing nothing and trusting that AI-generated code will follow conventions it hasn’t been told about — is how you get 154% larger PRs and 23.5% more incidents, which is exactly where the data says most teams are right now.</p><h3>The Series</h3><p>This is Blueprint Series #6 — the first article about what happens after Claude opens the PR.</p><p>The series so far:</p><ul><li><a href="https://georgetaskos.medium.com/the-attack-document-write-the-spec-before-claude-touches-code-d40c5b50b0b2">The Attack Document</a> — write the spec before Claude touches code; the two-file contract that makes agents execute instead of decide</li><li><a href="https://georgetaskos.medium.com/the-execution-loop-from-spec-to-merged-pr-with-claude-code-d1fcc5ef8c86">The Execution Loop</a> — spec to merged PR; the Ralph Loop (lint → typecheck → tests → build) as the production pipeline</li><li><a href="https://georgetaskos.medium.com/scaling-the-loop-run-5-claude-code-sessions-in-parallel-with-conductor-build-539b52888a81">Scaling the Loop</a> — five parallel Claude Code sessions; conductor.build, git worktrees, parallel execution without code contamination</li><li><a href="https://georgetaskos.medium.com/the-conductors-playbook-f64bc77d1bf4">The Conductor’s Playbook</a> — the seven failure modes of agent fleet management; three roles, strictly sequenced</li><li><a href="https://medium.com/@georgetaskos/how-to-end-a-claude-code-session-f2a27467262b">How to End a Claude Code Session</a> — context compaction, the /handoff artifact, and why how you close matters as much as how you open</li></ul><p>The series has covered the full lifecycle of generating code with Claude. Articles 1–5 were about making the machine faster. Article 6 is about what you do when the machine is fast and you’re the constraint.</p><p><em>George Taskos is a CTO and entrepreneur with 17 years building production AI systems. He writes the Blueprint Series on engineering with Claude Code.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e2910632836" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MCP vs CLI: Why Both Camps Are Half Right]]></title>
            <link>https://georgetaskos.medium.com/mcp-vs-cli-why-both-camps-are-half-right-b38bb1f3bf94?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b38bb1f3bf94</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[agentic-applications]]></category>
            <category><![CDATA[command-line-interface]]></category>
            <category><![CDATA[ai-agent-development]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 10:01:02 GMT</pubDate>
            <atom:updated>2026-04-13T10:01:02.985Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>The debate isn’t about which tool is better. It’s about which problem you’re actually solving.</em></h4><p>Perplexity dropped MCP. The internet declared it dead.</p><p>Two weeks later, enterprise engineering teams were still deploying it. Not in spite of the Perplexity news — without knowing about it. In fact, several teams I’ve observed in enterprise AI deployments accelerated their MCP rollouts during the same window the “MCP is dead” discourse peaked on X.</p><p>That’s not a contradiction. That’s a signal. The two groups aren’t having the same debate. They’re solving fundamentally different problems, using the same vocabulary, talking past each other entirely.</p><p>Here’s what’s actually happening — and why it matters more than the tribal score-keeping.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kVPWeUsicQPVr2679jUWZw.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Real Debate Nobody’s Having</h3><p>The MCP vs CLI flame war looks like a protocol argument. Tool selection, performance, overhead, security — real concerns, framed as tribal allegiance.</p><p>But strip away the noise and you find a more fundamental question underneath: <strong>are you building for individual developer productivity, or organizational-scale agentic infrastructure?</strong></p><p>Those are different problems. They require different solutions. And the practitioners who treat them as the same problem are the ones losing time to the wrong tool.</p><p>CLI wins one problem. MCP wins the other. The mistake is picking a camp instead of picking the right tool for the context you’re actually in.</p><p>This piece isn’t an MCP advocacy piece. Both sides have legitimate arguments. What both sides are missing is where those arguments actually apply.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UPnw4X4ntUnwMe9yxVKICw.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>Where CLI Wins: The Token Math Is Real</h3><p>The most concrete piece of evidence in this debate is a benchmark from Jannik Reinhard published in February 2026. He measured actual token consumption between GitHub’s MCP server and the gh CLI for the same task.</p><p>The result: ~55,000 tokens for the MCP server (93 tool definitions loaded) versus ~200 tokens for the equivalent gh CLI invocation.</p><p>That’s a 35x difference.</p><p>For a developer running agents locally — experimenting, debugging, building personal tooling — that overhead matters. It inflates costs on every run. It bloats context windows. It pushes you closer to limits faster. When you’re iterating quickly on a dev machine, 35x token inflation isn’t abstract — it shows up in your OpenAI bill and your latency.</p><p>The 93 tool definitions are the source of the bloat. When an MCP server initializes, it announces everything it can do — every tool, every parameter schema, every description. The agent’s context absorbs all of it, whether it needs one tool or fifty. For a task that needs one CLI command, loading the full manifest is waste, not capability.</p><p>The CLI also offers something underrated: predictability. You know what the tool does. The input/output contract is documented, stable, and familiar. There’s no spec negotiation, no dynamic tool discovery overhead, no schema parsing at runtime. For the use cases where you control the environment and know what you need, CLI is genuinely the right call.</p><p>Perplexity’s move from MCP to CLI made sense within this context. For certain retrieval workflows with high call frequency, the overhead wasn’t worth it. That’s not a verdict on MCP. It’s a verdict on using MCP for the wrong problem. And it’s a verdict more engineers should internalize rather than amplify into a universal declaration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKfdWcAa_3LNV2vBRIK6Bg.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Distinction Nobody’s Making: stdio vs HTTP</h3><p>Before going further, there’s a technical split in the MCP world that almost never gets acknowledged in the public debate, and it changes the entire overhead analysis.</p><p><strong>Local MCP over stdio</strong> — the most common dev setup — has high instantiation overhead. You’re spinning up a server process, initializing the full protocol, loading the complete tool manifest on every invocation. This is the configuration most people criticize, and the criticism is fair.</p><p><strong>Server MCP over HTTP</strong> — the enterprise configuration — operates differently. The server is persistent. Tool discovery happens once at connection time. Connections are long-lived. The overhead profile looks nothing like the stdio benchmark that drives the “MCP is slow and bloated” narrative.</p><p>When Jannik Reinhard’s 35x number gets cited as a universal indictment of MCP, it’s actually an indictment of <em>stdio MCP for dev use cases</em>. That’s a legitimate finding. It’s just not the same as “MCP is broken.”</p><p>The two configurations have different threat profiles, different overhead characteristics, and different appropriate use cases. Collapsing them into a single “MCP” label is how the debate generates more heat than light.</p><p>If you’re evaluating MCP for a production deployment, benchmark the HTTP configuration against your actual workload — not the stdio benchmark from a developer’s machine. You’ll get a different answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZz9ZxWvd2Wteajy4aaPqA.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>Where MCP Wins: The Problems CLI Can’t Solve</h3><p>Here’s what changes when you move from individual developer to organizational scale.</p><p>At <a href="https://www.weare8.com/">WeAre8</a>, we run a 24/7 content moderation agent fleet. Not one agent. Not a handful. A coordinated fleet operating continuously across multiple content domains. At that scale, CLI tooling becomes ungovernable — not because it’s slow, but because it’s invisible.</p><p><strong>Auth at scale. </strong>When twenty engineers deploy agents that call external services, you need access controls. You need to know which agent called what, with whose credentials, when. CLI tools running in agent contexts give you none of that by default. You can bolt on wrappers and logging — but you’re reinventing access management without a spec. MCP’s auth layer — OAuth, token scoping, access management — is built for exactly this problem. It’s not overhead. It’s the product.</p><p><strong>Telemetry and observability.</strong> At 2am when something breaks across a multi-agent workflow, you need audit trails. You need to replay what happened. You need to understand which tool call preceded the failure, what the input was, what the output was, what state was passed downstream. CLI in an agentic context doesn’t give you structured telemetry. MCP does. For a 24/7 fleet, the debugging experience alone justifies the protocol in production.</p><p><strong>Resources and Prompts — the invisible advantage.</strong> Most of the debate focuses on MCP’s Tools primitive. Almost none of it addresses Resources (structured data surfaces) and Prompts (server-side prompt templates). These aren’t minor features. They’re an organizational alignment mechanism. When you have teams of agents and teams of engineers, server-side prompts ensure your agents are using the same instructions you’ve validated. Resources ensure agents access data through controlled, observable channels. CLI has no equivalent. You can approximate it with wrapper scripts and shared config — but you’re building a protocol without a spec and without the ecosystem.</p><p><strong>Structured tool discovery.</strong> In enterprise environments, tools change. APIs evolve. New capabilities get added. With MCP, agents discover what’s available through the protocol itself — no manual updates to individual agent configs, no drift between what an agent thinks it can do and what’s actually available. For a fleet of agents, this isn’t a convenience. It’s operational sanity over months of deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F6gBhWvtFGQiHcLyjq-psA.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Security Argument That Cuts Both Ways</h3><p>There’s a real security critique of MCP that deserves to be taken seriously. But the conclusion some people draw from it is wrong.</p><p>The critique: MCP expands your agent’s attack surface by adding a protocol layer, tool discovery, and dynamic capability loading — all of which create new injection and privilege escalation vectors.</p><p>Repello AI documented in March 2026 that switching from MCP to CLI does NOT fix these problems. Their finding: these are agent architecture problems, not protocol problems.</p><p>This matters for the debate because some CLI advocates frame their switch as a security improvement. It isn’t. The attack vectors that concern security researchers — a malicious tool output injecting instructions into an agent’s context, an agent with excessive permissions escalating its own access — exist regardless of whether the tool was invoked via MCP or a shell command.</p><p>A shell command in an agentic context is not inherently safer than an MCP call. In some configurations, it’s less safe: CLI execution in agent pipelines is harder to scope, harder to audit, and often runs with broader ambient permissions than a properly scoped MCP server.</p><p>Both protocols have security implications. Both require careful agent architecture around them. The real security conversation is about agent design: least-privilege access, input validation, human review gates for consequential actions. MCP’s auth primitives actually assist here at scale — they give you hooks to enforce access policies that CLI invocation doesn’t have a natural home for.</p><p>Treating CLI as the “safe” option misframes the risk and delays the real architectural work.</p><h3>The Organizational Lens: Why This Looks Completely Different at Scale</h3><p>Individual developer perspective: agent on my machine, my tools, my context, running tasks I designed. Token cost is real. Overhead is real. CLI often wins.</p><p>Twenty engineers, production deployment, agent fleet, enterprise environment: who has access to what? What happened last Tuesday at 3pm? Why did this agent call that API 400 times? Can we change this tool definition without redeploying every agent? Can we give the new engineer restricted access to some tools but not others? CLI gives you none of these answers. MCP was built to give you all of them.</p><p>Analysis from <a href="https://chrlschn.dev/">chrlschn.dev</a> published in March 2026 makes this distinction clearly: individual dev usage looks completely different from org-scale agentic engineering. Visibility, telemetry, security, and quality governance aren’t nice-to-haves at scale — they’re what determines whether you can actually run, iterate, and improve a system over time. Practitioners who operate only at one scale and extrapolate to the other make tool selection errors with real consequences.</p><p>The overhead that feels like waste to a solo developer is governance infrastructure to a team. That reframing doesn’t change the token math — but it changes what the token cost is buying.</p><h3>The Practitioners Who’ll Outbuild Everyone Else</h3><p>The engineers picking a camp — “MCP is dead,” “CLI is primitive” — are optimizing for being right in a Twitter debate.</p><p>The engineers asking “which problem am I actually solving?” are building things that work.</p><p>For personal tooling, experimental workflows, solo development, high-frequency retrieval tasks where you control the environment: evaluate CLI seriously. The 35x token advantage is real. The simplicity is real. Don’t use a distributed protocol where a shell command will do. When you’re a solo practitioner iterating fast on a dev machine, MCP’s governance features aren’t helping you — they’re just burning tokens.</p><p>For team environments, production agent fleets, enterprise deployments where agents run at scale across services, domains, and team boundaries: MCP’s auth layer, telemetry primitives, and organizational alignment mechanisms are doing work that CLI cannot replicate without a significant investment in reinventing the same wheel. The overhead is the price of governability. When something breaks in production at 2am, you want the audit trail. You want the access log. You want the structured tool definitions that let you grep for which agent called what.</p><p>The call that actually matters isn’t MCP vs CLI. It’s stdio MCP for dev experiments vs HTTP MCP for production infrastructure vs CLI for controlled, bounded contexts. Three different use cases. Three different right answers. One framework for making the call: ask what accountability you need, not what protocol is trending.</p><p>Don’t pick a camp. Pick the right tool for the problem you’re actually solving.</p><p>The practitioners who can make that call are the ones building things that last. The ones who picked a camp based on a Perplexity blog post will figure it out eventually — after they’ve tried to debug a production agent fleet with nothing but shell history.</p><p><em>Sources: Jannik Reinhard (jannikreinhard.com, Feb 2026) — GitHub MCP vs gh CLI token benchmark. Repello AI (Mar 2026) — MCP security analysis: switching to CLI does not resolve prompt injection or privilege escalation. chrlschn.dev (Mar 2026) — individual vs organizational agentic engineering analysis.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b38bb1f3bf94" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Verify, Don’t Review]]></title>
            <link>https://georgetaskos.medium.com/verify-dont-review-c5403921e668?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5403921e668</guid>
            <category><![CDATA[agentic-development]]></category>
            <category><![CDATA[claude-code]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[pull-request-reviews]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Sun, 12 Apr 2026 09:01:01 GMT</pubDate>
            <atom:updated>2026-04-12T09:01:01.613Z</atom:updated>
            <content:encoded><![CDATA[<h4>Treating AI output like peer review is the wrong mental model. The right model is compiler output — you write tests that verify behavior, not review every line.</h4><p>You wouldn’t sit down after a build and read every line of machine code the compiler emitted. You’d run your test suite, check the output contract, and ship. The compiler either satisfied the specification or it didn’t. Human judgment enters at the spec level — not at the assembly level.</p><p>So why, in 2026, are engineering teams still reviewing Claude’s output the same way they’d review a junior developer’s pull request?</p><p>The mental model is broken. And it’s not a minor calibration issue — it’s a structural failure that gets worse as AI adoption scales.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9UKczkmmA9B0Ig9D_wBkgw.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Review Model Is Borrowed from the Wrong Place</h3><p>Code review was designed for human developers. It works because of a set of assumptions that no longer hold when one of the “developers” is an LLM:</p><p><strong>Assumption 1:</strong> <strong>Volume is bounded.</strong> A developer opens a PR with 200–400 lines. Human reviewers can hold that in working memory, spot the seams, understand the intent. SmartBear and Cisco research established this ceiling empirically — defect detection degrades sharply past 400 lines of diff. Reviewers stop finding bugs. They start rubber-stamping.</p><p><strong>Assumption 2:</strong> <strong>The author can explain the decision.</strong> In human review, you can ask “why did you do it this way?” and get an answer with context, constraints, tradeoffs. The author carries knowledge that doesn’t live in the diff.</p><p><strong>Assumption 3:</strong> <strong>Convention is tacit but shared.</strong> Two developers on the same team share implicit knowledge of patterns, anti-patterns, naming conventions, architectural preferences. Review catches deviations because reviewers recognize them.</p><p>None of these hold for AI-generated code.</p><p>A single Claude prompt can generate 600+ lines in seconds. That’s not a PR — that’s a release. And it blows past the human review ceiling before the reviewer has even scrolled to line two. METR research found that roughly 50% of AI-generated code gets rejected in production review. That’s not a number you paper over with better prompts. That’s a signal that the quality gate itself is misaligned.</p><p>MIT and Google DORA data compounds the concern: teams that adopt AI coding tools without rearchitecting their quality gates see error amplification in the range of 17.2x compared to baseline. You’re not generating code faster. You’re generating problems faster, at a rate human review can’t absorb.</p><p>The failure isn’t the AI. The failure is applying a process designed for one throughput regime to a process operating at a completely different one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HS-H3GxILW2D3_XP9nRi-w.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>What Review Actually Catches (and What It Misses)</h3><p>When review does catch something, what is it?</p><p>Logic errors, mostly. CodeRabbit’s analysis of human vs. AI-generated code found roughly 1.7x the rate of logic errors in AI output compared to human-written code at equivalent complexity levels. These are subtle: a conditional branch that’s off by one, a null path that isn’t handled, a state transition that’s legal but wrong in context.</p><p>And then there’s security. Veracode’s dataset shows 45% of AI-generated code contains security flaws — injection vulnerabilities, improper error handling, hardcoded secrets, privilege escalation paths. These aren’t exotic edge cases. They’re the standard OWASP catalogue, introduced at scale.</p><p>Here’s what review misses: <strong>convention drift.</strong> AI code doesn’t look wrong. It looks completely plausible. It follows the syntax. It compiles. It often passes a superficial read. The failures hide in the seams: an abstraction that’s slightly off from the team’s preferred pattern, a service boundary that violates the architectural contract, a naming convention that matches nothing else in the codebase. Reviewers trained to find bugs don’t naturally surface convention drift at volume.</p><p>This is how technical debt accumulates invisibly. Not through obvious mistakes, but through a thousand micro-departures from the architectural intent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ncqXAIuO3WtVBiKAvkuU_g.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Compiler Mental Model</h3><p>Shift the frame.</p><p>When you use a compiler, you don’t review the intermediate representation it generates. You define a specification — a test suite, a type system, a set of properties — and you verify that the output satisfies the specification. If it does, you ship. If it doesn’t, you fix the input or the spec.</p><p>The compiler is not your collaborator. It’s a transformation engine. You don’t ask it to explain its output. You verify the output against a definition of correctness that you own.</p><p>AI code generation is the same thing. The LLM is a transformation engine. Your job is not to read what it produced. Your job is to have defined what correct behavior looks like before it produced anything — and then to verify against that definition automatically.</p><p>This requires a different sequencing:</p><p><strong>Spec first. Generate second. Verify third.</strong></p><p>Not: generate first, review after.</p><h3>What Verification Looks Like in Practice</h3><p>Here’s a concrete workflow shift:</p><p>Before you prompt the agent to implement a function, you write the test. Not a skeleton — the actual test. What inputs should produce what outputs? What invariants must hold? What security properties are non-negotiable?</p><pre># Write this first — before prompting for implementation<br>@given(st.integers(min_value=0), st.integers(min_value=1))<br>def test_pagination_never_exceeds_total(offset, page_size):<br>    result = paginate(items=generate_items(100), offset=offset, page_size=page_size)<br>    assert len(result.items) &lt;= page_size<br>    assert result.total_count == 100<br>    assert result.offset &gt;= 0</pre><p>This is a property-based test. It doesn’t check one example — it checks the invariant across thousands of generated inputs. Hypothesis (Python) or fast-check (TypeScript) can run these automatically. The agent generates the implementation. The test verifies the property holds. No reviewer needed.</p><p>Layer contract-first design on top. Before the agent writes a service, you define its interface contract: what it accepts, what it guarantees, what it will never do. OpenAPI specs, TypeScript interfaces with discriminated unions, Zod schemas at boundaries — these aren’t just documentation. They’re machine-verifiable contracts the agent’s output must satisfy.</p><p>Convention gates are the next layer. Linters and static analysis tools enforce syntax conventions. But you can go further: architectural linting tools like Dependency Cruiser can verify that module boundaries weren’t violated. Custom eslint rules can enforce team-specific patterns. These run in CI, automatically, on every commit.</p><p>Together: property tests + contract schemas + convention gates + static analysis = a verification pipeline that doesn’t rely on a human reviewer’s working memory at 5pm on a Thursday.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wbtXsqCJKo7szQkS5eTog.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>The Convention Layer: Context Files Solve Half the Problem</h3><p>The industry’s current answer to convention drift is context files: CLAUDE.md, .cursor/rules, or equivalent. Teams codify their architectural preferences, naming conventions, forbidden patterns, preferred abstractions. The agent reads the context file and (ideally) follows it.</p><p>At <a href="https://www.weare8.com/">WeAre8</a>, this is becoming standard practice. You tell the agent: use this service pattern, not that one. Prefer composition over inheritance. Never put business logic in controllers. The agent follows the instructions.</p><p>This is progress. But it solves the wrong half of the problem.</p><p>Context files are instructions to the agent. They say <em>what to follow</em>. What they don’t do is verify <em>whether it was followed</em>. After the agent generates 800 lines of code, nothing in the current toolchain automatically checks that it respected your conventions. The verification step is still manual. Still human. Still subject to the review ceiling.</p><p>The gap is: an automated layer that reads your convention definitions and checks agent output against them before it reaches a human at all. Not a linter — a semantic checker that understands your codebase’s architectural intent, not just its syntax. Something that can say: “This code violates the dependency direction you defined in CLAUDE.md. Fix before review.”</p><p>That tool doesn’t exist yet. Not in a production-grade, convention-aware form.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*epIDvMq1P5KtVjA_UgqCbQ.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>What Humans Should Actually Do</h3><p>None of this eliminates the human. It repositions the human.</p><p>When you move verification to automated gates, what’s left for human judgment is exactly what humans are actually good at and AI is genuinely bad at:</p><p><strong>Architectural intent.</strong> Does this design match where the product is going in 18 months? An agent has no roadmap. It has no knowledge of the acquisition that’s coming, the compliance requirement that will land next quarter, the performance ceiling you’re going to hit when you scale. Those judgments require context that lives in human heads, not in codebases.</p><p><strong>Domain correctness.</strong> In healthcare, finance, legal — the code might be syntactically perfect and logically sound while being catastrophically wrong for the domain. A billing workflow that’s technically correct but violates a payer contract. A medication dosage calculation that passes all tests but misunderstands the clinical model. Domain review requires domain expertise, not code expertise.</p><p><strong>Roadmap alignment.</strong> Should this feature exist at all? Is this abstraction premature? Are we building the right thing? These are product judgments, not code judgments.</p><p>Human review is expensive cognitive work. Reserve it for problems only humans can solve.</p><h3>The Unsolved Piece — And What To Do Until It Exists</h3><p>The verification model is directionally correct. Property-based testing, contract-first design, convention gates, automated analysis — these are the right primitives. Teams that have implemented them have meaningfully reduced their error rates without slowing AI adoption.</p><p>But the full layer isn’t built yet.</p><p>Context files tell the agent what to do. Test suites verify functional behavior. Static analysis catches syntax. What’s missing is the semantic convention checker: a tool that reads your architectural contracts and automatically verifies that agent output respects them. Not linting — semantic alignment verification that understands your codebase’s intent, not just its syntax.</p><p>That tool doesn’t exist in production-grade form yet. So here’s the pragmatic move until it does: at WeAre8, we run convention audits as a scheduled review step — not line-by-line human review of every PR, but a periodic architectural pass that asks “is the pattern still intact?” Human judgment reserved for the layer machines can’t reach yet.</p><p>The compiler mental model holds. You don’t review the assembly. You write better tests, define better contracts, and reserve human judgment for the things only humans can judge — architecture direction, domain correctness, product intent.</p><p>Stop reviewing compiler output. Start writing better specs.</p><p><em>The evidence cited in this piece draws on METR’s production code rejection analysis, Google DORA / MIT error amplification research, CodeRabbit’s logic error comparison data, Veracode’s security flaw dataset, and SmartBear/Cisco’s code review defect detection research.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5403921e668" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Engineer Who Writes No Code]]></title>
            <link>https://georgetaskos.medium.com/the-engineer-who-writes-no-code-1fd69a0ec20b?source=rss-c7c0baf47ca2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fd69a0ec20b</guid>
            <category><![CDATA[engineering-management]]></category>
            <category><![CDATA[talent-acquisition]]></category>
            <category><![CDATA[agentic-development]]></category>
            <category><![CDATA[agentic-coding]]></category>
            <dc:creator><![CDATA[George Taskos]]></dc:creator>
            <pubDate>Sat, 11 Apr 2026 19:01:01 GMT</pubDate>
            <atom:updated>2026-04-11T19:01:01.606Z</atom:updated>
            <content:encoded><![CDATA[<h4><em>In the agent era, engineering leverage is inversely proportional to code output — the best engineers are the ones who’ve made their own implementation irrelevant.</em></h4><p>The best engineer I know shipped 12 features last sprint. He wrote maybe 200 lines of code himself. The other 4,000? Agents. The 200 lines he wrote were the only ones that mattered — the interfaces, the contracts, the gates that made the other 4,000 trustworthy. That’s not a 10x engineer. That’s something new.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yX-eoHP2Nig45-pGs3B3Ng.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>1. The Origin Story Nobody Remembers</h3><p>Frederick Brooks published <em>The Mythical Man Month</em> in 1975. Most people who cite it have heard the famous line — “adding manpower to a late software project makes it later” — and stopped reading there.</p><p>Buried in the same book is something more interesting. Brooks drew on a 1968 study by Sackman, Erikson, and Grant that measured the productivity variance between professional programmers on the same task. The result: a 10:1 ratio between the slowest and fastest. Same task. Same tools. Same inputs. Ten times the output variance.</p><p>This is where “10x engineer” came from. Not a tech bro Twitter myth. A measured empirical finding from the late 1960s.</p><p>But here’s what people miss about the study: the variance wasn’t about typing speed. It wasn’t about raw code output. It was about decision quality, problem decomposition, and knowing what <em>not</em> to build. The productive programmers weren’t writing more code. They were writing less, and writing it in the right order.</p><p>Brooks also proposed a solution he called the <strong>surgical team </strong>model. One chief programmer — the surgeon. One copilot. A language lawyer. A toolsmith. The chief programmer’s job was to produce the critical code and make every high-stakes decision. Everyone else removed friction from that function.</p><p>Read that structure carefully. Chief programmer + support roles that amplify judgment and reduce mechanical overhead. It’s a remarkably clean map to: senior engineer + agent fleet.</p><p>The concept was always about output variance and decision quality. It was never really about who typed the most code. We just forgot that.</p><h3>2. What “10x” Actually Became</h3><p>The 2010s mythologized the 10x engineer as a personality type: Red Bull on the desk, GitHub calendar solid green, ships faster than anyone else. The mythology wasn’t entirely wrong — there were engineers who created outsized leverage through architectural clarity and decision quality. But look at what was actually creating that leverage:</p><ul><li>Knowing what to build before building it</li><li>Designing systems that other engineers could work inside without constant coordination</li><li>Making decisions that held up at scale instead of requiring rewrites</li><li>Unblocking others by absorbing ambiguity and converting it into clear direction</li></ul><p>The 10x engineer was doing the spec work, the interface design, the architectural clarity — and also the implementation. They were leveraged because they were better at the high-judgment work.</p><p>The 2010s mythology compressed all of that into “fast coder.” And that compression is about to matter a lot.</p><h3>3. The Number That Changes Everything</h3><p>GitHub Copilot now generates 46% of all code written by active users.</p><p>Not 46% of one team’s code. Not 46% in some optimized pilot. Forty-six percent of all code, averaged across millions of developers, every day.</p><p>Teams using Claude ship <strong>7.6 times more often</strong> than before (Anthropic/Vercel data, March 2026). GitHub Copilot has 20 million users. Ninety percent of Fortune 100 companies have adopted it.</p><p>Let that sit for a moment. The implementation cost of software just got cut in half. And if you’re working with current-generation agents deliberately, it went further than that.</p><p>This is not a gradual improvement. It’s a step change in the cost structure of building software. When implementation is cheap and fast, the premium shifts — entirely and permanently — to the things that aren’t cheap and fast. Judgment. Spec quality. Interface design. Knowing what’s out of scope and why.</p><p>The math on “10x” just broke. If an average engineer using agents ships 3x-5x what they shipped before, and a 10x engineer using agents ships 30x-50x what they used to — then the gap inside the agent-enabled cohort isn’t about who types more code anymore. It’s about who makes better decisions about what to have agents build.</p><p>The implementation bottleneck has largely been removed. A new bottleneck has taken its place: the quality of what you put in front of the agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SgNWTYzYM_iK2X5P-nNV3w.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>4. The New High-Leverage Job Description</h3><p>If you’re not writing most of the code, what are you actually doing?</p><p>Here’s what I’ve found matters:</p><p><strong>Spec writing.</strong> Before a single agent opens a context window, the work has to be defined with enough precision that an agent can execute without making judgment calls you haven’t authorized. That’s harder than it sounds. Most engineers are very good at knowing what to build. Writing that down well enough to constrain an agent’s decisions — while leaving enough room for sensible implementation choices — is a distinct skill. I wrote <a href="https://georgetaskos.medium.com/the-attack-document-write-the-spec-before-claude-touches-code-d40c5b50b0b2">The Attack Document</a> precisely because this step is where everything either works or doesn’t.</p><p><strong>Interface declaration.</strong> At <a href="https://www.weare8.com/">WeAre8</a>, running parallel agent sessions on the same codebase, the most expensive mistakes weren’t wrong implementations — they were two agents independently implementing the same shared module in slightly different ways. Both correct. Both tested. Both committed. Neither knowing the other existed. The fix wasn’t better prompting. It was declaring interfaces before any session started, so every agent treated shared modules as contracts, not as things it might need to invent. The spec work contains the blast radius before it exists.</p><p><strong>Gate design.</strong> What checks run after every implementation phase? What does “done” actually mean? When does a human get involved, and on what specific questions? The automated gates — lint, typecheck, tests, security scans — aren’t just CI hygiene. They’re your oversight system. The gates are what make a fleet trustworthy at scale. If you’re running agents without gates, you’re not running a fleet — you’re just hoping.</p><p><strong>Fleet management.</strong> Sequencing parallel work, catching drift, re-injecting context at phase boundaries, making the merge calls — this is operational work, and it requires maintaining a mental model of what every active session is doing and what it doesn’t know. <a href="https://georgetaskos.medium.com/scaling-the-loop-run-5-claude-code-sessions-in-parallel-with-conductor-build-539b52888a81">The Conductor’s Playbook</a> goes deep on the failure modes here. They’re real, they’re predictable, and they’re all preventable with the right operating model.</p><p>Notice what’s on that list. None of it is typing code. All of it requires deep understanding of how code works, what breaks, what ambiguity costs, and what a trustworthy system looks like. You need the knowledge. You don’t need to be the implementation vehicle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-rObXhjDxZGUdt9YgTjLA.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>5. The Uncomfortable Implication</h3><p>The engineer who can’t let go of the keyboard is now the bottleneck.</p><p>Not the one who writes bad code. The one who insists on writing all of it.</p><p>The identity of “engineer” has been bound to the act of coding for so long that the two feel inseparable. Asking someone to be a great engineer who doesn’t write most of the code feels like asking a chef to cook great food without spending much time at the stove.</p><p>Except the chef analogy is closer than it seems. Great chefs spend most of their time on the things that make the cooking good: sourcing, recipe development, kitchen design, team coordination, quality standards. The act of standing at the stove is important, but it’s not where most of the leverage lives. A great chef who insists on personally cooking every dish in a restaurant that serves 200 covers a night isn’t demonstrating mastery — they’re creating a bottleneck.</p><p>Senior engineers who won’t route implementation to agents aren’t being rigorous. They’re being slow. And in a world where the person next to them is shipping 7x faster using agents, that slowness has a real cost — to the team, to the product, and eventually to their own careers.</p><p>The identity shift is the hard part. The skill shift is tractable.</p><h3>6. What This Doesn’t Mean</h3><p>Let’s address the obvious misreading before it spreads.</p><p>This is not a “coding is dead” article. Coding isn’t dead. It’s more valuable than ever — which is exactly why you shouldn’t be doing it when an agent can.</p><p>The engineers who will thrive in the agent era are the ones with the deepest craft. Not the shallowest. You need to understand what good code looks like to review what agents produce. You need to know where they fail quietly — the subtle type errors, the race conditions they don’t flag, the security holes that look like correct implementations — to design gates that catch them. You need interface design knowledge deep enough to write contracts that actually constrain agent behavior meaningfully.</p><p>The doctor analogy: a great doctor who prescribes the right treatment doesn’t need to manufacture the drugs. But they need to understand pharmacology deeply enough to know which drug to prescribe, at what dose, with what contraindications. The understanding is essential. The manufacturing is not.</p><p>This is also not a vibe coding article. The engineers making deliberate leverage choices with agents aren’t typing in chat windows and seeing what comes out. They’re doing structured spec work, running disciplined execution loops, catching failure modes proactively. The rigor went up, not down. It just moved upstream.</p><p>The junior engineer who uses agents to write code they don’t understand yet isn’t doing what this article describes. The senior engineer who uses agents to implement code they could write themselves — but don’t need to — is. The difference is understanding. One is a shortcut around learning. The other is a leverage choice made from a position of deep knowledge.</p><p>Deep craft makes you a better conductor. Shallow craft makes you dependent on agents you can’t supervise. The direction of travel is more engineering knowledge, not less.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74_9jvnsiAoUQyKVenFaKQ.png" /><figcaption>Illustration created by the author using OpenAI</figcaption></figure><h3>7. The Question Worth Asking</h3><p>Here’s the question I’d ask every engineer on a team right now:</p><p><strong>Look at everything you wrote last week. How much of it could an agent have written with a good spec? What did you do that an agent genuinely couldn’t?</strong></p><p>That ratio — human judgment to implementation — is the new leverage score. Not lines of code per day. Not features shipped. The ratio of decisions made to code produced.</p><p>The 10x engineer measured output. They were defined by what they shipped. The new archetype is defined by the inverse: the leverage ratio — how much got shipped per unit of their direct involvement.</p><p>The best engineers I know right now aren’t the ones writing the most code. They’re the ones whose judgment is in every feature, whose interfaces are in every module, whose gates are catching every failure — and who personally wrote almost none of the implementation. They’re operating at a layer above the code. Their fingerprints are in the architecture, the contracts, the constraints.</p><p>Frederick Brooks described a surgical team in 1975 because he saw that the highest-leverage function in software development wasn’t uniform implementation — it was the chief programmer’s decision-making, amplified and protected by everyone around them. Eerily, he was describing what 2026 looks like if you squint: one human with high judgment, surrounded by a fleet that handles implementation.</p><p>The 10x engineer typed faster. The new archetype thinks better — and has stopped needing to type much at all.</p><p>That’s not a regression in standards. That’s what leverage looks like when the tools finally catch up with the insight Brooks had fifty years ago.</p><p>The signal of mastery is no longer lines of code shipped. It’s lines of code you didn’t have to write.</p><p><em>George Taskos has built and scaled engineering teams across three company exits, currently at WeAre8. He writes about agentic systems, engineering leverage, and the practice of building with AI.</em></p><p><em>This article is part of a series on agentic engineering workflows:</em></p><ul><li><a href="https://georgetaskos.medium.com/the-attack-document-write-the-spec-before-claude-touches-code-d40c5b50b0b2"><em>The Attack Document</em></a><em> — write the spec before Claude touches code</em></li><li><a href="https://georgetaskos.medium.com/the-execution-loop-from-spec-to-merged-pr-with-claude-code-d1fcc5ef8c86"><em>The Execution Loop</em></a><em> — from spec to merged PR with Claude Code</em></li><li><a href="https://georgetaskos.medium.com/scaling-the-loop-run-5-claude-code-sessions-in-parallel-with-conductor-build-539b52888a81"><em>Scaling the Loop</em></a><em> — run 5 Claude Code sessions in parallel</em></li><li><a href="https://georgetaskos.medium.com/the-conductors-playbook-f64bc77d1bf4"><em>The Conductor’s Playbook</em></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fd69a0ec20b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>