<?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 Prasanna balaji K on Medium]]></title>
        <description><![CDATA[Stories by Prasanna balaji K on Medium]]></description>
        <link>https://medium.com/@sm_85862?source=rss-77f8c77817dd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ySDSqCJIOYG0xzLKCYAcAA.png</url>
            <title>Stories by Prasanna balaji K on Medium</title>
            <link>https://medium.com/@sm_85862?source=rss-77f8c77817dd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 19:50:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sm_85862/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[MBR vs GPT: Understanding the Difference Between Two Disk Partition Styles]]></title>
            <link>https://medium.com/@sm_85862/mbr-vs-gpt-understanding-the-difference-between-two-disk-partition-styles-2ec0ad70393f?source=rss-77f8c77817dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ec0ad70393f</guid>
            <category><![CDATA[disk-partitioning]]></category>
            <category><![CDATA[mbr]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[gpt]]></category>
            <category><![CDATA[disk]]></category>
            <dc:creator><![CDATA[Prasanna balaji K]]></dc:creator>
            <pubDate>Tue, 06 Oct 2026 19:09:25 GMT</pubDate>
            <atom:updated>2026-10-06T19:09:25.959Z</atom:updated>
            <content:encoded><![CDATA[<p>When installing Windows, creating a bootable USB, partitioning a new SSD, or troubleshooting a disk, you may come across two terms:</p><p><strong>MBR</strong> and <strong>GPT</strong>.</p><p>At first, they can look like technical jargon. But the concept is actually quite simple.</p><p>Both MBR and GPT are <strong>partitioning schemes</strong> used to organize and manage partitions on a storage device such as an HDD, SSD, or USB drive.</p><p>The important question is:</p><blockquote><strong><em>Which one should you use — MBR or GPT?</em></strong></blockquote><p>For most modern computers, the answer is <strong>GPT</strong>.</p><p>But understanding why GPT is preferred — and when MBR is still useful — can save you from many installation and boot problems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*b4BAC42rbZyduwU3REuDvw.png" /></figure><h3>What is MBR?</h3><p><strong>MBR stands for Master Boot Record.</strong></p><p>It is one of the oldest partitioning standards and has been used for decades.</p><p>The MBR information is stored at the beginning of the disk and contains important information about the disk’s partitions and boot process.</p><p>A typical MBR-based system looks like this:</p><pre>Disk<br>│<br>├── MBR<br>├── Partition 1<br>├── Partition 2<br>├── Partition 3<br>└── Partition 4</pre><p>One of the biggest limitations of MBR is that it supports only <strong>four primary partitions</strong>.</p><p>There is a workaround using an <strong>extended partition</strong>, but it makes partition management more complicated.</p><h3>The 2 TB limitation</h3><p>Another major limitation is disk size.</p><p>MBR traditionally uses 32-bit partition addressing, which means that with the commonly used 512-byte sector size, it can address approximately <strong>2 TB</strong> of disk space.</p><p>So if you have a 4 TB drive, MBR cannot efficiently use the entire disk in the traditional configuration.</p><h3>What is GPT?</h3><p><strong>GPT stands for GUID Partition Table.</strong></p><p>GPT is the modern partitioning standard designed to overcome many of MBR’s limitations.</p><p>It is normally used with <strong>UEFI-based systems</strong> and is the recommended choice for most modern computers.</p><p>A simplified GPT disk looks like:</p><pre>GPT<br>│<br>├── Partition 1<br>├── Partition 2<br>├── Partition 3<br>├── ...<br>└── Partition N</pre><p>On Windows systems, GPT supports <strong>up to 128 partitions</strong> by default, without requiring the extended/logical partition structure used by MBR.</p><p>More importantly, GPT supports disks far larger than 2 TB.</p><p>That makes it a much better choice for modern high-capacity HDDs and SSDs.</p><h3>MBR vs GPT: The Important Differences</h3><p>FeatureMBRGPTFull nameMaster Boot RecordGUID Partition TableDesigned forOlder systemsModern systemsTypical firmwareLegacy BIOSUEFIDisk size~2 TB traditional limitMuch larger disksWindows primary partitionsUp to 4Typically up to 128Partition backupNoYesIntegrity checkingLimitedCRC-based checkingModern WindowsLegacy use casesRecommendedSecure BootNot normally usedDesigned for UEFI systems</p><h3>MBR and BIOS vs GPT and UEFI</h3><p>This is one of the most common areas of confusion.</p><p><strong>MBR/GPT and BIOS/UEFI are not the same thing.</strong></p><p>MBR and GPT describe the <strong>partitioning structure of the disk</strong>.</p><p>BIOS and UEFI describe the <strong>firmware interface used to boot the computer</strong>.</p><p>However, they are commonly associated with each other:</p><pre>Older PC<br>    ↓<br>Legacy BIOS<br>    ↓<br>MBR</pre><p>And:</p><pre>Modern PC<br>    ↓<br>UEFI<br>    ↓<br>GPT</pre><p>Modern Windows installations, particularly Windows 11, are generally designed around <strong>UEFI + GPT</strong>.</p><h3>Why Does GPT Have Better Reliability?</h3><p>GPT doesn’t just provide more partitions.</p><p>It also improves the way partition information is protected.</p><p>With MBR, important partition information is concentrated at the beginning of the disk.</p><p>If that information becomes corrupted, recovering the partition structure can become difficult.</p><p>GPT maintains:</p><ul><li>A primary GPT header</li><li>Partition entries</li><li>A backup GPT header</li><li>CRC32 integrity checks</li></ul><p>The backup information is stored toward the end of the disk.</p><p>Conceptually:</p><pre>GPT Disk</pre><pre>┌─────────────┬──────────────────┬────────────────────┐<br>│ GPT Header  │    Partitions    │ Backup GPT Header  │<br>└─────────────┴──────────────────┴────────────────────┘</pre><p>This gives GPT better protection against certain types of partition-table corruption.</p><h3>What Happens With a 4 TB Drive?</h3><p>This is an easy way to understand the practical difference.</p><p>Imagine you purchased a <strong>4 TB HDD</strong>.</p><p>With traditional MBR partitioning:</p><pre>4 TB Disk</pre><pre>┌───────────────────────┬─────────────────────┐<br>│       ~2 TB           │ Remaining capacity  │<br>│       usable          │     limitation      │<br>└───────────────────────┴─────────────────────┘</pre><p>With GPT:</p><pre>4 TB Disk</pre><pre>┌─────────────────────────────────────────────┐<br>│              Full 4 TB usable                │<br>└─────────────────────────────────────────────┘</pre><p>So for large-capacity drives, GPT is the obvious choice.</p><h3>What About SSDs?</h3><p>The same principle applies to SSDs.</p><p>Whether you are using:</p><ul><li>SATA SSD</li><li>NVMe SSD</li><li>External SSD</li><li>Large HDD</li></ul><p>GPT is generally the preferred partitioning scheme on a modern computer.</p><p>The partition style itself doesn’t make an SSD dramatically faster.</p><p>The major advantages are <strong>compatibility, capacity, partition flexibility, and modern boot support</strong>.</p><h3>Which One Should You Choose for Windows 10?</h3><p>If your computer supports UEFI, I would generally recommend:</p><pre>Windows 10<br>    ↓<br>UEFI<br>    ↓<br>GPT</pre><p>There are still situations where MBR makes sense, particularly when installing Windows on older hardware that only supports Legacy BIOS.</p><h3>What About Windows 11?</h3><p>For a normal modern Windows 11 installation, GPT is the better choice.</p><p>A typical configuration is:</p><pre>UEFI Firmware<br>      +<br>GPT Disk<br>      +<br>Windows 11</pre><p>This also fits the requirements around modern boot technologies such as <strong>Secure Boot</strong>.</p><p>If you are installing Windows 11 on a modern PC and your disk is currently MBR, converting it to GPT may be necessary depending on the existing configuration.</p><h3>How Do I Check Whether My Disk Is MBR or GPT?</h3><p>Windows provides several ways to check.</p><h3>Method 1: Disk Management</h3><p>Press:</p><pre>Win + X</pre><p>Then open:</p><pre>Disk Management</pre><p>Right-click the disk, choose:</p><pre>Properties → Volumes</pre><p>Look for:</p><pre>Partition style</pre><p>It will show either:</p><pre>Master Boot Record (MBR)</pre><p>or:</p><pre>GUID Partition Table (GPT)</pre><h3>Method 2: DiskPart</h3><p>You can also use Command Prompt or PowerShell.</p><p>Open a terminal as Administrator and run:</p><pre>diskpart</pre><p>Then:</p><pre>list disk</pre><p>You may see something like:</p><pre>Disk ###  Status      Size     Free     Gpt<br>--------  ----------  -------  -------  ---<br>Disk 0    Online      476 GB   0 B      *<br>Disk 1    Online      931 GB   0 B</pre><p>The important part is the <strong>GPT</strong> column.</p><p>If you see *, that disk uses GPT.</p><p>If there is no *, it is probably using MBR.</p><h3>Can You Convert MBR to GPT?</h3><p>Yes.</p><p>But this is where you need to be careful.</p><p>A traditional conversion using Disk Management usually requires deleting existing partitions first.</p><p>That means:</p><p><strong>Backup your data before converting.</strong></p><p>For supported Windows installations, Microsoft also provides the mbr2gpt utility, which can convert a compatible Windows system disk from MBR to GPT without the traditional full disk wipe.</p><p>A typical command is:</p><pre>mbr2gpt /validate</pre><p>If validation succeeds:</p><pre>mbr2gpt /convert</pre><p>However, you should verify the disk configuration and firmware settings before doing this.</p><p>After conversion, the firmware generally needs to boot the system using <strong>UEFI mode</strong> instead of Legacy/CSM mode.</p><h3>A Simple Way to Remember It</h3><p>If you don’t want to remember all the technical details, use this rule:</p><h3>MBR</h3><p>Think:</p><blockquote><strong><em>Old hardware + Legacy BIOS + compatibility</em></strong></blockquote><h3>GPT</h3><p>Think:</p><blockquote><strong><em>Modern hardware + UEFI + large disks</em></strong></blockquote><p>Or simply:</p><pre>MBR → Older / Legacy<br>GPT → Modern / UEFI</pre><h3>So, Which One Is Better?</h3><p>For most modern systems:</p><p><strong>GPT wins.</strong></p><p>It provides:</p><ul><li>Support for disks larger than 2 TB</li><li>More partitions</li><li>Better partition-table redundancy</li><li>Integrity checking</li><li>Better compatibility with UEFI</li><li>A better foundation for modern Windows systems</li></ul><p>MBR isn’t useless, though.</p><p>It remains valuable when working with:</p><ul><li>Older computers</li><li>Legacy BIOS systems</li><li>Older operating systems</li><li>Legacy-compatible boot environments</li></ul><h3>Final Takeaway</h3><p>MBR and GPT are not competing operating systems or file systems.</p><p>They are simply two different ways of organizing partitions on a disk.</p><p>If you’re building or reinstalling a modern PC today, the usual recommendation is:</p><pre>Modern PC<br>    ↓<br>UEFI<br>    ↓<br>GPT<br>    ↓<br>Windows 10 / Windows 11</pre><p>If you’re maintaining an older machine that relies on Legacy BIOS, MBR may still be the appropriate choice.</p><p>Understanding this small distinction can save you a lot of frustration when Windows refuses to install, a disk appears with the wrong capacity, or a system suddenly refuses to boot.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ec0ad70393f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSH Host Key Changed: What It Means and How to Fix It Safely]]></title>
            <link>https://medium.com/@sm_85862/ssh-host-key-changed-what-it-means-and-how-to-fix-it-safely-4883c25cdb3e?source=rss-77f8c77817dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4883c25cdb3e</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[ssh-keygen]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <category><![CDATA[ssh-tunnel]]></category>
            <dc:creator><![CDATA[Prasanna balaji K]]></dc:creator>
            <pubDate>Mon, 05 Oct 2026 15:32:08 GMT</pubDate>
            <atom:updated>2026-10-05T15:32:08.391Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*Mf5Q1SREptmN_Mbay6wlOA.png" /></figure><p>While connecting to GitLab:</p><pre>ssh gitlab@10.2.5.61</pre><p>you may see:</p><pre>WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!<br>Host key for 10.2.5.61 has changed and you have requested strict checking.<br>Host key verification failed.</pre><p>In this case, SSH may also report:</p><pre>Offending ECDSA key in C:\Users\Prasanna\.ssh\known_hosts:66</pre><h3>Why does this happen?</h3><p>When you connect to a server for the first time, SSH stores the server’s host key in:</p><pre>C:\Users\Prasanna\.ssh\known_hosts</pre><p>This key is used to verify the server during future connections.</p><p>The connection flow is:</p><pre>First connection<br>      ↓<br>SSH stores the server host key<br>      ↓<br>Future connection<br>      ↓<br>SSH compares the stored key with the current key<br>      ↓<br>Key mismatch = connection blocked</pre><pre>The remote server presented this ED25519 fingerprint:</pre><pre>SHA256:6k14dbnlVWOe...XRkf50E</pre><blockquote><strong><em>Note:</em></strong><em> The fingerprint above is partially masked for security/privacy. When troubleshooting, compare the </em><strong><em>full fingerprint</em></strong><em> from your trusted server console with the fingerprint shown by your SSH client.</em></blockquote><h3>Possible causes</h3><p>A changed host key does not always mean an attack. Common causes include:</p><ul><li>The server was reinstalled</li><li>The operating system was rebuilt</li><li>SSH host keys were regenerated</li><li>A virtual machine was replaced</li><li>The server was restored from a backup</li><li>The IP address was assigned to another server</li></ul><p>However, SSH also protects against a possible <strong>Man-in-the-Middle (MITM) attack</strong>.</p><p><strong>Do not ignore the warning without verifying the server first.</strong></p><h3>Step 1: Verify the New Fingerprint</h3><p>Use a trusted console or another trusted access method to access the Linux server.</p><p>Run:</p><pre>ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub</pre><p>Compare the result with the fingerprint shown by your SSH client.</p><p>Expected fingerprint format:</p><pre>SHA256:6k14dbnlVWOe...XRkf50E</pre><h3>Result</h3><ul><li><strong>Fingerprint matches</strong> → The new host key is expected.</li><li><strong>Fingerprint does not match</strong> → Stop and investigate.</li><li><strong>Server was not rebuilt or changed</strong> → Contact the system administrator.</li></ul><h3>Step 2: Remove the Old Key</h3><p>After confirming that the key change is legitimate, remove the old entry from Windows PowerShell:</p><pre>ssh-keygen -R 10.2.5.61</pre><p>The output should look similar to:</p><pre># Host 10.2.5.61 found: line 66<br># Host 10.2.5.61 removed.</pre><p>This removes the outdated key for 10.2.5.61 from:</p><pre>C:\Users\Prasanna\.ssh\known_hosts</pre><h3>Step 3: Connect Again</h3><p>Run the SSH command again:</p><pre>ssh gitlab@10.2.5.61</pre><p>SSH will display the new fingerprint and ask for confirmation:</p><pre>Are you sure you want to continue connecting (yes/no/[fingerprint])?</pre><p>Only enter:</p><pre>yes</pre><p><strong>after confirming that the fingerprint is correct.</strong></p><p>The new host key will then be saved in:</p><pre>C:\Users\Prasanna\.ssh\known_hosts</pre><h3>Quick Fix for a Confirmed Server Replacement</h3><p>If you have already verified that the server was legitimately replaced:</p><pre>ssh-keygen -R 10.2.5.61<br>ssh gitlab@10.2.5.61</pre><h3>Important</h3><p>Do <strong>not</strong> treat this as a normal connection error.</p><p>The correct order is:</p><pre>Verify the fingerprint<br>        ↓<br>Remove the old key<br>        ↓<br>Connect again<br>        ↓<br>Accept the new key</pre><p>SSH is blocking the connection because the server identity changed. This security check can prevent you from connecting to the wrong machine or exposing credentials to an attacker.</p><h3>Key takeaway</h3><p><strong>Verify → Remove → Reconnect</strong></p><p>Keep the SSH security check enabled, and never accept a changed host key until you know why it changed.</p><p>#CyberSecurity #SSH #Linux #GitLab #DevOps #PowerShell #Windows #SystemAdministration #InformationSecurity #NetworkSecurity</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4883c25cdb3e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Make Windows Think It’s Linux — A Complete Performance Optimisation Guide]]></title>
            <link>https://medium.com/@sm_85862/make-windows-think-its-linux-a-complete-performance-optimisation-guide-a0eac5930208?source=rss-77f8c77817dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0eac5930208</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[system-administration]]></category>
            <dc:creator><![CDATA[Prasanna balaji K]]></dc:creator>
            <pubDate>Sun, 26 Apr 2026 18:40:31 GMT</pubDate>
            <atom:updated>2026-04-26T18:40:31.666Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQ3lPyWUztTAhhP2-U_fIA.png" /></figure><p>Windows can be significantly optimised to feel much snappier. Here’s a comprehensive breakdown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w7S8MgwDeMBV7lqNSQkAzw.png" /></figure><ol><li><strong>Power &amp; Performance Settings</strong></li></ol><ul><li>Set power plan to <strong>Ultimate Performance</strong> (run in CMD as admin: powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61 then select it in Power Options)</li><li>Disable <strong>Fast Startup</strong> — it causes partial shutdowns and memory issues (Power Options → Choose what power buttons do → uncheck Fast Startup)</li><li>Set <strong>Processor power management</strong> min/max to 100% in advanced power settings</li></ul><p><strong>2. Disable Bloat &amp; Background Services</strong></p><p>Run services.msc and set these to <strong>Disabled</strong> or <strong>Manual:</strong></p><ul><li>SysMain (Superfetch) — wastes RAM pre-loading apps</li><li>Windows Search indexing — kills disk I/O on HDDs</li><li>DiagTrack (telemetry) — constant background phoning home</li><li>Windows Update Delivery Optimization</li><li>Xbox services (if not a gamer)</li><li>Print Spooler (if no printer)</li></ul><p><strong>3. Debloat Windows</strong></p><p>Run this in PowerShell as admin — removes preinstalled junk:</p><pre>iwr -useb https://christitus.com/win | iex</pre><p>This is the <strong>Chris Titus Tech Windows Utility</strong> — widely trusted, open source. Lets you remove bloatware, apply tweaks, and install apps cleanly.</p><p><strong>4. Registry &amp; System Tweaks</strong></p><ul><li>Disable <strong>visual effects</strong> → Right click This PC → Properties → Advanced → Performance Settings → Adjust for best performance</li><li>Disable <strong>transparency &amp; animations</strong> in Settings → Personalisation → Colors</li><li>Set <strong>virtual memory</strong> manually (1.5x your RAM as initial, 3x as max) instead of letting Windows manage it</li><li>Enable <strong>Hardware Accelerated GPU Scheduling (HAGS)</strong> if on a modern GPU — Settings → Display → Graphics Settings</li></ul><p><strong>5. Disk &amp; Storage</strong></p><ul><li>Run cleanmgr /sageset:65535 &amp;&amp; cleanmgr /sagerun:65535 in CMD to deep clean system files</li><li>Enable <strong>TRIM</strong> for SSDs: fsutil behavior set DisableDeleteNotify 0</li><li>Disable <strong>Hibernate</strong> if you don’t use it (frees GBs): powercfg -h off</li><li>Move temp files to a RAM disk (using <strong>ImDisk</strong> or <strong>OSFMount</strong>) — huge speed boost for compilation and temp-heavy work</li></ul><p><strong>6. Network Optimisation (Linux-like tuning)</strong></p><p>Open PowerShell as admin and run:</p><pre>netsh int tcp set global autotuninglevel=normal<br>netsh int tcp set global congestionprovider=ctcp<br>netsh int tcp set supplemental template=internet</pre><ul><li>Set your DNS to <strong>1.1.1.1</strong> (Cloudflare) or <strong>8.8.8.8</strong> (Google) — faster than ISP default</li><li>Disable <strong>Nagle’s algorithm</strong> in registry for lower latency (good for dev/gaming): set TcpAckFrequency = 1 and TCPNoDelay = 1 under HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces</li></ul><p><strong>7. Use Linux Tools ON Windows</strong></p><p>This is the biggest game changer — you don’t have to give up Linux:</p><ul><li><strong>WSL2 (Windows Subsystem for Linux)</strong> — run a full Ubuntu/Debian/Kali kernel inside Windows</li></ul><pre>  wsl --install</pre><ul><li><strong>Windows Terminal</strong> — replace CMD/PowerShell with a proper tabbed terminal</li><li><strong>Scoop or Winget</strong> — package managers like apt for Windows</li></ul><pre>winget install &lt;package&gt;</pre><ul><li><strong>PowerShell 7</strong> — much more powerful than the built-in version</li><li><strong>Git Bash</strong> — Unix-style shell on Windows</li></ul><p><strong>8. Kernel &amp; Memory</strong></p><ul><li>Disable <strong>Memory Integrity</strong> (Core Isolation) if not needed — it adds overhead: Settings → Windows Security → Device Security → Core Isolation</li><li>Increase <strong>IRQ priority</strong> for your GPU/NIC using <strong>MSI Mode</strong> (Message Signaled Interrupts) via <strong>MSI Utility v3</strong></li><li>Set <strong>pagefile on your fastest drive</strong> (NVMe if you have one)</li></ul><p><strong>9. Startup &amp; Process Control</strong></p><ul><li>msconfig → Boot → Advanced → set CPU cores to maximum</li><li>Task Manager → Startup → disable everything non-essential</li><li>Use <strong>Process Lasso</strong> (free tier) for real-time CPU priority management — similar to Linux’s nice and cpuset</li></ul><p><strong>10. Developer-Specific (if you code)</strong></p><ul><li>Use <strong>VSCode</strong> with WSL2 remote extension — your code runs on Linux, your UI runs on Windows. Best of both worlds</li><li>Mount your WSL2 filesystem as a network drive for easy access</li><li>Set WSL2 memory limits in C:\Users\&lt;you&gt;\.wslconfig:</li></ul><pre>  [wsl2]<br>  memory=8GB<br>  processors=6<br>  swap=4GB</pre><p>The single biggest wins are: <strong>Ultimate Performance power plan + disabling SysMain + WSL2 + debloat script.</strong> Those four alone will make your machine feel dramatically faster and more like a Linux environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0eac5930208" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built an AI-Powered Terraform Review Pipeline with GitHub Actions and Claude]]></title>
            <link>https://medium.com/@sm_85862/how-i-built-an-ai-powered-terraform-review-pipeline-with-github-actions-and-claude-a51064f8f256?source=rss-77f8c77817dd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a51064f8f256</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[claude]]></category>
            <dc:creator><![CDATA[Prasanna balaji K]]></dc:creator>
            <pubDate>Fri, 24 Apr 2026 17:32:26 GMT</pubDate>
            <atom:updated>2026-04-24T17:32:26.841Z</atom:updated>
            <content:encoded><![CDATA[<h3>How I Built an AI-Powered Terraform Review Pipeline with GitHub Actions and Claude</h3><blockquote><em>Every PR that touches infrastructure deserves a second pair of eyes — I made Claude that second pair.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OAB6I2CdwDTjZ6sWaxjBdA.png" /></figure><h3>The Problem</h3><p>Our team was merging Terraform PRs too fast. Not recklessly — we had peer reviews, terraform plan outputs, and Checkov scans. But reviewers were still missing things: over-permissive IAM roles, missing tags, non-idiomatic module usage, drift-prone resource names.</p><p>The issues weren’t bugs. They were judgment calls — exactly the kind of thing that’s hard to catch in a rules-based linter but easy to spot if you know what you’re looking for.</p><p>I wanted something that could read a Terraform diff and say: <em>“This S3 bucket has no versioning, and this IAM role allows </em><em>* on all actions — you probably want to tighten that.&quot;</em></p><p>So I built it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B4mlUQXMRY1GpwSsDlK89w.png" /></figure><h3>The Architecture</h3><pre>PR opened / updated<br>       │<br>       ▼<br>GitHub Actions Workflow<br>       │<br>       ├── terraform fmt --check<br>       ├── terraform validate<br>       ├── terraform plan (saved as JSON)<br>       │<br>       └── Claude Review Step<br>               │<br>               ├── Reads: git diff (*.tf files)<br>               ├── Reads: terraform plan JSON<br>               └── Posts: structured review comment on the PR</pre><p>Three stages. The first two are standard hygiene. The third is where Claude comes in.</p><h3>Step 1: Capture the Diff and Plan</h3><p>In the workflow, after terraform plan, I export the plan as JSON and capture the .tf file diff:</p><pre>- name: Terraform Plan<br>  id: plan<br>  run: |<br>    terraform plan -out=tfplan<br>    terraform show -json tfplan &gt; tfplan.json</pre><pre>- name: Get Terraform Diff<br>  id: diff<br>  run: |<br>    git diff origin/main...HEAD -- &#39;*.tf&#39; &gt; tf_diff.txt</pre><p>Both files feed into the review step.</p><h3>Step 2: Call Claude via the Anthropic API</h3><p>I wrote a small Python script (review.py) that the workflow calls. It reads the diff and plan, builds a structured prompt, and calls the Claude API.</p><pre>import anthropic<br>import sys</pre><pre>def review_terraform(diff: str, plan: str) -&gt; str:<br>    client = anthropic.Anthropic()</pre><pre>    system_prompt = &quot;&quot;&quot;You are a senior cloud engineer reviewing Terraform infrastructure changes.<br>Your job is to catch issues that automated linters miss: security risks, cost surprises,<br>missing best practices, and unclear intent. Be concise, precise, and actionable.<br>Format your output as:</pre><pre>## Summary<br>One paragraph overview of what this PR changes.</pre><pre>## Issues<br>List only real issues. For each: severity (High/Medium/Low), what it is, why it matters, and how to fix it.</pre><pre>## Suggestions<br>Optional improvements that aren&#39;t blocking.</pre><pre>## Verdict<br>APPROVE / REQUEST CHANGES — one line with a reason.&quot;&quot;&quot;</pre><pre>    user_message = f&quot;&quot;&quot;Review this Terraform PR.</pre><pre>### Git Diff (*.tf files)<br>```hcl<br>{diff[:6000]}</pre><h3>Terraform Plan (JSON summary)</h3><pre>{plan[:4000]}<br>```&quot;&quot;&quot;</pre><pre>    message = client.messages.create(<br>        model=&quot;claude-opus-4-5&quot;,<br>        max_tokens=1500,<br>        system=system_prompt,<br>        messages=[{&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: user_message}]<br>    )</pre><pre>    return message.content[0].text</pre><pre>if __name__ == &quot;__main__&quot;:<br>    with open(&quot;tf_diff.txt&quot;) as f:<br>        diff = f.read()<br>    with open(&quot;tfplan.json&quot;) as f:<br>        plan = f.read()</pre><pre>    review = review_terraform(diff, plan)<br>    print(review)</pre><pre>    with open(&quot;review_output.txt&quot;, &quot;w&quot;) as f:<br>        f.write(review)</pre><p>Key design choices:</p><ul><li><strong>System prompt sets the role clearly.</strong> Claude behaves differently when told it’s a senior engineer doing a real review vs. a general assistant.</li><li><strong>Output is structured.</strong> The fixed format (Summary → Issues → Suggestions → Verdict) makes PR comments readable and consistent.</li><li><strong>Token budgets are explicit.</strong> I cap the diff at 6K chars and plan at 4K to stay well within context limits. For large PRs, I trim to changed resource blocks only.</li></ul><h3>Step 3: Post the Review as a PR Comment</h3><pre>- name: Run Claude Review<br>  env:<br>    ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}<br>  run: python review.py</pre><pre>- name: Post Review Comment<br>  uses: actions/github-script@v7<br>  with:<br>    script: |<br>      const fs = require(&#39;fs&#39;);<br>      const review = fs.readFileSync(&#39;review_output.txt&#39;, &#39;utf8&#39;);</pre><pre>      await github.rest.issues.createComment({<br>        owner: context.repo.owner,<br>        repo: context.repo.repo,<br>        issue_number: context.issue.number,<br>        body: `## 🤖 AI Terraform Review\n\n${review}\n\n---\n*Reviewed by Claude via Anthropic API*`<br>      });</pre><p>The comment appears on the PR within ~30 seconds of a push.</p><h3>The Full Workflow File</h3><pre>name: Terraform Review</pre><pre>on:<br>  pull_request:<br>    paths:<br>      - &#39;**.tf&#39;<br>      - &#39;**.tfvars&#39;</pre><pre>jobs:<br>  review:<br>    runs-on: ubuntu-latest<br>    permissions:<br>      pull-requests: write<br>      contents: read</pre><pre>    steps:<br>      - uses: actions/checkout@v4<br>        with:<br>          fetch-depth: 0</pre><pre>      - uses: hashicorp/setup-terraform@v3<br>        with:<br>          terraform_version: &quot;1.10.x&quot;</pre><pre>      - name: Terraform Init<br>        run: terraform init<br>        env:<br>          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}<br>          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}</pre><pre>      - name: Terraform Format Check<br>        run: terraform fmt -check -recursive</pre><pre>      - name: Terraform Validate<br>        run: terraform validate</pre><pre>      - name: Terraform Plan<br>        run: |<br>          terraform plan -out=tfplan<br>          terraform show -json tfplan &gt; tfplan.json</pre><pre>      - name: Get Terraform Diff<br>        run: git diff origin/main...HEAD -- &#39;*.tf&#39; &gt; tf_diff.txt</pre><pre>      - name: Set up Python<br>        uses: actions/setup-python@v5<br>        with:<br>          python-version: &quot;3.12&quot;</pre><pre>      - name: Install Dependencies<br>        run: pip install anthropic</pre><pre>      - name: Run Claude Review<br>        env:<br>          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}<br>        run: python .github/scripts/review.py</pre><pre>      - name: Post Review Comment<br>        uses: actions/github-script@v7<br>        with:<br>          script: |<br>            const fs = require(&#39;fs&#39;);<br>            const review = fs.readFileSync(&#39;review_output.txt&#39;, &#39;utf8&#39;);<br>            await github.rest.issues.createComment({<br>              owner: context.repo.owner,<br>              repo: context.repo.repo,<br>              issue_number: context.issue.number,<br>              body: `## 🤖 AI Terraform Review\n\n${review}\n\n---\n*Reviewed by Claude via Anthropic API*`<br>            });</pre><h3>A Real Example</h3><p>Here’s the kind of comment the pipeline produced on a recent PR:</p><blockquote><strong><em>## Summary</em></strong><em> This PR provisions a new S3 bucket for application logs and attaches an IAM role for EC2 access.</em></blockquote><blockquote><strong><em>## Issues</em></strong></blockquote><ul><li><strong>High</strong> — aws_s3_bucket has no server_side_encryption_configuration. Log buckets often contain sensitive data; enable SSE-S3 or SSE-KMS.</li><li><strong>Medium</strong> — IAM policy uses &quot;Action&quot;: &quot;s3:*&quot;. Scope this down to s3:PutObject and s3:GetObject only.</li><li><strong>Low</strong> — No lifecycle_rule defined. Log buckets grow indefinitely; add an expiration rule.</li></ul><blockquote><strong><em>## Suggestions</em></strong></blockquote><ul><li>Add force_destroy = false explicitly to avoid accidental deletion.</li></ul><blockquote><strong><em>## Verdict</em></strong><em> REQUEST CHANGES — encryption and IAM scope are blocking.</em></blockquote><p>That’s a review I’d be happy to get from a human. The engineer fixed all three issues before the PR was merged.</p><h3>What It Catches Well</h3><ul><li>Over-permissive IAM policies</li><li>Missing encryption, versioning, or lifecycle rules on storage resources</li><li>Resources without required tags</li><li>Security group rules open to 0.0.0.0/0</li><li>Suspicious destroy operations in the plan</li><li>Non-idiomatic or inconsistent naming</li></ul><h3>What It Doesn’t Replace</h3><ul><li><strong>terraform plan review by a human</strong> for production changes</li><li><strong>Checkov / tfsec</strong> for deterministic policy enforcement</li><li><strong>Cost estimation</strong> (use Infracost for that)</li><li>Domain-specific context that only your team has</li></ul><p>Claude catches judgment calls. It doesn’t replace the full review process — it makes it faster and more thorough.</p><h3>Cost</h3><p>At current API pricing, each review costs roughly <strong>$0.01–$0.04</strong> depending on diff size. For a team running 50 Terraform PRs a month, that’s under $2/month. Cheaper than one missed security misconfiguration.</p><h3>What’s Next</h3><ul><li><strong>Summarize plan cost delta</strong> using Infracost JSON output as additional context</li><li><strong>Thread comments</strong> on specific lines of the diff rather than a top-level PR comment</li><li><strong>Block merge</strong> if Claude returns REQUEST CHANGES with a High severity issue (still evaluating this — noisy CI is its own problem)</li></ul><h3>Wrapping Up</h3><p>The pipeline took about half a day to build and has been running in production for three months. It’s caught real issues on real PRs. More importantly, it’s raised the baseline quality of Terraform reviews — engineers write better code knowing it’ll be reviewed consistently.</p><p>If you’re already running GitHub Actions for Terraform, adding this is low effort and high value. The hardest part is writing a good system prompt. Start there.</p><p><em>Have questions or want to share how you’ve extended this? Drop a comment below.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a51064f8f256" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>