<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>BytesNation</title><description>Technical field notes from a systems architect who builds in the open. Homelab infrastructure, cybersecurity operations, network design, and the tools that run them.</description><link>https://bytesnation.com/</link><language>en-us</language><item><title>Agentic Claude Code: How Agents, Hooks, and Orchestration Actually Work</title><link>https://bytesnation.com/blog/claude-agents-full-workflow/</link><guid isPermaLink="true">https://bytesnation.com/blog/claude-agents-full-workflow/</guid><description>Most people use Claude Code like a chatbot. Real agentic workflows use specialized agents, an orchestrator that routes without coding, and hooks that guard every dangerous operation. Here is how all of it works and how to configure it yourself.</description><pubDate>Sun, 03 May 2026 00:00:00 GMT</pubDate><enclosure url="https://bytesnation.com/blog/claude-agents-full-workflow-header.png" length="0" type="image/png"/></item><item><title>[Field Notes] Proxmox VE Node Hardening: SSH Lockdown and Non-Root Admin Access</title><link>https://bytesnation.com/field-notes/proxmox-ve-node-hardening/</link><guid isPermaLink="true">https://bytesnation.com/field-notes/proxmox-ve-node-hardening/</guid><description>Default Proxmox hands root SSH to anyone who can reach port 22. Three targeted layers close that gap: a non-root admin with sudo, root SSH disabled, and iptables restricting SSH to your bastion only.</description><pubDate>Sun, 26 Apr 2026 00:00:00 GMT</pubDate><enclosure url="https://bytesnation.com/blog/proxmox-node-hardening.png" length="0" type="image/png"/></item><item><title>[Field Notes] Building a Zero-Trust Homelab with YubiKey PIV</title><link>https://bytesnation.com/field-notes/yubikey-piv-zero-trust-homelab/</link><guid isPermaLink="true">https://bytesnation.com/field-notes/yubikey-piv-zero-trust-homelab/</guid><description>Hardware-backed authentication for your homelab using YubiKey PIV smart cards, a private CA, SSH hardening, digital signing, and a Bastion server. No cloud dependencies. No subscriptions. Full control.</description><pubDate>Sat, 25 Apr 2026 00:00:00 GMT</pubDate><enclosure url="https://bytesnation.com/blog/yubikey-piv-zero-trust-homelab.png" length="0" type="image/png"/></item><item><title>How Do You Know That Download Is Safe? Checksums, GPG, and File Integrity Explained.</title><link>https://bytesnation.com/blog/checksums-gpg-file-integrity/</link><guid isPermaLink="true">https://bytesnation.com/blog/checksums-gpg-file-integrity/</guid><description>Downloading a file and running it is an act of trust. Checksums prove the file wasn&apos;t corrupted. GPG signatures prove who sent it. Here is how to verify both, from first principles.</description><pubDate>Thu, 23 Apr 2026 00:00:00 GMT</pubDate><enclosure url="https://bytesnation.com/blog/checksums-gpg-file-integrity-header.png" length="0" type="image/png"/></item><item><title>167 Vulnerabilities, One Exploited Zero-Day, and a Secure Boot Clock: Microsoft April 2026 Patch Tuesday</title><link>https://bytesnation.com/blog/april-2026-patch-tuesday-sharepoint-zero-day/</link><guid isPermaLink="true">https://bytesnation.com/blog/april-2026-patch-tuesday-sharepoint-zero-day/</guid><description>Microsoft&apos;s April 14 update patches 167 flaws including an actively exploited SharePoint zero-day now on CISA&apos;s Known Exploited Vulnerabilities list. Federal agencies have until April 28 to patch. You should not wait either.</description><pubDate>Thu, 16 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;167-vulnerabilities-one-exploited-zero-day-and-a-secure-boot-clock-microsoft-april-2026-patch-tuesday&quot;&gt;167 Vulnerabilities, One Exploited Zero-Day, and a Secure Boot Clock: Microsoft April 2026 Patch Tuesday&lt;/h2&gt;
&lt;p&gt;One zero-day is being actively exploited right now. A second was publicly disclosed before Microsoft had a fix ready. A third vulnerability has working exploit code sitting on GitHub. And in 71 days, Secure Boot certificates issued in 2011 expire across every Windows device that has not applied this week’s update.&lt;/p&gt;
&lt;p&gt;That is the state of Microsoft’s April 2026 Patch Tuesday, released April 14.&lt;/p&gt;
&lt;p&gt;167 vulnerabilities. Eight rated Critical. Two zero-days. One of them landed in CISA’s Known Exploited Vulnerabilities catalog the same day the patches dropped.&lt;/p&gt;
&lt;p&gt;This is not a routine monthly update.&lt;/p&gt;
&lt;h3 id=&quot;what-patch-tuesday-actually-is&quot;&gt;What Patch Tuesday Actually Is&lt;/h3&gt;
&lt;p&gt;Every second Tuesday of the month, Microsoft releases security updates for Windows, Office, SharePoint, Defender, and dozens of other products. It is the primary mechanism through which Microsoft closes vulnerabilities that researchers, its own teams, and sometimes attackers have identified.&lt;/p&gt;
&lt;p&gt;Most months, a typical enterprise IT team reviews the list, triages by severity, and schedules deployments. Home users with automatic updates enabled get it in the background without thinking about it.&lt;/p&gt;
&lt;p&gt;This month, triage means acknowledging that at least one of these flaws is already being used against real targets. The clock started before the patches dropped.&lt;/p&gt;
&lt;h3 id=&quot;the-sharepoint-zero-day&quot;&gt;The SharePoint Zero-Day&lt;/h3&gt;
&lt;p&gt;&lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-cve&quot;&gt;CVE&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-cve&quot;&gt;A standardized identifier for publicly known cybersecurity vulnerabilities, enabling organizations to track and prioritize security patches. &lt;a href=&quot;https://bytesnation.com/dictionary/cve/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;-2026-32201 is a spoofing vulnerability in Microsoft SharePoint Server. CVSS score: 6.5. That rating sounds moderate, but the exploitation status changes the calculus entirely.&lt;/p&gt;
&lt;p&gt;The flaw stems from improper input validation in SharePoint. An unauthenticated attacker can reach it over the network with no privileges required and no user interaction needed. That is the most dangerous combination on the CVSS attack vector scale. No &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-phishing&quot;&gt;phishing&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-phishing&quot;&gt;A social engineering attack that uses fraudulent emails, messages, or websites to trick people into revealing passwords, financial information, or installing malware. &lt;a href=&quot;https://bytesnation.com/dictionary/phishing/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; email. No employee clicking anything. An attacker with network access triggers the flaw and gains the ability to view sensitive information and modify it.&lt;/p&gt;
&lt;p&gt;Affected versions are the on-premises deployments: SharePoint Enterprise Server 2016, SharePoint Server 2019, and SharePoint Server Subscription Edition. Organizations running SharePoint Online through Microsoft 365 are not affected by this CVE. Microsoft patches the cloud version on their side.&lt;/p&gt;
&lt;p&gt;For SMBs and organizations that host SharePoint Server on their own infrastructure, this vulnerability is actively being weaponized. Microsoft confirmed exploitation in the wild but has not released attribution, indicators of compromise, or details about the scale of attacks. CISA added CVE-2026-32201 to its Known Exploited Vulnerabilities catalog on April 14, the same day patches were published. Federal agencies have until April 28 to remediate. That 14-day window signals how seriously the vulnerability is being treated.&lt;/p&gt;
&lt;p&gt;The information CISA does not release matters here too. The absence of public indicators means your detection capability for active exploitation of this flaw is limited until more telemetry surfaces. Patching eliminates the exposure. Waiting to patch while hoping logs will catch it is not a viable strategy.&lt;/p&gt;
&lt;h3 id=&quot;the-remote-desktop-spoofing-zero-day&quot;&gt;The Remote Desktop Spoofing Zero-Day&lt;/h3&gt;
&lt;p&gt;CVE-2026-26151 is a spoofing vulnerability in Remote Desktop Protocol with a CVSS score of 7.1. It was publicly disclosed before Microsoft had a patch available. The disclosure came from the UK National Cyber Security Centre.&lt;/p&gt;
&lt;p&gt;Public disclosure before a patch means every threat actor with access to the NCSC advisory had a description of the flaw and days or weeks to develop exploit capability before a fix existed. Microsoft rates CVE-2026-26151 as “Exploitation More Likely,” which is a specific internal determination that their analysts believe the technical barrier to weaponizing this flaw is low.&lt;/p&gt;
&lt;p&gt;RDP spoofing vulnerabilities allow an attacker to intercept or impersonate remote sessions. In an environment where remote work is standard and RDP is the primary access mechanism for thousands of SMBs, a spoofing flaw creates the conditions for credential theft, session hijacking, and lateral movement through an internal network.&lt;/p&gt;
&lt;p&gt;This one was patched without known active exploitation confirmed. That window narrows the moment the exploit development community finishes analyzing the diff between the patched and unpatched binaries.&lt;/p&gt;
&lt;h3 id=&quot;the-defender-flaw-with-code-on-github&quot;&gt;The Defender Flaw with Code on GitHub&lt;/h3&gt;
&lt;p&gt;CVE-2026-33825 is an elevation of privilege vulnerability in Microsoft Defender. It was publicly disclosed before the patch, and working exploit code was posted to GitHub on April 3. That is eleven days of public exposure before today’s fix.&lt;/p&gt;
&lt;p&gt;Elevation of privilege vulnerabilities are rarely standalone attacks. An attacker uses initial access through phishing, an unpatched RCE, or a compromised credential to gain a low-privileged foothold, then runs the EoP to escalate to SYSTEM or Administrator. CVE-2026-33825 is the escalation half of that chain.&lt;/p&gt;
&lt;p&gt;The difference between a disclosed EoP with no public exploit and one with code on GitHub is operational. Attackers do not need to develop their own. They copy, compile, and run. That lowers the skill floor for exploitation significantly.&lt;/p&gt;
&lt;p&gt;Microsoft Defender is installed on essentially every modern Windows system. The reach of this vulnerability is total.&lt;/p&gt;
&lt;h3 id=&quot;the-new-rdp-phishing-protection&quot;&gt;The New RDP Phishing Protection&lt;/h3&gt;
&lt;p&gt;Beyond the zero-days, KB5083769 introduces a behavioral change to how Windows handles .rdp files.&lt;/p&gt;
&lt;p&gt;When a user opens a Remote Desktop configuration file, Windows now displays all requested connection settings before establishing any connection. Each setting is shown and disabled by default. A one-time security warning fires the first time an .rdp file is opened on a given device.&lt;/p&gt;
&lt;p&gt;This matters because .rdp files have become a common phishing payload. Attackers craft configuration files that point the victim’s machine at an attacker-controlled RDP server. When the victim opens the file, their machine connects, presenting credentials that the attacker captures. The session itself may be invisible to the user if the connection parameters are set to minimize the window or redirect input silently.&lt;/p&gt;
&lt;p&gt;The previous default behavior allowed .rdp files to connect silently with no user review of the connection parameters. Tax season phishing campaigns documented by Proofpoint in early 2026 included RDP file delivery as one of their payload methods, alongside RMM tools and malware loaders. The new Windows behavior surfaces the connection request and gives the user a chance to reject it.&lt;/p&gt;
&lt;p&gt;It does not prevent someone from ignoring the warning. It does eliminate the silent, automatic execution that made .rdp phishing effective.&lt;/p&gt;
&lt;h3 id=&quot;the-secure-boot-certificate-clock&quot;&gt;The Secure Boot Certificate Clock&lt;/h3&gt;
&lt;p&gt;The April update also begins the migration away from Secure Boot certificates issued in 2011. Those certificates expire on June 26, 2026. That is 71 days from today.&lt;/p&gt;
&lt;p&gt;Secure Boot is the firmware-level protection that validates the digital signature of boot-critical components before the operating system loads. It is the primary defense against bootkit malware that installs itself below the OS level and survives full reinstalls.&lt;/p&gt;
&lt;p&gt;BlackLotus is the concrete example. It was confirmed active in the wild in 2023 and 2024, capable of bypassing Secure Boot on unpatched systems, persisting through OS reinstallation, and disabling security software before the OS fully initializes. Protecting against BlackLotus requires specific Secure Boot certificate revocations that depend on the updated certificate infrastructure. Once the 2011 certificates expire in June, devices without updated Secure Boot certificates lose that protection layer entirely.&lt;/p&gt;
&lt;p&gt;This is not a vulnerability in the traditional sense. It is scheduled expiration of foundational cryptographic infrastructure. The impact is structural: it removes a core layer of boot-level defense across every unpatched Windows device simultaneously on June 26.&lt;/p&gt;
&lt;p&gt;A prior patch cycle had introduced a bug where applying the Secure Boot certificate update triggered BitLocker Recovery mode on affected devices, forcing users to enter their BitLocker recovery key on every reboot. That bug is resolved in KB5083769. Devices that avoided the earlier update due to the BitLocker loop can now apply the April patch without that risk.&lt;/p&gt;
&lt;h3 id=&quot;what-to-do-right-now&quot;&gt;What to Do Right Now&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;For home Windows users:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open Settings and navigate to Windows Update. Install all pending updates now. KB5083769 applies to Windows 11 versions 24H2 and 25H2. Windows 10 has a corresponding update in the same release cycle.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify the update installed. Go to Settings, then Windows Update, then Update History. Confirm KB5083769 appears in the list as successfully installed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Locate your BitLocker recovery key before rebooting after the update. The known bug that caused BitLocker Recovery loops is fixed in this patch, but systems in a partial update state from earlier cycles may still trigger it. Your BitLocker recovery key is stored in your Microsoft account at account.microsoft.com under the Devices section if you connected your device to a Microsoft account. Write it down or save it somewhere accessible from another device before you update.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Expect a new dialog when opening .rdp files. If you use Remote Desktop for work or home lab access and store .rdp configuration files, Windows will now prompt you to review connection settings before connecting. This is intentional. Review what the file is requesting before accepting.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;For SMBs running SharePoint Server on-premises:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Patch immediately. CVE-2026-32201 is under active exploitation. Every hour without the patch is exposure. Microsoft has released updates for SharePoint 2016, 2019, and Subscription Edition. Apply them now, not during the next maintenance window.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Pull SharePoint access logs for the past 30 days and look for requests from unfamiliar &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-ip-address&quot;&gt;IP&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-ip-address&quot;&gt;A unique numerical label assigned to every device on a network, used to identify it and route traffic to the correct destination. &lt;a href=&quot;https://bytesnation.com/dictionary/ip-address/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; addresses, unusual authentication patterns, or access to documents by accounts that do not normally access them. You may not find indicators, but you need to look.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If your SharePoint Server is reachable from the public internet, evaluate whether that exposure is operationally necessary. Network-layer controls and access restrictions reduce exposure while patching is being staged.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Monitor CISA’s KEV catalog and Microsoft’s Security Response Center for updated indicators as more becomes known about the active exploitation campaign.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;For anyone using Remote Desktop:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;If you received an .rdp file by email that you were not expecting, do not open it. Verify with the sender through a separate channel before touching the file.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Ensure your system has applied the April update to get the CVE-2026-26151 patch. Home users with automatic updates enabled are covered. Check your update history to confirm.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If you run an RDP server for home lab access or remote work, confirm it is behind a &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-vpn&quot;&gt;VPN&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-vpn&quot;&gt;A virtual private network that creates an encrypted tunnel between your device and a remote network, protecting your traffic from interception. &lt;a href=&quot;https://bytesnation.com/dictionary/vpn/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; or network-level authentication and not directly exposed to the internet on &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-port&quot;&gt;port&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-port&quot;&gt;A numbered endpoint on a device that identifies a specific application or service, allowing multiple network services to run on the same IP address. &lt;a href=&quot;https://bytesnation.com/dictionary/port/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; 3389. Direct internet exposure of RDP is a persistent attack surface.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;the-bigger-picture&quot;&gt;The Bigger Picture&lt;/h3&gt;
&lt;p&gt;April 2026 Patch Tuesday is among the largest in Microsoft’s history by CVE count. The trend line is not favorable. Monthly patch volumes have grown year over year, the proportion of vulnerabilities rated Important or Critical has not declined, and active exploitation at patch release is increasingly the norm rather than the exception.&lt;/p&gt;
&lt;p&gt;The gap between patch availability and actual deployment is where attackers operate. For CVE-2026-32201, CISA’s 14-day federal remediation mandate reflects the reality that exploitation is live and the window is short. Organizations that treat Patch Tuesday as a routine two-week cycle are already inside that window.&lt;/p&gt;
&lt;p&gt;The Secure Boot certificate expiry is a different kind of pressure. It is not a vulnerability someone discovered. It is scheduled infrastructure failure. The deadline is on the calendar. Devices that do not apply the chain of updates before June 26 lose their boot-level defense against one of the most persistent malware categories known. That outcome is preventable with updates that are already available.&lt;/p&gt;
&lt;p&gt;The new RDP file protection is a small change with meaningful impact on a real attack vector that has been in active use. Microsoft making this the default behavior across Windows 11 closes a door that should have been closed earlier.&lt;/p&gt;
&lt;p&gt;Patch Tuesday arrives on a schedule. The threats that exploit the gap do not.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.bleepingcomputer.com/news/microsoft/microsoft-april-2026-patch-tuesday-fixes-167-flaws-2-zero-days/&quot;&gt;Microsoft April 2026 Patch Tuesday Fixes 167 Flaws, 2 Zero-Days (BleepingComputer)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://thehackernews.com/2026/04/microsoft-issues-patches-for-sharepoint.html&quot;&gt;Microsoft Issues Patches for SharePoint Zero-Day and 168 Other New Vulnerabilities (The Hacker News)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://nvd.nist.gov/vuln/detail/CVE-2026-32201&quot;&gt;CVE-2026-32201 Detail (National Vulnerability Database)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.cisa.gov/known-exploited-vulnerabilities-catalog&quot;&gt;CISA Known Exploited Vulnerabilities Catalog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.tenable.com/blog/microsofts-april-2026-patch-tuesday-addresses-163-cves-cve-2026-32201&quot;&gt;Microsoft’s April 2026 Patch Tuesday Addresses 163 CVEs (Tenable)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://windowsnews.ai/article/windows-11-kb5083769-update-adds-critical-rdp-security-warnings-to-block-phishing-attacks.413296&quot;&gt;Windows 11 KB5083769 Update Adds Critical RDP Security Warnings (Windows News)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://support.microsoft.com/en-gb/topic/april-14-2026-kb5083769-os-builds-26200-8246-and-26100-8246-22f90ae5-9f26-40ac-9134-6a586a71163b&quot;&gt;April 14, 2026 - KB5083769 (Microsoft Support)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://thecybrdef.com/windows-11-april-2026-update-secure-boot-rdp-phishing-fix/&quot;&gt;Windows 11 April 2026 Update Fixes Secure Boot and RDP Phishing (CybrDef)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.cybersecuritydive.com/news/medium-severity-flaw-microsoft-sharepoint-exploitation/817559/&quot;&gt;Medium-Severity Flaw in Microsoft SharePoint Exploited (Cybersecurity Dive)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://securityaffairs.com/190831/security/microsoft-patch-tuesday-for-april-2026-fixed-actively-exploited-sharepoint-zero-day.html&quot;&gt;Microsoft Patch Tuesday for April 2026 Fixed Actively Exploited SharePoint Zero-Day (Security Affairs)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.zerodayinitiative.com/blog/2026/4/14/the-april-2026-security-update-review&quot;&gt;The April 2026 Security Update Review (Zero Day Initiative)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://securityonline.info/cisa-kev-sharepoint-spoofing-legacy-office-rce-alert/&quot;&gt;Active SharePoint Spoofing and Legacy Office RCE: CISA Alerts on New KEV Exploits (Security Online)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/april-2026-patch-tuesday-header.png" length="0" type="image/png"/></item><item><title>Operation Masquerade: FBI, NSA, and DOJ Dismantle Russian GRU Router Hijacking Network</title><link>https://bytesnation.com/blog/operation-masquerade-gru-router-takedown/</link><guid isPermaLink="true">https://bytesnation.com/blog/operation-masquerade-gru-router-takedown/</guid><description>Russian military intelligence compromised consumer routers across 23 states using a TP-Link zero-day. A joint FBI, NSA, and DOJ operation shut it down on April 7, 2026.</description><pubDate>Wed, 15 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;operation-masquerade-fbi-nsa-and-doj-dismantle-gru-router-hijacking-network&quot;&gt;Operation Masquerade: FBI, NSA, and DOJ Dismantle GRU Router Hijacking Network&lt;/h2&gt;
&lt;p&gt;Your home router might have been a Russian intelligence asset. That is not speculation. That is what the FBI, NSA, and Department of Justice confirmed on April 7, 2026, when they &lt;a href=&quot;https://www.justice.gov/opa/pr/justice-department-conducts-court-authorized-disruption-dns-hijacking-network-controlled&quot;&gt;announced the court-authorized disruption&lt;/a&gt; of a &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-dns&quot;&gt;DNS&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-dns&quot;&gt;The system that translates human-readable domain names into IP addresses so devices can find each other on a network. &lt;a href=&quot;https://bytesnation.com/dictionary/dns/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; hijacking network operated by Russian military intelligence.&lt;/p&gt;
&lt;p&gt;The operation’s name: &lt;strong&gt;Masquerade&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id=&quot;the-threat&quot;&gt;The Threat&lt;/h3&gt;
&lt;p&gt;GRU Unit 26165, the 85th Main Special Service Center (85th GTsSS), ran this campaign. You might know them better as &lt;strong&gt;APT28&lt;/strong&gt; or &lt;strong&gt;Fancy Bear&lt;/strong&gt;. They are the same group behind the 2016 DNC breach, the SolarWinds campaign follow-on operations, and a long list of espionage operations targeting NATO governments.&lt;/p&gt;
&lt;p&gt;This time, they went after something most people never think about: the DNS resolver settings on consumer-grade routers.&lt;/p&gt;
&lt;h3 id=&quot;how-it-worked&quot;&gt;How It Worked&lt;/h3&gt;
&lt;p&gt;The attack chain started with &lt;a href=&quot;https://www.nsa.gov/Press-Room/Press-Releases-Statements/Press-Release-View/Article/4453919/&quot;&gt;CVE-2023-50224&lt;/a&gt;, a remote code execution vulnerability in TP-Link router firmware. The GRU exploited this flaw to gain administrative access to devices without any user interaction. No &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-phishing&quot;&gt;phishing&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-phishing&quot;&gt;A social engineering attack that uses fraudulent emails, messages, or websites to trick people into revealing passwords, financial information, or installing malware. &lt;a href=&quot;https://bytesnation.com/dictionary/phishing/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; email. No credential theft. Just a vulnerable router connected to the internet.&lt;/p&gt;
&lt;p&gt;Once inside, the operators modified the router’s DNS configuration to point at GRU-controlled resolvers. Every device on that network, laptops, phones, smart home gear, then had its DNS queries routed through Russian intelligence infrastructure.&lt;/p&gt;
&lt;p&gt;That enabled an &lt;strong&gt;Adversary-in-the-Middle (AiTM)&lt;/strong&gt; attack chain. The GRU resolvers could redirect traffic to spoofed login pages, intercept authentication tokens, inject malicious payloads into unencrypted connections, and quietly map every device and service on the target network. The compromised router owners had &lt;a href=&quot;https://www.ic3.gov/PSA/2026/PSA260407&quot;&gt;no visible indication anything had changed&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This follows a pattern. In February 2024, a &lt;a href=&quot;https://media.defense.gov/2024/Feb/27/2003400753/-1/-1/0/CSA-Russian-Actors-Use-Routers-Facilitate-Cyber_Operations.PDF&quot;&gt;joint cybersecurity advisory&lt;/a&gt; warned that Russian state actors were compromising Ubiquiti EdgeRouters for the same purpose: converting consumer networking equipment into espionage infrastructure. Operation Masquerade shows the GRU simply shifted to a different vendor when the first vector got burned.&lt;/p&gt;
&lt;h3 id=&quot;the-scale&quot;&gt;The Scale&lt;/h3&gt;
&lt;p&gt;Routers were compromised across &lt;strong&gt;23 U.S. states&lt;/strong&gt;. The FBI’s Internet Crime Complaint Center published a &lt;a href=&quot;https://www.ic3.gov/PSA/2026/PSA260407&quot;&gt;public service announcement&lt;/a&gt; confirming the geographic spread. This was not a targeted strike against defense contractors or government agencies. It was a broad collection operation touching residential and small business networks.&lt;/p&gt;
&lt;p&gt;As &lt;a href=&quot;https://cyberscoop.com/fbi-operation-masquerade-russian-gru-router-takedown-brett-leatherman/&quot;&gt;FBI Cyber Division Assistant Director Brett Leatherman told CyberScoop&lt;/a&gt;, the operation represented a shift in Russian cyber tradecraft toward leveraging commodity hardware at scale rather than investing in bespoke implants for high-value targets.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://www.cybersecuritydive.com/news/russia-routers-hacking-dns-fbi-disruption/816960/&quot;&gt;Microsoft threat intelligence&lt;/a&gt; confirmed overlap between the infrastructure used in Operation Masquerade and previous APT28 campaigns targeting European government networks, indicating this was one node in a larger global operation.&lt;/p&gt;
&lt;h3 id=&quot;what-stopped-it&quot;&gt;What Stopped It&lt;/h3&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.justice.gov/opa/pr/justice-department-conducts-court-authorized-disruption-dns-hijacking-network-controlled&quot;&gt;DOJ obtained court authorization&lt;/a&gt; in the Eastern District of Pennsylvania to disrupt the network. The operation, executed jointly by the FBI and NSA, neutralized the GRU-controlled DNS infrastructure and severed the command-and-control links to compromised routers.&lt;/p&gt;
&lt;p&gt;This is the same legal and operational playbook the FBI used to dismantle the Cyclops Blink &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-botnet&quot;&gt;botnet&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-botnet&quot;&gt;A network of compromised devices (bots) controlled remotely by an attacker to carry out coordinated attacks like DDoS, spam, or credential stuffing. &lt;a href=&quot;https://bytesnation.com/dictionary/botnet/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; in 2022 and the GRU’s Ubiquiti router network in 2024. Court-authorized, technically precise, and focused on cutting the adversary’s access without bricking the devices.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.nsa.gov/Press-Room/Press-Releases-Statements/Press-Release-View/Article/4453919/&quot;&gt;NSA’s press release&lt;/a&gt; emphasized that the disruption was a joint effort across intelligence and law enforcement, reflecting the growing convergence of cyber defense and counterintelligence operations.&lt;/p&gt;
&lt;h3 id=&quot;what-you-should-do&quot;&gt;What You Should Do&lt;/h3&gt;
&lt;p&gt;The takedown cut the GRU’s access to the command infrastructure. It did not patch your router. If you have a TP-Link device, assume it needs attention.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Immediate actions:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Check your DNS settings.&lt;/strong&gt; Log into your router’s admin panel. If the DNS servers are set to anything you did not configure, your device was likely compromised. Reset them to your ISP’s defaults or a trusted resolver (1.1.1.1, 8.8.8.8, 9.9.9.9).&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Update firmware.&lt;/strong&gt; Check TP-Link’s support site for the latest firmware addressing &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-cve&quot;&gt;CVE&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-cve&quot;&gt;A standardized identifier for publicly known cybersecurity vulnerabilities, enabling organizations to track and prioritize security patches. &lt;a href=&quot;https://bytesnation.com/dictionary/cve/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;-2023-50224. Apply it now.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Factory reset.&lt;/strong&gt; If your router was compromised, a firmware update alone may not be sufficient. Factory reset the device, apply the latest firmware, and reconfigure from scratch.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Change credentials.&lt;/strong&gt; If the default admin password was still in place, that was part of the problem. Set a strong, unique password for the router admin interface.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Disable remote management.&lt;/strong&gt; Unless you have a specific operational need for remote admin access, turn it off. It is an attack surface you do not need.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Consider replacement.&lt;/strong&gt; If your TP-Link device is end-of-life and no longer receiving firmware updates, replace it. Running unpatched networking equipment on the internet is not a risk you can manage your way out of.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Report.&lt;/strong&gt; If you believe your router was compromised, file a report with the &lt;a href=&quot;https://www.ic3.gov/PSA/2026/PSA260407&quot;&gt;FBI’s IC3&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;the-bottom-line&quot;&gt;The Bottom Line&lt;/h3&gt;
&lt;p&gt;Foreign intelligence services are not just targeting Fortune 500 companies and government agencies. They are targeting the $40 router sitting on your desk. The device you set up once and forgot about is exactly the kind of infrastructure a nation-state operator loves: always on, rarely monitored, broadly trusted by every device behind it.&lt;/p&gt;
&lt;p&gt;Operation Masquerade is a reminder that network security starts at the edge. Your router is your perimeter. Treat it like one.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Sources:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.ic3.gov/PSA/2026/PSA260407&quot;&gt;FBI IC3 Public Service Announcement (PSA260407)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.nsa.gov/Press-Room/Press-Releases-Statements/Press-Release-View/Article/4453919/&quot;&gt;NSA Press Release: Operation Masquerade&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.justice.gov/opa/pr/justice-department-conducts-court-authorized-disruption-dns-hijacking-network-controlled&quot;&gt;DOJ: Court-Authorized Disruption of DNS Hijacking Network&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://media.defense.gov/2024/Feb/27/2003400753/-1/-1/0/CSA-Russian-Actors-Use-Routers-Facilitate-Cyber_Operations.PDF&quot;&gt;Joint CSA: Russian Actors Use Compromised Routers (Feb 2024)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cyberscoop.com/fbi-operation-masquerade-russian-gru-router-takedown-brett-leatherman/&quot;&gt;CyberScoop: FBI Operation Masquerade Interview with Brett Leatherman&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.cybersecuritydive.com/news/russia-routers-hacking-dns-fbi-disruption/816960/&quot;&gt;Cybersecurity Dive: Russia Router Hacking DNS FBI Disruption&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/operation-masquerade-header.png" length="0" type="image/png"/></item><item><title>Stanford Just Dropped AI&apos;s Report Card. The Numbers Do Not Care About Your Feelings.</title><link>https://bytesnation.com/blog/stanford-ai-index-2026/</link><guid isPermaLink="true">https://bytesnation.com/blog/stanford-ai-index-2026/</guid><description>The 2026 AI Index is out. AI data centers draw enough power to run New York. Entry-level dev hiring is down 20%. Benchmarks are broken. Investment hit $581 billion. Here is what matters and what to do about it.</description><pubDate>Tue, 14 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;stanford-just-dropped-ais-report-card-the-numbers-do-not-care-about-your-feelings&quot;&gt;Stanford Just Dropped AI’s Report Card. The Numbers Do Not Care About Your Feelings.&lt;/h2&gt;
&lt;p&gt;Stanford HAI publishes the AI Index every year. It is the closest thing the industry has to an objective, data-backed SITREP on where AI actually stands. Not the VC pitch. Not the Twitter hype cycle. The data.&lt;/p&gt;
&lt;p&gt;The 2026 report dropped today. 300+ pages of charts, benchmarks, economic data, policy analysis. You are not going to read it. Here is what matters.&lt;/p&gt;
&lt;h3 id=&quot;models-are-outrunning-everything&quot;&gt;Models Are Outrunning Everything&lt;/h3&gt;
&lt;p&gt;SWE-bench Verified, the software engineering benchmark, jumped from 60% top scores in 2024 to nearly 100% in 2025. AI agents handling real-world tasks went from a 20% success rate to 77.3%. Cybersecurity agents hit 93% problem resolution, up from 15% in 2024.&lt;/p&gt;
&lt;p&gt;Frontier models now match or exceed human experts on PhD-level science, competition math, and multimodal reasoning.&lt;/p&gt;
&lt;p&gt;Sounds like a clean win. It is not.&lt;/p&gt;
&lt;h3 id=&quot;the-benchmarks-are-broken&quot;&gt;The Benchmarks Are Broken&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/ai-index-benchmarks.png&quot; alt=&quot;Perceived Progress vs The Reality Check. SWE-bench at 100%, agent success at 77.3%, but the leading math benchmark has a 42% error rate.&quot;&gt;&lt;/p&gt;
&lt;p&gt;The tests measuring AI progress are failing. A widely used math benchmark has a 42% error rate in its own questions. Models trained on benchmark data game the scores without getting smarter. Strong benchmark numbers do not translate to real-world performance. For AI agents and robotics, reliable benchmarks barely exist.&lt;/p&gt;
&lt;p&gt;The Foundation Model Transparency Index dropped from 58 to 40. Companies are disclosing less about training data, parameter counts, and safety evaluations. The most powerful models are the ones we know the least about.&lt;/p&gt;
&lt;p&gt;That is not a measurement problem. That is an operational risk.&lt;/p&gt;
&lt;h3 id=&quot;us-and-china-razor-thin-margins&quot;&gt;US and China: Razor Thin Margins&lt;/h3&gt;
&lt;p&gt;The geopolitical race is tighter than the headlines suggest. Anthropic leads the Arena leaderboard as of March 2026. xAI, Google, OpenAI trail close. DeepSeek and Alibaba lag by single digits. In February 2025, DeepSeek R1 briefly matched the top US model.&lt;/p&gt;
&lt;p&gt;The US has 5,427 data centers. 10x more than any other country. China leads in research publications, patents, and industrial robotics. Different playbooks, same objective.&lt;/p&gt;
&lt;p&gt;The talent pipeline is a problem. AI researcher migration to the US dropped 89% since 2017. Down 80% in the last year alone. The US is still building the best models but the bench is getting thin.&lt;/p&gt;
&lt;h3 id=&quot;the-power-bill&quot;&gt;The Power Bill&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/ai-index-power-usage.png&quot; alt=&quot;29.6 GW global AI data center power draw. 12M human equivalents of water consumed by GPT-4o. 72,816 tons CO2 from training Grok 4.&quot;&gt;&lt;/p&gt;
&lt;p&gt;29.6 gigawatts. That is what AI data centers draw globally. Enough to run the entire state of New York at peak demand.&lt;/p&gt;
&lt;p&gt;GPT-4o annual water consumption exceeds the drinking water needs of 12 million people. Training Grok 4 produced 72,816 tons of CO2. Equivalent to 17,000 cars running for a year.&lt;/p&gt;
&lt;p&gt;This is not a side effect. This is the cost of operations. Every model improvement requires more compute, more power, more cooling, more physical infrastructure.&lt;/p&gt;
&lt;p&gt;Global corporate AI investment hit $581.7 billion in 2025. Up 130%. Private investment: $344.7 billion. The US alone: $285.9 billion, 23x China’s reported private spend. The World Economic Forum puts the total hardware buildout at $7 trillion.&lt;/p&gt;
&lt;p&gt;One company in Taiwan fabricates almost every leading AI chip. TSMC. That is a single point of failure for the entire global AI supply chain. One geopolitical incident and the whole stack is compromised.&lt;/p&gt;
&lt;h3 id=&quot;the-job-market-is-already-moving&quot;&gt;The Job Market Is Already Moving&lt;/h3&gt;
&lt;p&gt;Employment for software developers aged 22 to 25 is down nearly 20% since 2022. Older developer hiring is still growing. Same pattern in customer support and other high-AI-exposure roles.&lt;/p&gt;
&lt;p&gt;Productivity gains: 26% in software development, 14% in customer service. A third of organizations surveyed by McKinsey plan to cut headcount this year. Deepest cuts: service operations and software engineering.&lt;/p&gt;
&lt;p&gt;53% of the global population adopted generative AI within three years. Faster than the PC. Faster than the internet. 88% of organizations are running it. 80% of university students use it.&lt;/p&gt;
&lt;p&gt;Entry-level roles built on repetitive, well-documented tasks are getting compressed first. That is not a prediction. That is the current trendline.&lt;/p&gt;
&lt;h3 id=&quot;operational-takeaways&quot;&gt;Operational Takeaways&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Early career:&lt;/strong&gt; The 20% drop is real. It is concentrated in pure-execution roles. The antidote: understand systems, not syntax. Judgment over keystrokes. Learn to deploy and evaluate AI, not just use it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Mid-career tech:&lt;/strong&gt; Your domain knowledge is the moat. AI handles implementation. You handle architecture, business translation, and institutional context. That is not automatable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Security:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/ai-index-ecrime.png&quot; alt=&quot;29 minute average eCrime breakout time. 89% YoY increase in AI-enabled attacks. 93% cybersecurity problems resolved by defensive AI agents.&quot;&gt;&lt;/p&gt;
&lt;p&gt;AI agents solving 93% of cybersecurity problems means the defensive side is automating. So is the offensive side. CrowdStrike’s 2026 threat report shows 89% year-over-year increase in AI-enabled attacks. Average eCrime breakout time: 29 minutes. Both sides of this arms race are accelerating.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Infrastructure:&lt;/strong&gt; 29.6 GW and climbing. Water, power, cooling, supply chain resilience. The bottleneck is physical, not digital. Datacenter architecture, power engineering, network operations, cooling systems. If you have those skills, your value just went up.&lt;/p&gt;
&lt;p&gt;The AI Index does not tell you what to think. It tells you what is happening. Act accordingly.&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&quot;sources&quot;&gt;Sources&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://hai.stanford.edu/news/inside-the-ai-index-12-takeaways-from-the-2026-report&quot;&gt;Inside the AI Index: 12 Takeaways from the 2026 Report (Stanford HAI)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.technologyreview.com/2026/04/13/1135675/want-to-understand-the-current-state-of-ai-check-out-these-charts/&quot;&gt;Want to understand the current state of AI? Check out these charts (MIT Technology Review)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://spectrum.ieee.org/state-of-ai-index-2026&quot;&gt;Stanford’s AI Index for 2026 Shows the State of AI (IEEE Spectrum)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.weforum.org/stories/2026/04/ai-investments-7-trillion-buildout-right/&quot;&gt;Here’s how to get the $7 trillion AI hardware buildout right (World Economic Forum)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://hai.stanford.edu/ai-index/2026-ai-index-report&quot;&gt;2026 AI Index Report (Stanford HAI)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/stanford-ai-index-2026-header.png" length="0" type="image/png"/></item><item><title>10 Tools. One Brain. The Stack That Actually Builds Things.</title><link>https://bytesnation.com/blog/ten-tools-one-brain/</link><guid isPermaLink="true">https://bytesnation.com/blog/ten-tools-one-brain/</guid><description>These are not ten separate things to learn. They are ten modules in one brain. Claude Code is the nervous system. Everything else is an organ. You start with Obsidian. The rest reveals itself.</description><pubDate>Mon, 13 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;10-tools-one-brain-the-stack-that-actually-builds-things&quot;&gt;10 Tools. One Brain. The Stack That Actually Builds Things.&lt;/h2&gt;
&lt;p&gt;You have forty tabs open. Three AI chats going. A notes app you stopped trusting two weeks ago. A folder called “research” that is actually a graveyard. You ask an AI a question, get an answer, close the tab. Tomorrow you ask the same question because nothing persisted. Nothing connected. Nothing compounded.&lt;/p&gt;
&lt;p&gt;That is not a workflow. That is a fancy search engine with amnesia.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/40Tabs3Chats.png&quot; alt=&quot;40 tabs open, 3 chats going, a graveyard of a notes app&quot;&gt;&lt;/p&gt;
&lt;p&gt;The people actually shipping things are not smarter than you. They are not using secret tools. They wired their tools together. Their AI does not answer questions and vanish. It reads context, calls other tools, writes outputs that feed the next step, and remembers what happened yesterday.&lt;/p&gt;
&lt;p&gt;AI is not the destination. It is the nervous system. The tools are the organs. And the whole thing is useless until it is connected.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/TheConnectedBrain.png&quot; alt=&quot;The Connected Brain: a blueprint for AI workflows that actually compound&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;the-foundation&quot;&gt;The Foundation&lt;/h3&gt;
&lt;p&gt;Before any of this matters, you need a place where what you learn stops disappearing.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md&quot;&gt;Obsidian&lt;/a&gt; is that place. Not because it is the best note-taking app. Because it is plain markdown files on your machine. Nothing proprietary. No subscription required to access your own thoughts. No company between you and your data.&lt;/p&gt;
&lt;p&gt;Your vault is your external memory. Every note, every research output, every AI conversation worth keeping lives there. You organize it your way. You search it your way. It is yours.&lt;/p&gt;
&lt;p&gt;But here is where it gets real. Obsidian has a &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-mcp-protocol&quot;&gt;Model Context Protocol&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-mcp-protocol&quot;&gt;An open standard for connecting AI assistants to external data sources and tools, enabling them to access real-time information and take actions. &lt;a href=&quot;https://bytesnation.com/dictionary/mcp-protocol/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; server. That means your AI can read your vault, search it, and write to it directly. The moment you connect that, Obsidian stops being a notes app and becomes a living knowledge base. Your AI has memory that persists between sessions, grounded in your actual work, not some cloud-hosted summary it generated about itself.&lt;/p&gt;
&lt;p&gt;Start here. Everything else plugs into this.&lt;/p&gt;
&lt;h3 id=&quot;the-nervous-system&quot;&gt;The Nervous System&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://claude.ai/code&quot;&gt;Claude Code&lt;/a&gt; is the orchestration layer. It does not answer questions and wait for the next one. It reads your vault through MCP. It calls external tools as servers. It writes code, executes it, handles errors, and chains outputs across the entire stack.&lt;/p&gt;
&lt;p&gt;Think of it as the central nervous system. Obsidian is the memory. The tools below are the limbs. Claude Code is the thing that coordinates all of them, decides what to call, when, and what to do with the result.&lt;/p&gt;
&lt;p&gt;Nothing else in this list runs without it. Every tool below connects to Claude Code as an MCP server or gets called directly from the terminal. One orchestrator. Ten capabilities. One brain.&lt;/p&gt;
&lt;h3 id=&quot;the-stack&quot;&gt;The Stack&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/TenItems.png&quot; alt=&quot;Ten capabilities, one brain: the full tool grid&quot;&gt;&lt;/p&gt;
&lt;p&gt;You do not need to learn these in order. You do not need all of them. Each one exists because a specific friction point demanded a solution.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The web is your richest data source, and copy-pasting is killing you.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You need clean, structured content from websites, and you need it fast. &lt;a href=&quot;https://github.com/mendableai/firecrawl&quot;&gt;Firecrawl&lt;/a&gt; turns entire sites into &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-llm&quot;&gt;LLM&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-llm&quot;&gt;A neural network trained on massive text datasets that can understand and generate human language, powering tools like ChatGPT and Claude. &lt;a href=&quot;https://bytesnation.com/dictionary/llm/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;-ready markdown in one &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-api&quot;&gt;API&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-api&quot;&gt;A set of rules and protocols that allows different software applications to communicate with each other and share data or functionality. &lt;a href=&quot;https://bytesnation.com/dictionary/api/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; call. JavaScript-heavy pages, dynamic content, nested links. It handles all of it and returns clean structured output your agent can actually use. It runs as an MCP server directly inside Claude Code. Point it at a URL. Get back usable data. No scraping scripts, no BeautifulSoup, no regex nightmares.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Then you hit a login wall.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Firecrawl handles public pages. But the moment authentication is required, a form needs filling, or you need to interact with a live application, you need a browser that can act. &lt;a href=&quot;https://github.com/microsoft/playwright&quot;&gt;Playwright&lt;/a&gt; is Microsoft’s browser automation library. It drives real browser sessions: clicking, typing, navigating, waiting for elements. When Firecrawl cannot reach something because it is behind a login, Playwright walks through the door.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You collected everything. Now it is a mess of PDFs, charts, tables, and diagrams.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Standard retrieval pipelines choke on anything that is not clean text. Charts get ignored. Tables get mangled. Diagrams disappear. &lt;a href=&quot;https://github.com/HKUDS/RAG-Anything&quot;&gt;RAG-Anything&lt;/a&gt; from HKUDS processes text, images, tables, and equations together in one pipeline. Your AI understands the whole document, not the 60% of it that happened to be paragraphs.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You need to write code, scaffold projects, and stop babysitting the terminal.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/openai/codex&quot;&gt;Codex CLI&lt;/a&gt; from OpenAI runs locally on your machine. Built in Rust. Reads and modifies files in your working directory. It is not a chatbot that generates snippets you paste somewhere. It is an agent that operates on your actual codebase. Pair it alongside Claude Code when you want two agents running in parallel on different parts of a project. One writes the backend. The other writes the tests. You review.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You want research loops that run overnight without you.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You describe what good looks like. The metrics, the evaluation criteria, the goal. &lt;a href=&quot;https://github.com/karpathy/autoresearch&quot;&gt;Autoresearch&lt;/a&gt; from Karpathy runs propose-train-evaluate cycles, keeping only changes that improve the target metric, and loops without human intervention. You go to sleep. It keeps working. You wake up to results, not prompts asking what to do next.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You have raw research dumps and zero desire to read every word.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You spent the day collecting. Now there are twenty documents in your vault you need to absorb. &lt;a href=&quot;https://notebooklm.google.com&quot;&gt;NotebookLM&lt;/a&gt; from Google takes your Obsidian outputs and generates briefings, summaries, and audio overviews. The Audio Overview feature turns a stack of research into a listenable briefing you can absorb on a walk, on a drive, wherever you are not staring at a screen.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Your AI generates code that looks like a programmer made it, not a designer.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Every AI-generated UI looks the same. Generic spacing. Default everything. No personality. &lt;a href=&quot;https://github.com/VoltAgent/awesome-design-md&quot;&gt;awesome-design-md&lt;/a&gt; is a plain-text DESIGN.md file that AI agents read to generate consistent, branded interfaces. No Figma exports, no &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-json&quot;&gt;JSON&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-json&quot;&gt;A lightweight, human-readable data format used to exchange structured information between systems, based on JavaScript object syntax. &lt;a href=&quot;https://bytesnation.com/dictionary/json/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; schemas, no special tooling. Drop it in your project root. Claude Code reads it and builds to your design spec, not its own defaults.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Your outputs are stuck in a local folder nobody sees.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The pipeline produces results. Reports sit in a directory. Summaries live in your vault. Nobody else can see them. &lt;a href=&quot;https://github.com/googleworkspace/cli&quot;&gt;Google Workspace CLI&lt;/a&gt; pushes reports to Drive, sends summaries via Gmail, populates spreadsheets. It closes the last mile between “done” and “delivered.”&lt;/p&gt;
&lt;h3 id=&quot;the-full-loop&quot;&gt;The Full Loop&lt;/h3&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/TheFullLoop.png&quot; alt=&quot;The full loop: competitive intel in one prompt, from single prompt to delivery&quot;&gt;&lt;/p&gt;
&lt;p&gt;Here is what this looks like when it is all wired together.&lt;/p&gt;
&lt;p&gt;You are running competitive intelligence on three companies entering your market. One prompt to Claude Code: “Research these three companies. Build a comparison report. Drop it in the vault.”&lt;/p&gt;
&lt;p&gt;Claude Code calls Firecrawl to ingest the companies’ public web presence. One of them has pricing behind a login wall. Playwright opens a browser session, authenticates, and pulls the gated content. Everything lands in your vault as clean markdown.&lt;/p&gt;
&lt;p&gt;The sources include investor decks with charts and a product comparison table buried in a PDF. &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-rag&quot;&gt;RAG&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-rag&quot;&gt;A technique that improves AI responses by retrieving relevant information from your own documents and feeding it to the model alongside the question. &lt;a href=&quot;https://bytesnation.com/dictionary/rag/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;-Anything indexes all of it, charts, tables, and text, into a retrieval layer that actually understands the full picture.&lt;/p&gt;
&lt;p&gt;Claude Code synthesizes the findings. It reads the existing notes in your vault for context on your own positioning. It writes a structured competitive analysis and drops it into Obsidian with proper tags and backlinks.&lt;/p&gt;
&lt;p&gt;You feed that report to NotebookLM. It generates an audio briefing you listen to on your morning walk. While you walk, Codex CLI is scaffolding a dashboard to track these competitors over time. Autoresearch is running overnight loops to refine the retrieval pipeline itself, optimizing the system that produced today’s report for tomorrow’s run.&lt;/p&gt;
&lt;p&gt;The final report hits Google Drive via GWS CLI. A summary lands in your inbox. Your team has it before you finish your coffee.&lt;/p&gt;
&lt;p&gt;One brain. Ten organs. One prompt started it.&lt;/p&gt;
&lt;h3 id=&quot;start-somewhere&quot;&gt;Start Somewhere&lt;/h3&gt;
&lt;p&gt;Nobody needs all ten of these on day one. That is the trap. You see a stack like this and think you need to learn everything before you can build anything.&lt;/p&gt;
&lt;p&gt;Wrong.&lt;/p&gt;
&lt;p&gt;You start with Obsidian. You build one habit: capture what you learn in markdown. That is it. You do that for a week.&lt;/p&gt;
&lt;p&gt;Then you notice the friction. Maybe it is manual web research. So you add Firecrawl. Maybe it is losing AI conversations. So you wire up Claude Code to your vault. Maybe it is drowning in documents. So you point NotebookLM at your output folder.&lt;/p&gt;
&lt;p&gt;The stack reveals itself as you grow into it. Each tool earns its place by solving a problem you actually have, not a problem someone told you to worry about.&lt;/p&gt;
&lt;p&gt;The goal was never ten tools. The goal was to stop being passive. Stop consuming and start building. Stop asking AI one-off questions and start wiring it into a system that compounds.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/StopConsumingStartCompounding.png&quot; alt=&quot;Stop consuming. Start compounding. Start somewhere. The rest follows.&quot;&gt;&lt;/p&gt;
&lt;p&gt;Start somewhere. The rest follows.&lt;/p&gt;
&lt;p&gt;Stay wired.&lt;/p&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/TheConnectedBrain.png" length="0" type="image/png"/></item><item><title>Your Homelab Has a Brain Now. Here Is How to Wire It.</title><link>https://bytesnation.com/blog/homelab-brain-mcp/</link><guid isPermaLink="true">https://bytesnation.com/blog/homelab-brain-mcp/</guid><description>Your AI forgets everything between sessions. MCP fixes that. Here is how to wire Claude into your Obsidian vault, running on your own Proxmox hardware, with n8n handling the automation.</description><pubDate>Sun, 12 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;your-homelab-has-a-brain-now-here-is-how-to-wire-it&quot;&gt;Your Homelab Has a Brain Now. Here Is How to Wire It.&lt;/h2&gt;
&lt;p&gt;Every conversation with your AI starts from zero. You paste context. You re-explain your project. You copy notes in like it is 2023 and you are feeding a search bar. Meanwhile, you have a vault full of notes, a lab full of hardware, and an automation stack collecting dust. There is a better way.&lt;/p&gt;
&lt;p&gt;What if Claude could read your entire Obsidian vault? Search it. Write to it. And your automation layer could trigger workflows based on what it finds. All on your hardware. Zero subscriptions.&lt;/p&gt;
&lt;p&gt;That is what we are building.&lt;/p&gt;
&lt;h3 id=&quot;the-stack&quot;&gt;The Stack&lt;/h3&gt;
&lt;p&gt;Four layers. Each one does one thing.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Proxmox&lt;/strong&gt;: the infrastructure. Runs everything on your hardware.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;n8n&lt;/strong&gt;: the automation. Lives in an LXC &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-container&quot;&gt;container&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-container&quot;&gt;A lightweight, portable package that bundles an application with its dependencies and runs in an isolated process on the host OS, sharing the kernel. &lt;a href=&quot;https://bytesnation.com/dictionary/container/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; on Proxmox. Handles triggers, webhooks, workflows.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Obsidian &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-mcp-protocol&quot;&gt;MCP&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-mcp-protocol&quot;&gt;An open standard for connecting AI assistants to external data sources and tools, enabling them to access real-time information and take actions. &lt;a href=&quot;https://bytesnation.com/dictionary/mcp-protocol/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; Server&lt;/strong&gt;: the knowledge layer. Exposes your vault to Claude over the Model Context Protocol.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Claude via MCP&lt;/strong&gt;: the intelligence. Connects to your vault, reads your notes, acts on what it finds.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;mermaid&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;graph TD&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    A[&quot;Claude (MCP Host)&quot;] --&gt;|&quot;JSON-RPC 2.0&quot;| B[&quot;MCP Client&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    B --&gt;|&quot;STDIO&quot;| C[&quot;Obsidian MCP Server&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    C --&gt;|&quot;REST API&quot;| D[&quot;Obsidian Vault&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    E[&quot;n8n (LXC)&quot;] --&gt;|&quot;Proxmox API&quot;| F[&quot;Proxmox VE&quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    E --&gt;|&quot;Webhooks / Triggers&quot;| C&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    E --&gt;|&quot;API Calls&quot;| A&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The result: an AI that knows everything you have ever written, running on your own iron, talking to your automation stack, costing you nothing per month.&lt;/p&gt;
&lt;h3 id=&quot;how-it-actually-works&quot;&gt;How It Actually Works&lt;/h3&gt;
&lt;p&gt;MCP stands for Model Context Protocol. It is an open standard that lets AI applications connect to external data sources through a clean client-server architecture. Think of it like a USB &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-port&quot;&gt;port&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-port&quot;&gt;A numbered endpoint on a device that identifies a specific application or service, allowing multiple network services to run on the same IP address. &lt;a href=&quot;https://bytesnation.com/dictionary/port/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; for AI. The AI does not need to know how your data is stored. It just needs a server that speaks the protocol.&lt;/p&gt;
&lt;p&gt;The architecture has four participants. The &lt;strong&gt;Host&lt;/strong&gt; is the AI application (Claude Desktop or Claude Code). Inside the host lives the &lt;strong&gt;Client&lt;/strong&gt;, which manages the actual connection. The &lt;strong&gt;Server&lt;/strong&gt; is the program that exposes your data (in this case, your Obsidian vault via the Local &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-rest-api&quot;&gt;REST&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-rest-api&quot;&gt;An architectural style for web APIs that uses standard HTTP methods to create, read, update, and delete resources identified by URLs. &lt;a href=&quot;https://bytesnation.com/dictionary/rest-api/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-api&quot;&gt;API&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-api&quot;&gt;A set of rules and protocols that allows different software applications to communicate with each other and share data or functionality. &lt;a href=&quot;https://bytesnation.com/dictionary/api/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; plugin). Communication between client and server happens over &lt;strong&gt;STDIO&lt;/strong&gt; (standard input/output) for local setups, using &lt;strong&gt;&lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-json&quot;&gt;JSON&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-json&quot;&gt;A lightweight, human-readable data format used to exchange structured information between systems, based on JavaScript object syntax. &lt;a href=&quot;https://bytesnation.com/dictionary/json/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;-RPC 2.0&lt;/strong&gt; messages. The host decides what Claude can access. The server just makes things available.&lt;/p&gt;
&lt;p&gt;Here is the real config. This goes in your Claude Desktop config file:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Mac:&lt;/strong&gt; &lt;code&gt;~/Library/Application Support/Claude/claude_desktop_config.json&lt;/code&gt;
&lt;strong&gt;Windows:&lt;/strong&gt; &lt;code&gt;%APPDATA%/Claude/claude_desktop_config.json&lt;/code&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;mcpServers&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;mcp-obsidian&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;uvx&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      &quot;args&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;mcp-obsidian&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      &quot;env&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;OBSIDIAN_API_KEY&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&amp;#x3C;your_api_key_here&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;OBSIDIAN_HOST&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;localhost&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;OBSIDIAN_PORT&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;27124&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;command&lt;/code&gt;&lt;/strong&gt; tells Claude how to launch the server. &lt;code&gt;uvx&lt;/code&gt; runs it directly from PyPI without installing globally. &lt;strong&gt;&lt;code&gt;args&lt;/code&gt;&lt;/strong&gt; is the package name. &lt;strong&gt;&lt;code&gt;env&lt;/code&gt;&lt;/strong&gt; passes your Obsidian Local REST API credentials. The API key comes from the plugin settings inside Obsidian. Port &lt;code&gt;27124&lt;/code&gt; is the default.&lt;/p&gt;
&lt;p&gt;When Claude needs a note, here is what actually happens:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;mermaid&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;sequenceDiagram&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    participant C as Claude&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    participant MC as MCP Client&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    participant MS as MCP Server&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    participant V as Vault&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    C-&gt;&gt;MC: 1. tools/call&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    MC-&gt;&gt;MS: 2. JSON-RPC request (stdin)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    MS-&gt;&gt;V: 3. GET /vault/note (REST API)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    V--&gt;&gt;MS: 4. Note content&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    MS--&gt;&gt;MC: 5. JSON-RPC response (stdout)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    MC--&gt;&gt;C: 6. Tool result&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Claude issues a &lt;code&gt;tools/call&lt;/code&gt; request. The MCP client serializes it as a JSON-RPC 2.0 message and writes it to the server’s stdin. The server hits the Obsidian REST API, gets the note content, and writes the response back to stdout. Claude now has your note. The whole round trip happens locally. No cloud. No &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-latency&quot;&gt;latency&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-latency&quot;&gt;The time delay between sending a request and receiving the first byte of the response, typically measured in milliseconds. &lt;a href=&quot;https://bytesnation.com/dictionary/latency/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; worth measuring.&lt;/p&gt;
&lt;h3 id=&quot;why-your-homelab-is-the-right-place-for-this&quot;&gt;Why Your Homelab Is the Right Place for This&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;You own the data.&lt;/strong&gt; Your notes never leave your network. No cloud sync shipping your vault to someone else’s servers. No training data contribution you did not consent to. Your knowledge stays on your hardware, behind your &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-firewall&quot;&gt;firewall&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-firewall&quot;&gt;A security device or software that monitors and controls incoming and outgoing network traffic based on predefined rules. &lt;a href=&quot;https://bytesnation.com/dictionary/firewall/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;. Full stop.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Zero subscription cost.&lt;/strong&gt; Proxmox is free. Self-hosted n8n is free. Obsidian is free. The MCP server is open source. The only thing you are paying for is the Claude subscription you already have (or API credits if you are running headless). Compare that to cobbling together three SaaS tools at $20/month each to get half the capability.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The lab becomes intelligent.&lt;/strong&gt; This is the part most people miss. Once n8n can talk to Claude and Claude can talk to your vault, you are not just searching notes anymore. You are building workflows that reason over your knowledge base. n8n triggers a workflow, Claude reads your vault for context, makes a decision, writes the result back. That is a different category of automation than “if this then that.”&lt;/p&gt;
&lt;h3 id=&quot;what-you-can-build-with-this&quot;&gt;What You Can Build With This&lt;/h3&gt;
&lt;p&gt;Stop thinking about this as a note-reading trick. Think about what becomes possible when your AI has memory and your automation stack has intelligence.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Morning briefing from your daily notes.&lt;/strong&gt; n8n fires at 6 AM, tells Claude to read yesterday’s daily note and your task board, generates a prioritized summary of what carried over and what is due. Written back to today’s note before you pour coffee.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Auto-tagging based on vault context.&lt;/strong&gt; New note lands in your inbox. Claude reads it, compares it against your existing tag taxonomy and MOC structure, applies tags and links it to related notes. Your vault organizes itself.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Proxmox alerts summarized and logged.&lt;/strong&gt; n8n watches your Proxmox API for resource alerts. When a container spikes CPU or a disk fills up, Claude gets the alert, pulls recent related notes from your infra log, writes a contextualized incident note with recommended actions.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Research pipelines triggered by &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-webhook&quot;&gt;webhook&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-webhook&quot;&gt;An HTTP callback that automatically sends data to a URL when a specific event occurs, enabling real-time communication between applications. &lt;a href=&quot;https://bytesnation.com/dictionary/webhook/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/strong&gt; You find an article worth reading. Hit a webhook from your phone. n8n sends the URL to Claude, which reads it, extracts key points, cross-references your vault for related notes, and writes a literature note with backlinks already in place.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Weekly review automation.&lt;/strong&gt; Every Sunday, Claude scans your completed tasks, meeting notes, and daily logs for the week. Generates a review draft: what shipped, what slipped, what patterns are emerging. You edit and publish. Ten minutes instead of an hour.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The pattern is the same every time: trigger, context from vault, intelligence from Claude, output back to vault or another system. Once you see it, you cannot unsee it.&lt;/p&gt;
&lt;h3 id=&quot;where-to-start&quot;&gt;Where to Start&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Step 1: Get Proxmox running.&lt;/strong&gt; If you do not have a hypervisor yet, install &lt;a href=&quot;https://www.proxmox.com/en/proxmox-virtual-environment/overview&quot;&gt;Proxmox VE&lt;/a&gt; on any spare hardware. Old desktop, mini PC, rack server. It does not matter. Proxmox is free and it is what the rest of the stack runs on.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Deploy n8n in an LXC container.&lt;/strong&gt; Spin up a lightweight Debian LXC on Proxmox and install n8n. It runs on Node.js, pulls minimal resources, and gives you a visual workflow builder with access to the Proxmox API, webhooks, schedules, and hundreds of integrations.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 3: Wire up the MCP server.&lt;/strong&gt; Install the &lt;a href=&quot;https://github.com/coddingtonbear/obsidian-local-rest-api&quot;&gt;Obsidian Local REST API&lt;/a&gt; community plugin in your vault. Enable it, copy the API key. Add the config block above to your Claude Desktop config. Restart Claude. Ask it to search your vault. Watch it work.&lt;/p&gt;
&lt;p&gt;That is the path. Three steps to a homelab that thinks.&lt;/p&gt;
&lt;h3 id=&quot;the-close&quot;&gt;The Close&lt;/h3&gt;
&lt;p&gt;Your notes are not just files. Your lab is not just hardware. And your AI should not be starting from scratch every time you open a chat window.&lt;/p&gt;
&lt;p&gt;Wire these pieces together and you have something most people do not even know is possible yet: a personal AI that knows your entire knowledge base, runs on your own infrastructure, and costs you nothing beyond what you are already paying. No vendor lock-in. No data leaving your network. Just your brain, extended.&lt;/p&gt;
&lt;p&gt;Next post: the full n8n + Claude + Proxmox automation deep dive. We are going to build the actual workflows. The morning briefing. The auto-tagger. The whole damn thing.&lt;/p&gt;
&lt;p&gt;Stay wired.&lt;/p&gt;
&lt;h4 id=&quot;sources&quot;&gt;Sources&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://modelcontextprotocol.io&quot;&gt;Model Context Protocol Specification&lt;/a&gt; (official docs)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://pypi.org/project/mcp-obsidian/&quot;&gt;mcp-obsidian&lt;/a&gt; (PyPI)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/coddingtonbear/obsidian-local-rest-api&quot;&gt;Obsidian Local REST API Plugin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.proxmox.com/en/proxmox-virtual-environment/overview&quot;&gt;Proxmox VE&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://n8n.io&quot;&gt;n8n&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/homelab-brain-mcp-header.png" length="0" type="image/png"/></item><item><title>Prompt Engineering Is Not Magic. It Is Instruction Writing.</title><link>https://bytesnation.com/blog/prompt-engineering-field-manual/</link><guid isPermaLink="true">https://bytesnation.com/blog/prompt-engineering-field-manual/</guid><description>You learned how tokens and context windows work. Now learn how to exploit them. Prompt engineering is not a mystical art. It is structured communication with a machine that follows instructions literally. Here is the field manual, sourced from Anthropic, OpenAI, and Google.</description><pubDate>Sat, 11 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;you-know-how-the-engine-works-now-learn-to-drive&quot;&gt;You Know How the Engine Works. Now Learn to Drive.&lt;/h2&gt;
&lt;div style=&quot;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; border-radius: 12px; margin-bottom: 2rem;&quot;&gt;
  &lt;iframe src=&quot;https://www.youtube.com/embed/xQ0LCID2u4w&quot; title=&quot;Prompt Engineering Field Manual - BytesNation&quot; style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen loading=&quot;lazy&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;a href=&quot;https://bytesnation.com/blog/how-ai-actually-works&quot;&gt;last post&lt;/a&gt; broke down tokens, context windows, attention, and sampling. You know the internals. That knowledge is useless if you keep writing prompts like you are texting a friend.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-prompt-engineering&quot;&gt;Prompt engineering&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-prompt-engineering&quot;&gt;The practice of designing and refining inputs to AI language models to get more accurate, useful, and consistent outputs. &lt;a href=&quot;https://bytesnation.com/dictionary/prompt-engineering/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; is not a creative skill. It is not vibes. It is instruction writing. The same discipline that goes into a military operations order, a network configuration template, or an &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-api&quot;&gt;API&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-api&quot;&gt;A set of rules and protocols that allows different software applications to communicate with each other and share data or functionality. &lt;a href=&quot;https://bytesnation.com/dictionary/api/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; specification. Precise. Structured. Unambiguous.&lt;/p&gt;
&lt;p&gt;The model does exactly what you tell it to do. When the output is garbage, the input was garbage. Full stop.&lt;/p&gt;
&lt;p&gt;Everything in this post is sourced from the official documentation of the three major AI platforms: &lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Anthropic’s Claude prompting best practices&lt;/a&gt;, &lt;a href=&quot;https://cookbook.openai.com/examples/gpt-5/gpt-5_prompting_guide&quot;&gt;OpenAI’s GPT-5 prompting guide&lt;/a&gt;, and &lt;a href=&quot;https://ai.google.dev/gemini-api/docs/prompting-strategies&quot;&gt;Google’s Gemini prompt design strategies&lt;/a&gt;. Not blog opinions. Not Twitter threads. Primary sources from the people who built the models.&lt;/p&gt;
&lt;h3 id=&quot;the-five-principles&quot;&gt;The Five Principles&lt;/h3&gt;
&lt;p&gt;Before the techniques. Before the examples. Internalize these.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Be explicit.&lt;/strong&gt; The model cannot read your mind. If you did not say it, it does not exist.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Be structured.&lt;/strong&gt; Prose instructions produce prose-quality compliance. Structured inputs produce structured outputs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Be specific about format.&lt;/strong&gt; Tell it what the output looks like. &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-json&quot;&gt;JSON&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-json&quot;&gt;A lightweight, human-readable data format used to exchange structured information between systems, based on JavaScript object syntax. &lt;a href=&quot;https://bytesnation.com/dictionary/json/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, bullet points, a table, a single word. If you leave format open, you get whatever the training data averaged out to.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Constrain the scope.&lt;/strong&gt; Every degree of freedom you leave open is a degree of freedom the model fills with its best guess. Best guesses are not good enough.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Provide examples.&lt;/strong&gt; One concrete example communicates more than five paragraphs of description.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;These principles are universal. Anthropic’s documentation puts it this way: “Think of Claude as a brilliant but new employee who lacks context on your norms and workflows. The more precisely you explain what you want, the better the result.” (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Google’s Gemini 3 guide says the same thing differently: “State your goal clearly and concisely. Avoid unnecessary or overly persuasive language.” (&lt;a href=&quot;https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/gemini-3-prompting-guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;OpenAI’s GPT-5 guide warns that contradictory instructions force the model to waste reasoning tokens reconciling conflicts instead of solving your actual problem. (&lt;a href=&quot;https://cookbook.openai.com/examples/gpt-5/gpt-5_prompting_guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Same conclusion from three independent engineering teams. Clarity wins.&lt;/p&gt;
&lt;h3 id=&quot;technique-1-role-and-context-assignment&quot;&gt;Technique 1: Role and Context Assignment&lt;/h3&gt;
&lt;p&gt;Tell the model who it is before you tell it what to do. This is not roleplay. It is context loading. A role activates relevant patterns from training data and suppresses irrelevant ones.&lt;/p&gt;
&lt;p&gt;Anthropic’s documentation confirms this: “Setting a role in the system prompt focuses Claude’s behavior and tone for your use case. Even a single sentence makes a difference.” (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Google’s Gemini 3 guide adds a critical caveat: assign personas explicitly, but review them carefully because the model “prioritizes maintaining persona adherence even over other instructions.” (&lt;a href=&quot;https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/gemini-3-prompting-guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Weak prompt:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;What ports should I open on my firewall?&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You will get a generic list. Every default &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-port&quot;&gt;port&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-port&quot;&gt;A numbered endpoint on a device that identifies a specific application or service, allowing multiple network services to run on the same IP address. &lt;a href=&quot;https://bytesnation.com/dictionary/port/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; for every common service. Useless.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Strong prompt:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;You are a senior network security engineer conducting a firewall&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;audit for a PCI-DSS compliant e-commerce environment running&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Kubernetes on AWS. The environment serves HTTPS traffic through&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;an ALB, uses RDS PostgreSQL for the backend database, and runs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Redis for session caching.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;List only the ports that must be open on the VPC security groups,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;grouped by tier (public, application, data). For each port,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;specify the protocol, source CIDR restriction, and justification.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Flag any port that introduces PCI-DSS compliance risk.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Same question. Completely different output. The role and context eliminated 90% of the noise before the model generated a single &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-token&quot;&gt;token&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-token&quot;&gt;The smallest unit of text that a language model processes, typically a word, part of a word, or a punctuation mark. &lt;a href=&quot;https://bytesnation.com/dictionary/token/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why it works:&lt;/strong&gt; Remember attention from the last post. The model weighs every token against every other token. When you load the context with “PCI-DSS,” “&lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-kubernetes&quot;&gt;Kubernetes&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-kubernetes&quot;&gt;An open-source platform for automating the deployment, scaling, and management of containerized applications across clusters of machines. &lt;a href=&quot;https://bytesnation.com/dictionary/kubernetes/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;,” and “AWS,” the attention mechanism amplifies patterns associated with those domains. Without that context, it distributes attention across everything it knows about firewalls, including home routers and gaming setups.&lt;/p&gt;
&lt;p&gt;Anthropic also recommends providing the motivation behind your instructions. Instead of saying “NEVER use ellipses,” explain: “Your response will be read aloud by a text-to-speech engine, so never use ellipses since the text-to-speech engine will not know how to pronounce them.” Claude generalizes from the explanation. (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;h3 id=&quot;technique-2-few-shot-examples&quot;&gt;Technique 2: Few-Shot Examples&lt;/h3&gt;
&lt;p&gt;The model learns patterns from examples faster than it learns from descriptions. This is called few-shot prompting. You provide input/output pairs, and the model extrapolates the pattern.&lt;/p&gt;
&lt;p&gt;Anthropic recommends 3 to 5 examples for best results and advises wrapping them in &lt;code&gt;&amp;#x3C;example&gt;&lt;/code&gt; tags so the model can distinguish examples from instructions. (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Google’s Gemini documentation recommends 2 to 5 varied examples and warns against providing too many, which can cause overfitting where the model mimics examples too literally instead of generalizing the pattern. (&lt;a href=&quot;https://ai.google.dev/gemini-api/docs/prompting-strategies&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Task:&lt;/strong&gt; Extract structured data from unstructured network alerts.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prompt:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Extract structured incident data from network alerts.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;example&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Input:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&quot;Critical alert: Unauthorized SSH login attempt detected on&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;10.0.3.47 from external IP 203.0.113.42 at 14:32 UTC.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;5 failed attempts in 60 seconds. Account: root.&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Output:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;severity&quot;: &quot;critical&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;event_type&quot;: &quot;brute_force_attempt&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;target_host&quot;: &quot;10.0.3.47&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;source_ip&quot;: &quot;203.0.113.42&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;protocol&quot;: &quot;SSH&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;timestamp&quot;: &quot;14:32 UTC&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;attempt_count&quot;: 5,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;window_seconds&quot;: 60,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;target_account&quot;: &quot;root&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;recommended_action&quot;: &quot;Block source IP, force password&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    reset on target account, review auth logs for lateral&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    movement&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&amp;#x3C;/example&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Now extract from this alert:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&quot;Warning: DNS exfiltration pattern detected. Host 10.0.1.15&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;made 847 TXT record queries to suspicious domain&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;x4k9.badactor.net over 300 seconds starting at 09:17 UTC.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Average query length exceeds normal baseline by 340%.&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;One example. The model now knows the exact schema, the field names, the value formats, and that you want a &lt;code&gt;recommended_action&lt;/code&gt; field with operational guidance. One example replaced an entire specification document.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The rule:&lt;/strong&gt; One strong example beats three paragraphs of description. Two examples nail edge cases. Three to five is the sweet spot for consistent patterns. Beyond that, you are wasting tokens and risking overfitting.&lt;/p&gt;
&lt;h3 id=&quot;technique-3-structured-formatting-with-tags&quot;&gt;Technique 3: Structured Formatting with Tags&lt;/h3&gt;
&lt;p&gt;All three major platforms agree on this: structure your prompts with clear delimiters. The specific format varies, but the principle is universal.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Anthropic&lt;/strong&gt; recommends XML tags and has specifically trained Claude to parse them. Tags like &lt;code&gt;&amp;#x3C;instructions&gt;&lt;/code&gt;, &lt;code&gt;&amp;#x3C;context&gt;&lt;/code&gt;, and &lt;code&gt;&amp;#x3C;examples&gt;&lt;/code&gt; reduce misinterpretation. (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;OpenAI&lt;/strong&gt; recommends &lt;code&gt;&amp;#x3C;instruction_spec&gt;&lt;/code&gt; tags for organizing complex requirements, allowing clear internal referencing across prompt sections. (&lt;a href=&quot;https://cookbook.openai.com/examples/gpt-5/gpt-5_prompting_guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Google&lt;/strong&gt; recommends XML-style tags or Markdown headings, advising you to choose one format and use it consistently within a single prompt. (&lt;a href=&quot;https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/gemini-3-prompting-guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example: Multi-section prompt with XML structure&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;role&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;You are a senior infrastructure engineer reviewing Kubernetes&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;deployment manifests for production readiness. You follow the&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;CIS Kubernetes Benchmark v1.8.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;role&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;standards&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;- All containers must run as non-root (runAsNonRoot: true)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;- Resource limits are mandatory (no unbounded containers)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;- Image tags must be SHA digests, not :latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;- Liveness and readiness probes required on all containers&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;- No hostNetwork, hostPID, or hostIPC unless approved&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;standards&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;output_format&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;For each violation, return a JSON object:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  &quot;field&quot;: &quot;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;YAML&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; path&gt;&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  &quot;violation&quot;: &quot;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;which&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; standard&gt;&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  &quot;severity&quot;: &quot;critical | warning&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  &quot;fix&quot;: &quot;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;exact&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; YAML to replace it with&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;Return a JSON array. No commentary. No markdown fences.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;output_format&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;apiVersion: apps/v1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;kind: Deployment&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;metadata:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  name: api-gateway&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;spec:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  replicas: 3&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  template:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    spec:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      containers:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      - name: gateway&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        image: company/api-gateway:latest&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ports:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        - containerPort: 8080&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;input&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every section has a purpose. The model knows exactly where the role ends and the standards begin. No ambiguity. No guessing.&lt;/p&gt;
&lt;h3 id=&quot;technique-4-chain-of-thought&quot;&gt;Technique 4: Chain of Thought&lt;/h3&gt;
&lt;p&gt;When you need the model to reason through a problem, tell it to show its work. This forces the model to activate its reasoning pathways before committing to an answer.&lt;/p&gt;
&lt;p&gt;Anthropic’s documentation notes that for Claude 4.6, “a prompt like ‘think thoroughly’ often produces better reasoning than a hand-written step-by-step plan. Claude’s reasoning frequently exceeds what a human would prescribe.” They also recommend asking Claude to self-check: “Before you finish, verify your answer against [test criteria].” (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Google’s Gemini 3 guide takes a different approach, recommending split-step verification: first verify that information exists before generating answers. This prevents “plausible-sounding but incorrect outputs.” (&lt;a href=&quot;https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/gemini-3-prompting-guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Without chain of thought:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Is this subnet configuration valid?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;10.0.1.0/24 with gateway 10.0.2.1&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The model might say “yes” or “no” with no way to verify if it actually evaluated the configuration.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;With chain of thought:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Evaluate this subnet configuration step by step.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Show your reasoning for each check before the final verdict.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Configuration:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- Subnet: 10.0.1.0/24&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- Gateway: 10.0.2.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Check:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1. Is the gateway IP within the subnet range?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2. Is the subnet mask valid for the stated network?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3. Are there any RFC violations?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;4. What is the usable host range?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;After all checks, state VALID or INVALID with justification.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1. Subnet range: 10.0.1.0 to 10.0.1.255. Gateway 10.0.2.1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   is NOT within this range. The gateway must reside within&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   the subnet or be reachable via a connected interface.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;2. /24 (255.255.255.0) is valid for 10.0.1.0.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;3. No RFC violations on the subnet itself, but gateway&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   placement violates standard Layer 3 design.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;4. Usable range: 10.0.1.1 to 10.0.1.254 (254 hosts).&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;INVALID. Gateway 10.0.2.1 is outside 10.0.1.0/24.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Correct to 10.0.1.1 or re-architect the routing.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The step-by-step requirement forced the model to evaluate each condition instead of guessing at the aggregate. This is the difference between a tech who checks every cable and one who says “looks fine” from across the room.&lt;/p&gt;
&lt;h3 id=&quot;technique-5-output-constraints&quot;&gt;Technique 5: Output Constraints&lt;/h3&gt;
&lt;p&gt;If you do not define the output format, the model picks one. It will be verbose, inconsistent, and different every time. Lock it down.&lt;/p&gt;
&lt;p&gt;OpenAI’s GPT-5 guide introduces a dual verbosity strategy: set a low verbosity parameter globally while requesting high verbosity only for specific contexts like code output. This keeps status updates concise while maintaining readable code. (&lt;a href=&quot;https://cookbook.openai.com/examples/gpt-5/gpt-5_prompting_guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Google’s Gemini 3 documentation notes that Gemini 3 models default to concise, direct answers. If you need more detail, you must explicitly request it. (&lt;a href=&quot;https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/gemini-3-prompting-guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Anthropic recommends telling Claude what to do instead of what not to do. Instead of “Do not use markdown in your response,” try “Your response should be composed of smoothly flowing prose paragraphs.” (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Unconstrained:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Analyze this log entry for security issues.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You get a three-paragraph essay. Sometimes bullets. Sometimes narrative. Never consistent.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Constrained:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Analyze the log entry below. Respond with ONLY a JSON object.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;No markdown fences. No explanation text.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;log_line&quot;: &quot;&amp;#x3C;original log entry&gt;&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;classification&quot;: &quot;benign | suspicious | malicious&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;confidence&quot;: &amp;#x3C;float 0.0-1.0&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;indicators&quot;: [&quot;&amp;#x3C;specific indicators found&gt;&quot;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;mitre_technique&quot;: &quot;&amp;#x3C;ATT&amp;#x26;CK technique ID or null&gt;&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  &quot;recommended_action&quot;: &quot;&amp;#x3C;one sentence&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Log entry:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;POST /wp-login.php HTTP/1.1 from 198.51.100.23 - 47 requests&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;in 12 seconds - all returned 401 - User-Agent: python-requests/2.28&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Machine-parseable output. Every time. Same schema. Same fields. You can pipe this into a &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-siem&quot;&gt;SIEM&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-siem&quot;&gt;A platform that collects, correlates, and analyzes log data from across your infrastructure to detect security threats and support incident investigation. &lt;a href=&quot;https://bytesnation.com/dictionary/siem/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, a database, or a downstream automation. That is the difference between a tool and a toy.&lt;/p&gt;
&lt;h3 id=&quot;technique-6-context-placement&quot;&gt;Technique 6: Context Placement&lt;/h3&gt;
&lt;p&gt;Where you put information in your prompt matters as much as what you put in it. This is the practical application of the lost-in-the-middle problem covered in the last post.&lt;/p&gt;
&lt;p&gt;Anthropic is explicit: “Put longform data at the top. Place your long documents and inputs near the top of your prompt, above your query, instructions, and examples. Queries at the end can improve response quality by up to 30% in tests, especially with complex, multi-document inputs.” (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Google’s Gemini 3 guide mirrors this: “Place specific questions after large context blocks and anchor reasoning with phrases like ‘Based on the information above.’” It also advises placing critical restrictions at the end of the prompt to prevent the model from dropping them. (&lt;a href=&quot;https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/gemini-3-prompting-guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The placement rule:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[LONG REFERENCE DOCUMENTS / DATA]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[YOUR SPECIFIC QUESTION OR TASK]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[CRITICAL CONSTRAINTS AND FORMAT REQUIREMENTS]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Data first. Task second. Constraints last. The model attends most strongly to the beginning (your reference material) and the end (your constraints). Your task sits in between, anchored by both.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For multi-document prompts&lt;/strong&gt;, Anthropic recommends wrapping each document in indexed tags:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;xml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;documents&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; index&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;firewall_rules_prod.csv&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;document_content&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      ... rule data ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;document_content&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; index&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;incident_report_2026-04.pdf&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    &amp;#x3C;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;document_content&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      ... report content ...&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;document_content&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  &amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;document&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&amp;#x3C;/&lt;/span&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;documents&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;Based on the documents above, identify any firewall rules&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;that would have permitted the attack vector described in&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;the incident report. Output as a table with columns:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;Rule ID, Source, Destination, Port, Risk Assessment.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;technique-7-negative-constraints&quot;&gt;Technique 7: Negative Constraints&lt;/h3&gt;
&lt;p&gt;Telling the model what NOT to do is as important as telling it what to do. Models have strong defaults from training. If those defaults conflict with what you need, override them explicitly.&lt;/p&gt;
&lt;p&gt;Anthropic’s documentation includes a detailed prompt template for suppressing common unwanted behaviors like excessive markdown, bullet points, and bold/italic formatting. (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Google specifically warns against broad negative instructions like “do not infer.” Instead, specify what the model should use for reasoning. (&lt;a href=&quot;https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/gemini-3-prompting-guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Common defaults to suppress:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Do not include introductory text like &quot;Sure!&quot; or&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&quot;Here is the analysis.&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Do not wrap code in markdown fences unless asked.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Do not add disclaimers about limitations.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Do not explain reasoning unless asked. Output the result.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Do not use placeholder values. If data is missing,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;output null.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Real-world example:&lt;/strong&gt; Generating &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-terraform&quot;&gt;Terraform&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-terraform&quot;&gt;An infrastructure-as-code tool that lets you define cloud resources (servers, networks, databases) in configuration files and provision them automatically. &lt;a href=&quot;https://bytesnation.com/dictionary/terraform/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; configurations.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Generate a Terraform resource block for an AWS security group&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;allowing inbound HTTPS (443) from 0.0.0.0/0 and SSH (22)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;from 10.0.0.0/8 only.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Output ONLY the resource block.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- No provider block&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- No variable declarations&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- No comments&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- No egress rules&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- No tags&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- Resource name: &quot;web_server_sg&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Without those constraints, the model produces a complete Terraform file with provider config, variables, outputs, inline comments, and invented tags. All of which you strip out. Save the tokens. Save the time.&lt;/p&gt;
&lt;h3 id=&quot;technique-8-iterative-refinement&quot;&gt;Technique 8: Iterative Refinement&lt;/h3&gt;
&lt;p&gt;One prompt rarely produces a perfect result. Plan for iteration, but do it systematically.&lt;/p&gt;
&lt;p&gt;OpenAI’s GPT-5 guide introduces the concept of metaprompting: ask the model itself “what phrases could be added or deleted from this prompt to elicit desired behavior.” Use the model to improve the prompt that drives it. (&lt;a href=&quot;https://cookbook.openai.com/examples/gpt-5/gpt-5_prompting_guide&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;Google frames prompt engineering explicitly as “a test-driven and iterative process” and recommends rephrasing requests multiple ways, switching to analogous tasks, and reordering prompt content to test impact. (&lt;a href=&quot;https://ai.google.dev/gemini-api/docs/prompting-strategies&quot;&gt;Source&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Round 1: Get the structure right.&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Draft a network diagram description for a three-tier web&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;application on AWS. Output as a structured list, not prose.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Include VPC layout, subnet tiers, and security group&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;boundaries.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Round 2: Add precision.&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Good structure. Now add:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- Specific CIDR blocks (10.0.0.0/16 VPC)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- NAT gateway placement&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- Which tier gets public IPs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;- Cross-AZ redundancy notation&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Round 3: Pressure test.&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Review this architecture for single points of failure.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;For each one, propose a mitigation and rate cost impact&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;as low/medium/high.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Round 4: Use metaprompting.&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Review the prompt I used to generate this architecture.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;What instructions could I add or remove to get a more&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;production-ready result on the first pass?&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Each round builds on the last. You are not starting over. You are narrowing. And in round 4, you are using the model to improve your own process.&lt;/p&gt;
&lt;h3 id=&quot;the-anti-patterns&quot;&gt;The Anti-Patterns&lt;/h3&gt;
&lt;p&gt;These waste time and tokens. Stop doing them.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Vague delegation.&lt;/strong&gt; “Make this better” is not an instruction. Better how? Faster? More secure? More readable? If you cannot articulate what “better” means, you do not know what you want. The model cannot fix that.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prompt stuffing.&lt;/strong&gt; Dumping 50 pages of documentation and saying “analyze this” guarantees the model will miss the parts that matter. Remember the lost-in-the-middle problem. Curate your context.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Politeness tokens.&lt;/strong&gt; “Could you please kindly help me with” burns tokens and adds zero signal. The model processes instructions. Give it instructions.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ambiguous references.&lt;/strong&gt; “Update it to use the new format” after a long conversation. What is “it”? What is “the new format”? Name the file. Specify the format. The model will not ask for clarification. It will guess.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Over-prompting for modern models.&lt;/strong&gt; Both Anthropic and OpenAI warn about this. Instructions that were necessary for older models (“CRITICAL: You MUST use this tool”) will cause current models to overtrigger. Anthropic’s guidance: “Where you might have said ‘CRITICAL: You MUST use this tool when…’, you can use more normal prompting like ‘Use this tool when…’” OpenAI’s guidance: soften thoroughness instructions because “GPT-5 is already naturally introspective about context gathering.” (&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Sources&lt;/a&gt;, &lt;a href=&quot;https://cookbook.openai.com/examples/gpt-5/gpt-5_prompting_guide&quot;&gt;OpenAI&lt;/a&gt;)&lt;/p&gt;
&lt;h3 id=&quot;platform-specific-tips&quot;&gt;Platform-Specific Tips&lt;/h3&gt;
&lt;h4 id=&quot;claude-anthropic&quot;&gt;Claude (Anthropic)&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;XML tags are first-class.&lt;/strong&gt; Claude is specifically trained to parse XML structure. Use &lt;code&gt;&amp;#x3C;context&gt;&lt;/code&gt;, &lt;code&gt;&amp;#x3C;instructions&gt;&lt;/code&gt;, &lt;code&gt;&amp;#x3C;examples&gt;&lt;/code&gt; to delineate sections.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;3 to 5 examples&lt;/strong&gt; is the recommended range for few-shot prompting.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Long documents go at the top&lt;/strong&gt; of the prompt, queries at the bottom. This improves response quality up to 30%.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ground responses in quotes.&lt;/strong&gt; For long document tasks, ask Claude to quote relevant parts before answering. This cuts through noise.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;CLAUDE.md files&lt;/strong&gt; for Claude Code users provide persistent instructions that load every session without burning tokens on repeated prompts.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;gpt-5-openai&quot;&gt;GPT-5 (OpenAI)&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Metaprompting.&lt;/strong&gt; Ask GPT-5 to review and improve your prompt. It will suggest phrases to add or remove.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Reasoning effort parameter.&lt;/strong&gt; Adjust &lt;code&gt;reasoning_effort&lt;/code&gt; (low/medium/high) to control how much the model explores before answering.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Persistence framing.&lt;/strong&gt; Use “keep going until the user’s query is completely resolved” to prevent premature task termination.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Self-reflection rubrics.&lt;/strong&gt; For complex generation tasks, have the model create a 5 to 7 category excellence rubric internally, then iterate against it.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;gemini-3-google&quot;&gt;Gemini 3 (Google)&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Keep &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-temperature&quot;&gt;temperature&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-temperature&quot;&gt;A parameter that controls how random or deterministic an AI model&apos;s output is, with lower values producing focused answers and higher values producing creative ones. &lt;a href=&quot;https://bytesnation.com/dictionary/temperature/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; at 1.0.&lt;/strong&gt; Gemini 3’s reasoning is optimized for the default. Lowering it can cause looping or degraded performance on complex tasks.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Split-step verification.&lt;/strong&gt; Verify information exists before generating answers to prevent confident but incorrect outputs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Concise by default.&lt;/strong&gt; Gemini 3 gives direct, efficient answers. Request detail explicitly if you need it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Avoid broad negatives.&lt;/strong&gt; “Do not infer” causes problems. Instead, specify what the model should use for reasoning.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;quick-reference-technique-cheat-sheet&quot;&gt;Quick Reference: Technique Cheat Sheet&lt;/h3&gt;























































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Technique&lt;/th&gt;&lt;th&gt;What It Does&lt;/th&gt;&lt;th&gt;When to Use&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Role Assignment&lt;/td&gt;&lt;td&gt;Activates domain-specific patterns&lt;/td&gt;&lt;td&gt;Every prompt with a specialized context&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Few-Shot Examples&lt;/td&gt;&lt;td&gt;Teaches output format by pattern&lt;/td&gt;&lt;td&gt;Structured extraction, classification, formatting&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;XML/Tag Structure&lt;/td&gt;&lt;td&gt;Eliminates ambiguity between sections&lt;/td&gt;&lt;td&gt;Multi-part prompts, mixed instructions and data&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Chain of Thought&lt;/td&gt;&lt;td&gt;Forces step-by-step reasoning&lt;/td&gt;&lt;td&gt;Validation, debugging, complex analysis&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Output Constraints&lt;/td&gt;&lt;td&gt;Locks format and schema&lt;/td&gt;&lt;td&gt;API integrations, automation pipelines&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Context Placement&lt;/td&gt;&lt;td&gt;Exploits attention distribution&lt;/td&gt;&lt;td&gt;Long documents, multi-source analysis&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Negative Constraints&lt;/td&gt;&lt;td&gt;Overrides training defaults&lt;/td&gt;&lt;td&gt;Terraform, code gen, any structured output&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Iterative Refinement&lt;/td&gt;&lt;td&gt;Narrows toward precision over rounds&lt;/td&gt;&lt;td&gt;Architecture, planning, complex deliverables&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Metaprompting&lt;/td&gt;&lt;td&gt;Uses the model to improve your prompts&lt;/td&gt;&lt;td&gt;Prompt optimization, workflow development&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;bottom-line&quot;&gt;Bottom Line&lt;/h3&gt;
&lt;p&gt;Prompt engineering is instruction writing. That is it. No mysticism. No secret sauce.&lt;/p&gt;
&lt;p&gt;The model is a system that follows orders literally. Vague orders produce vague results. Precise orders produce precise results. Three independent engineering teams at Anthropic, OpenAI, and Google arrived at the same conclusion: be clear, be structured, be specific, provide examples, and constrain the output.&lt;/p&gt;
&lt;p&gt;You would not hand a junior admin a firewall change request that says “make it more secure.” You would specify the exact rules, the exact interfaces, the exact traffic flows, and the expected behavior. Treat the model the same way.&lt;/p&gt;
&lt;p&gt;Write your prompts like operations orders. State the situation. Define the task. Specify the constraints. Dictate the format. Provide examples. Execute.&lt;/p&gt;
&lt;p&gt;Next post: RAG (retrieval-augmented generation) and how to give your AI access to knowledge it was never trained on. The context window is not the only way to feed data to a model. It is not even the best way.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;sources&quot;&gt;Sources&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/claude-4-best-practices&quot;&gt;Anthropic: Prompting Best Practices for Claude 4&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/multishot-prompting&quot;&gt;Anthropic: Multishot Prompting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cookbook.openai.com/examples/gpt-5/gpt-5_prompting_guide&quot;&gt;OpenAI: GPT-5 Prompting Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://platform.openai.com/docs/guides/prompt-engineering&quot;&gt;OpenAI: Prompt Engineering Guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://ai.google.dev/gemini-api/docs/prompting-strategies&quot;&gt;Google: Gemini API Prompt Design Strategies&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/gemini-3-prompting-guide&quot;&gt;Google: Gemini 3 Prompting Guide&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/prompt-engineering-header.png" length="0" type="image/png"/></item><item><title>How AI Actually Works: Tokens, Context Windows, and Why Your Chatbot Forgets Things</title><link>https://bytesnation.com/blog/how-ai-actually-works/</link><guid isPermaLink="true">https://bytesnation.com/blog/how-ai-actually-works/</guid><description>How LLMs actually work: tokens, transformers, context windows, attention, and output sampling. Plus proven techniques to optimize token usage in Claude and ChatGPT. Interactive demos included.</description><pubDate>Fri, 10 Apr 2026 00:00:00 GMT</pubDate><enclosure url="https://bytesnation.com/assets/blog/hero-ai-explainer.png" length="0" type="image/png"/></item><item><title>MCP Hit 97 Million Installs. The Protocol War Is Over.</title><link>https://bytesnation.com/blog/mcp-97-million-installs/</link><guid isPermaLink="true">https://bytesnation.com/blog/mcp-97-million-installs/</guid><description>Anthropic&apos;s Model Context Protocol crossed 97 million monthly SDK downloads. Every major AI provider supports it. The Linux Foundation just took it under open governance. This is the standard now.</description><pubDate>Fri, 10 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;your-ai-tools-are-about-to-get-a-lot-more-useful&quot;&gt;Your AI Tools Are About to Get a Lot More Useful&lt;/h2&gt;
&lt;p&gt;Every AI assistant you use is about to stop being a fancy autocomplete and start actually doing things. The reason is a protocol most people have never heard of.&lt;/p&gt;
&lt;p&gt;Anthropic’s &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-mcp-protocol&quot;&gt;Model Context Protocol&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-mcp-protocol&quot;&gt;An open standard for connecting AI assistants to external data sources and tools, enabling them to access real-time information and take actions. &lt;a href=&quot;https://bytesnation.com/dictionary/mcp-protocol/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; crossed 97 million monthly SDK downloads in March 2026. For context, &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-kubernetes&quot;&gt;Kubernetes&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-kubernetes&quot;&gt;An open-source platform for automating the deployment, scaling, and management of containerized applications across clusters of machines. &lt;a href=&quot;https://bytesnation.com/dictionary/kubernetes/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; took nearly four years to reach comparable deployment density. MCP did it in sixteen months.&lt;/p&gt;
&lt;p&gt;The Linux Foundation announced the &lt;a href=&quot;https://www.linuxfoundation.org/press/linux-foundation-announces-the-formation-of-the-agentic-ai-foundation&quot;&gt;Agentic AI Foundation (AAIF)&lt;/a&gt; to house MCP under open governance, alongside OpenAI’s AGENTS.md and Block’s goose. This is not one company’s project anymore. OpenAI, Google, Microsoft, AWS, and Cloudflare all ship MCP-compatible tooling. Over 5,800 community and enterprise MCP servers are live, covering everything from databases to CRMs to dev tools.&lt;/p&gt;
&lt;h3 id=&quot;what-mcp-actually-is&quot;&gt;What MCP Actually Is&lt;/h3&gt;
&lt;p&gt;Most people encounter AI through a chat interface and assume the model is the product. It is not. The model is the reasoning engine. The product is everything the model can connect to.&lt;/p&gt;
&lt;p&gt;MCP is the protocol that defines how AI models connect to external tools and data sources. It gives a model a standardized way to say “I need to query your database” or “I need to write to your calendar” or “I need to run a command in your shell” and have the target system respond in a format the model can use.&lt;/p&gt;
&lt;p&gt;Before MCP, every AI integration was bespoke. Connecting Claude to your Notion database required Anthropic to build a Notion integration or you to write one from scratch, with custom &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-json&quot;&gt;JSON&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-json&quot;&gt;A lightweight, human-readable data format used to exchange structured information between systems, based on JavaScript object syntax. &lt;a href=&quot;https://bytesnation.com/dictionary/json/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; formats, one-off authentication handling, and code that broke every time either &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-api&quot;&gt;API&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-api&quot;&gt;A set of rules and protocols that allows different software applications to communicate with each other and share data or functionality. &lt;a href=&quot;https://bytesnation.com/dictionary/api/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; changed. Multiply that by every tool you want to connect, and you have an integration surface that nobody can maintain.&lt;/p&gt;
&lt;p&gt;MCP replaces that with a single protocol. Build one MCP server for Notion, and every MCP-compatible model can connect to it. Build one client in Claude Desktop, and it connects to every MCP-compatible server. The USB &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-port&quot;&gt;port&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-port&quot;&gt;A numbered endpoint on a device that identifies a specific application or service, allowing multiple network services to run on the same IP address. &lt;a href=&quot;https://bytesnation.com/dictionary/port/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; analogy holds because it is exactly right: one interface, everything plugs in.&lt;/p&gt;
&lt;h3 id=&quot;how-it-works-under-the-hood&quot;&gt;How It Works Under the Hood&lt;/h3&gt;
&lt;p&gt;MCP uses a client-server architecture over a local socket or stdio transport. The model (or the application hosting the model) runs an MCP client. Each tool or data source runs an MCP server. The client discovers available servers, queries their capabilities, and invokes tools via JSON-RPC messages.&lt;/p&gt;
&lt;p&gt;A minimal MCP server looks like this:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;typescript&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { Server } &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;@modelcontextprotocol/sdk/server/index.js&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { StdioServerTransport } &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;from&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;@modelcontextprotocol/sdk/server/stdio.js&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; server&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; Server&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;({ name: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;file-reader&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, version: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;1.0.0&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; });&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;server.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;setRequestHandler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;tools/list&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; () &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ({&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  tools: [{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    name: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;read_file&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    description: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Read the contents of a file from the filesystem&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    inputSchema: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      type: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;object&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      properties: { path: { type: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;string&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; } },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      required: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;path&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;server.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;setRequestHandler&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;tools/call&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;async&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; (&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;request&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; } &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; request.params.arguments;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; content&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; await&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; fs.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;readFile&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(path, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;utf-8&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;);&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; { content: [{ type: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;text&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, text: content }] };&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;});&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; transport&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; StdioServerTransport&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;();&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;await&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; server.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;connect&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(transport);&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The model sends a &lt;code&gt;tools/list&lt;/code&gt; request, gets back a description of what the server can do, and then calls &lt;code&gt;tools/call&lt;/code&gt; with arguments when it needs to use a tool. The server executes the action and returns structured data. The model uses that data to continue its reasoning.&lt;/p&gt;
&lt;p&gt;That is the entire protocol. The complexity is in what you build on top of it, not in MCP itself.&lt;/p&gt;
&lt;h3 id=&quot;the-three-resource-types&quot;&gt;The Three Resource Types&lt;/h3&gt;
&lt;p&gt;MCP servers can expose three kinds of resources to a model:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Tools&lt;/strong&gt; are actions the model can invoke: run a query, write a file, send an email, make an API call. Tools have side effects. They change state in the world.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Resources&lt;/strong&gt; are data the model can read: documents, database records, configuration files, log output. Resources are generally read-only. The model uses them to build context without taking action.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prompts&lt;/strong&gt; are templated instructions the server can inject into the model’s context: system prompts, workflow templates, contextual guidance. Prompts let server operators influence how the model reasons about their domain.&lt;/p&gt;
&lt;p&gt;A full-featured MCP server for a task management system might expose tools to create, update, and close tasks; resources to read task lists, project details, and user assignments; and prompts that instruct the model to always check for blocking dependencies before marking a task complete. The model gets tools, data, and operational guidance from a single server connection.&lt;/p&gt;
&lt;h3 id=&quot;the-competitive-landscape&quot;&gt;The Competitive Landscape&lt;/h3&gt;
&lt;p&gt;Rivals exist. IBM has the Agent Communication Protocol (ACP). Google has Agent-to-Agent (A2A). Both emerged in 2025 as alternatives to MCP.&lt;/p&gt;
&lt;p&gt;ACP targets enterprise workflows and is designed to handle more complex multi-agent coordination patterns. A2A focuses on agent-to-agent communication rather than agent-to-tool communication. Neither is wrong. But both are fighting adoption curves that MCP had already won.&lt;/p&gt;
&lt;p&gt;97 million monthly installs is not a lead. It is a moat. Developer tooling network effects compound fast. When 5,800 MCP servers already exist covering your database, your CRM, your code repository, your calendar, and your filesystem, the switching cost of adopting a different protocol is the cost of rebuilding every integration you already have.&lt;/p&gt;
&lt;p&gt;The Linux Foundation governance announcement matters because it removes the remaining objection for enterprise adoption. MCP is no longer an Anthropic project. It is an open standard with foundation backing, the same path that HTTP, &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-docker&quot;&gt;Docker&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-docker&quot;&gt;A platform that packages applications into containers, providing a standardized way to build, ship, and run software consistently across any environment. &lt;a href=&quot;https://bytesnation.com/dictionary/docker/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, and Kubernetes walked before it.&lt;/p&gt;
&lt;h3 id=&quot;why-this-matters-right-now&quot;&gt;Why This Matters Right Now&lt;/h3&gt;
&lt;p&gt;If you are building AI-powered workflows, MCP is the integration layer you need to understand. Not “eventually” understand. Now.&lt;/p&gt;
&lt;p&gt;The tooling is mature. The SDK is stable. The server ecosystem covers the tools most developers and teams actually use. Claude Desktop, Cursor, Zed, and VS Code all support MCP. The barrier to entry for running your first MCP server is about thirty minutes and a package install.&lt;/p&gt;
&lt;p&gt;More importantly: MCP is the difference between AI that reasons about your work and AI that actually does your work. The gap between those two things is everything.&lt;/p&gt;
&lt;h3 id=&quot;the-bytesnation-angle&quot;&gt;The BytesNation Angle&lt;/h3&gt;
&lt;p&gt;We have a full MCP series coming. Obsidian MCP for wiring your personal knowledge vault into Claude. Granola MCP for surfacing meeting transcripts during active sessions. Claude Code MCP for exposing homelab infrastructure to AI-driven automation. The tools we use every day in this lab all run on this protocol. You will see exactly how they work, hands on, with real configs and real results.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;MCP is the thing that makes AI stop talking and start working. Pay attention.&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h4 id=&quot;sources&quot;&gt;Sources&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://dev.to/alanwest/mcp-hit-97-million-installs-the-protocol-war-is-over-47ab&quot;&gt;MCP Hit 97 Million Installs. The Protocol War Is Over. (DEV Community)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.linuxfoundation.org/press/linux-foundation-announces-the-formation-of-the-agentic-ai-foundation&quot;&gt;Linux Foundation Announces the Formation of the Agentic AI Foundation (AAIF)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://github.blog/open-source/maintainers/mcp-joins-the-linux-foundation-what-this-means-for-developers-building-the-next-era-of-ai-tools-and-agents/&quot;&gt;MCP joins the Linux Foundation (GitHub Blog)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.anthropic.com/news/donating-the-model-context-protocol-and-establishing-of-the-agentic-ai-foundation&quot;&gt;Anthropic: Donating MCP and Establishing the Agentic AI Foundation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/mcp-97-million-header.png" length="0" type="image/png"/></item><item><title>AI Agents Are Already Making Decisions for You. Here Is What That Means.</title><link>https://bytesnation.com/blog/agentic-ai-what-you-need-to-know/</link><guid isPermaLink="true">https://bytesnation.com/blog/agentic-ai-what-you-need-to-know/</guid><description>Agentic AI is not coming. It is here. It is approving loans, triaging your support tickets, and running attack campaigns. If you do not understand how it works, you are already behind.</description><pubDate>Thu, 09 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;you-are-already-interacting-with-ai-agents&quot;&gt;You Are Already Interacting with AI Agents&lt;/h2&gt;
&lt;p&gt;That customer support ticket you filed last week? An &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-ai-agent&quot;&gt;AI agent&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-ai-agent&quot;&gt;An AI system that can autonomously plan, execute multi-step tasks, use tools, and make decisions to accomplish a goal with minimal human guidance. &lt;a href=&quot;https://bytesnation.com/dictionary/ai-agent/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; triaged it, diagnosed the issue, and resolved it without a human touching it. The loan application you submitted? An AI agent ran your credit profile, verified your identity documents, and made a preliminary approval decision before a human ever reviewed the file.&lt;/p&gt;
&lt;p&gt;This is not a concept paper. This is not a startup pitch deck. This is what is deployed, in production, right now across banking, healthcare, telecom, and enterprise IT.&lt;/p&gt;
&lt;p&gt;72% of medium and large enterprises are already running agentic AI systems. Gartner projects that 40% of enterprise applications will embed task-specific AI agents by the end of this year, up from less than 5% in 2025. That is not gradual adoption. That is a phase shift.&lt;/p&gt;
&lt;p&gt;If you do not understand what an AI agent is, how it operates, and what it means for your career and your security, you are flying blind into a landscape that is already reshaping around you.&lt;/p&gt;
&lt;h2 id=&quot;what-an-ai-agent-actually-is&quot;&gt;What an AI Agent Actually Is&lt;/h2&gt;
&lt;p&gt;Strip away the marketing. An AI agent is software that receives a goal, breaks it into steps, executes those steps using tools, and adjusts its approach based on what happens. It does not wait for you to click “next.” It operates.&lt;/p&gt;
&lt;p&gt;A chatbot waits for your input and responds. An agent takes your request and goes to work. It reads databases, calls APIs, sends emails, writes code, schedules meetings, and makes decisions in sequence without stopping to ask permission at every step.&lt;/p&gt;
&lt;p&gt;The difference matters. A chatbot is a tool you use. An agent is a system that acts on your behalf. That distinction changes everything about trust, accountability, and attack surface.&lt;/p&gt;
&lt;p&gt;Three properties define an AI agent:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Autonomy.&lt;/strong&gt; It executes multi-step tasks without continuous human input.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tool use.&lt;/strong&gt; It interacts with external systems: databases, APIs, file systems, browsers, other agents.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Adaptive reasoning.&lt;/strong&gt; It adjusts its plan when something fails or when new information arrives.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;When you chain multiple agents together, each with a specialized role, you get a multi-agent system. One agent handles research, another writes the report, a third reviews it for quality. They coordinate, delegate, and produce output that would have taken a team of people days to assemble.&lt;/p&gt;
&lt;h2 id=&quot;what-agentic-ai-is-doing-right-now&quot;&gt;What Agentic AI Is Doing Right Now&lt;/h2&gt;
&lt;p&gt;This is not theoretical. These are documented, production deployments as of early 2026.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Banking and Finance.&lt;/strong&gt; AI agents are running Know Your Customer (KYC) and Anti-Money Laundering (AML) checks autonomously. Banks report 200% to 2,000% productivity gains on these workflows. Agents are adjusting credit scores, calculating loan terms, and monitoring financial health indicators without manual intervention.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Healthcare.&lt;/strong&gt; Agents are updating electronic health records by pulling data from lab systems, wearable devices, and telehealth visits. Hospitals are using them to optimize patient flow, manage staff scheduling, and triage incoming cases based on severity and resource availability.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enterprise IT and HR.&lt;/strong&gt; One major chipmaker deployed AI-powered HR agents that reduced time-to-resolution on employee inquiries by 80% and hit 70% employee satisfaction within 90 days. A major telecom reports saving 40 minutes per AI interaction across its workforce.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Supply Chain.&lt;/strong&gt; Agentic control towers are monitoring end-to-end supply chain KPIs in real time, identifying emerging disruptions before they cascade, executing contingency plans, and coordinating stakeholders across the network. No human in the loop until the situation exceeds the agent’s authority threshold.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Customer Support.&lt;/strong&gt; AI agents are independently triaging, diagnosing, and resolving support tickets end to end. Not routing them to a human queue. Resolving them. Companies deploying this report measurable ROI within weeks, not quarters.&lt;/p&gt;
&lt;p&gt;This is the new baseline. If your employer is not deploying agents, your competitor’s employer is.&lt;/p&gt;
&lt;h2 id=&quot;the-threat-angle-agents-as-attack-vectors&quot;&gt;The Threat Angle: Agents as Attack Vectors&lt;/h2&gt;
&lt;p&gt;Here is where it gets serious. Every capability that makes AI agents useful also makes them dangerous.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.crowdstrike.com/en-us/global-threat-report/&quot;&gt;CrowdStrike 2026 Global Threat Report&lt;/a&gt; documents an 89% year-over-year increase in AI-enabled attacks. Average eCrime breakout time is now 29 minutes, a 65% acceleration from 2024. Attackers are faster because they are using agents too.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prompt injection&lt;/strong&gt; remains the most common attack vector against agentic systems. An attacker embeds malicious instructions inside data that an agent processes (an email, a document, a web page). The agent reads it, treats it as a legitimate instruction, and executes it. Success rates on prompt injection attacks still exceed 85% against many deployed defenses. The agent does not know it has been compromised. It just follows the instructions it was given.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Memory poisoning&lt;/strong&gt; is the sleeper threat. Unlike prompt injection that ends when the session closes, memory poisoning plants false information in an agent’s long-term storage. The agent “learns” the malicious instruction and recalls it in future sessions, days or weeks later. This is persistent compromise of an autonomous system.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-privilege-escalation&quot;&gt;Privilege escalation&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-privilege-escalation&quot;&gt;An attack where an adversary gains higher access permissions than originally granted, escalating from a normal user to administrator or root. &lt;a href=&quot;https://bytesnation.com/dictionary/privilege-escalation/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt; through tool misuse happens when an agent with access to sensitive systems gets manipulated into performing actions outside its intended scope. If an agent has database access and email access, an attacker who compromises the agent gets both.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cascading failures&lt;/strong&gt; occur in multi-agent systems. One compromised agent feeds bad data to downstream agents. Each agent trusts the output of the previous one. The corruption propagates through the entire pipeline before anyone detects it.&lt;/p&gt;
&lt;p&gt;48% of security leaders surveyed believe agentic AI will represent the top attack vector for cybercriminals and nation-state threats by the end of 2026. That is not a fringe opinion. That is nearly half the industry.&lt;/p&gt;
&lt;p&gt;The defenses that matter are not exotic. Strong identity controls. Network segmentation. Behavior-based anomaly detection. Least privilege access for every agent. Monitoring agent actions the same way you monitor user actions. The fundamentals have not changed. The attack surface has.&lt;/p&gt;
&lt;h2 id=&quot;the-opportunity-why-this-is-your-on-ramp&quot;&gt;The Opportunity: Why This Is Your On-Ramp&lt;/h2&gt;
&lt;p&gt;Here is the part most people miss. You do not need a computer science degree to work with AI agents. The barrier to entry has never been lower.&lt;/p&gt;
&lt;p&gt;Job postings mentioning agentic AI skills jumped 986% between 2023 and 2024. Companies across every industry are building teams around this technology and they cannot find enough people. The demand is outpacing the supply of talent by a wide margin.&lt;/p&gt;
&lt;p&gt;The roles emerging are not all engineering roles:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AI Operations Manager.&lt;/strong&gt; Monitors deployed agents, ensures uptime, handles escalations when agents exceed their authority. This is IT operations adapted for autonomous systems.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;AI Compliance and Policy Advisor.&lt;/strong&gt; Interprets regulations around AI automation, ensures agents operate within legal and ethical boundaries. Legal and compliance backgrounds are directly applicable.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Workflow Architect.&lt;/strong&gt; Designs the multi-step processes that agents execute. This requires understanding business operations, not writing code.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prompt Engineer and Agent Designer.&lt;/strong&gt; Crafts the instructions and guardrails that shape agent behavior. Writing clear, precise instructions is a skill that transfers from technical writing, military operations orders, and process documentation.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The skills that matter most are not technical in the traditional sense. Adaptability. Critical thinking. Data interpretation. Clear communication. Understanding how systems connect and where they break. If you have operational experience in any field, you already have transferable skills.&lt;/p&gt;
&lt;p&gt;Low-code and no-code platforms for building agent workflows exist right now. You can connect APIs, define decision logic, set up triggers and responses, and deploy functional automation without writing a framework from scratch. The tools are accessible. What is missing is the understanding of how to use them deliberately and safely.&lt;/p&gt;
&lt;p&gt;This is where the real gap is. Not in coding ability. In systems thinking. Understanding what an agent should and should not do. Knowing where to put guardrails. Recognizing when an automated process needs a human checkpoint. That judgment comes from experience, not credentials.&lt;/p&gt;
&lt;h2 id=&quot;what-to-do-about-it&quot;&gt;What to Do About It&lt;/h2&gt;
&lt;p&gt;Stop watching from the sidelines. The window where “I am not a tech person” was a valid excuse is closing.&lt;/p&gt;
&lt;p&gt;You do not need to build AI agents from scratch. You need to understand how they work, what they can do, what they cannot do, and where they break. You need enough literacy to evaluate whether the AI system your company is deploying is secure, effective, and aligned with the outcomes it claims to deliver.&lt;/p&gt;
&lt;p&gt;Start here:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Learn the vocabulary.&lt;/strong&gt; Agents, tool use, prompt injection, multi-agent orchestration, guardrails. You cannot evaluate what you cannot name.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Build something small.&lt;/strong&gt; Use a no-code automation platform. Connect two services. Set up a trigger. Watch an agent execute a workflow. The hands-on experience is worth more than a hundred articles.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Study the threat model.&lt;/strong&gt; Understand prompt injection, memory poisoning, and privilege escalation. If you are deploying agents or working alongside them, you need to know how they get compromised.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Think in systems.&lt;/strong&gt; Every agent operates within a larger context: data sources, permissions, downstream consumers, failure modes. Map those connections. That is where the value is.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;BytesNation exists to give people without traditional backgrounds the field notes they need to become builders, not bystanders. The content here is not theoretical. It is operational. Built by someone who deploys these systems, breaks them, and documents the process.&lt;/p&gt;
&lt;p&gt;Agentic AI is not the future of work. It is the present of work. The question is whether you are going to understand it or get automated by it.&lt;/p&gt;
&lt;p&gt;Your move.&lt;/p&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/agentic-ai-header.png" length="0" type="image/png"/></item><item><title>Obsidian as a Knowledge Vault: The Field Manual</title><link>https://bytesnation.com/blog/obsidian-pkm-vault-guide/</link><guid isPermaLink="true">https://bytesnation.com/blog/obsidian-pkm-vault-guide/</guid><description>Most people use Obsidian like a glorified notepad. Here is how to build it into a real knowledge management system with structure, automation, a daily operating rhythm, and an LLM-maintained wiki that scales.</description><pubDate>Thu, 09 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;stop-taking-notes-start-building-a-system&quot;&gt;Stop Taking Notes. Start Building a System.&lt;/h2&gt;
&lt;div style=&quot;position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; border-radius: 12px; margin-bottom: 2rem;&quot;&gt;
  &lt;iframe src=&quot;https://www.youtube.com/embed/PX7EfWCgXsI&quot; title=&quot;Obsidian PKM Vault Guide - BytesNation&quot; style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen loading=&quot;lazy&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;You have notes scattered across six apps. Half of them are duplicates. The other half are orphans you will never find again. You tell yourself you will organize them “later.” Later never comes.&lt;/p&gt;
&lt;p&gt;Obsidian fixes this, but only if you stop treating it like a notepad and start treating it like infrastructure. A knowledge vault is not a collection of files. It is an architecture. It has routing, a hierarchy, an inbox, automated pipelines, and a daily operating rhythm.&lt;/p&gt;
&lt;p&gt;This is how to build one that actually works.&lt;/p&gt;
&lt;h2 id=&quot;what-is-obsidian&quot;&gt;What Is Obsidian&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/&quot;&gt;Obsidian&lt;/a&gt; is a local-first, markdown-based knowledge management application. Your notes are plain &lt;code&gt;.md&lt;/code&gt; files on your filesystem. No cloud lock-in. No proprietary format. No subscription required for core functionality.&lt;/p&gt;
&lt;p&gt;Why that matters:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Portability.&lt;/strong&gt; Your notes work in any text editor, forever. If Obsidian disappears tomorrow, you still have your vault.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Speed.&lt;/strong&gt; Local files are instant. No &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-api&quot;&gt;API&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-api&quot;&gt;A set of rules and protocols that allows different software applications to communicate with each other and share data or functionality. &lt;a href=&quot;https://bytesnation.com/dictionary/api/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-latency&quot;&gt;latency&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-latency&quot;&gt;The time delay between sending a request and receiving the first byte of the response, typically measured in milliseconds. &lt;a href=&quot;https://bytesnation.com/dictionary/latency/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, no sync lag on search.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Privacy.&lt;/strong&gt; Your data stays on your machine unless you explicitly sync it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-git&quot;&gt;Git&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-git&quot;&gt;A distributed version control system that tracks changes to files over time, enabling collaboration, branching, and complete history of every modification. &lt;a href=&quot;https://bytesnation.com/dictionary/git/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;-friendly.&lt;/strong&gt; Version control your entire knowledge base. Track changes, branch experiments, revert mistakes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Obsidian’s real power is in its linking system. Every note can reference every other note using &lt;code&gt;[[wikilinks]]&lt;/code&gt;. Over time, this creates a graph of connected knowledge that surfaces relationships you would never find in a folder tree.&lt;/p&gt;
&lt;h2 id=&quot;the-ace-framework&quot;&gt;The ACE Framework&lt;/h2&gt;
&lt;p&gt;Folder structure is where most people either overthink or underthink. They either create 47 nested folders or dump everything into one pile. Both fail at scale.&lt;/p&gt;
&lt;p&gt;The ACE framework (Atlas, Calendar, Efforts) was created by &lt;a href=&quot;https://www.linkingyourthinking.com/&quot;&gt;Nick Milo&lt;/a&gt; as part of his Linking Your Thinking (LYT) methodology. It is the best organizational model I have found for Obsidian, and the foundation of how my vault is structured. Full credit to Nick for this framework; what follows is how I adapted it.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/ace-framework.png&quot; alt=&quot;ACE Framework: Atlas, Calendar, Efforts&quot;&gt;&lt;/p&gt;
&lt;p&gt;ACE solves the folder problem with three clear domains:&lt;/p&gt;
&lt;h3 id=&quot;atlas-what-you-know&quot;&gt;Atlas: What You Know&lt;/h3&gt;
&lt;p&gt;This is your permanent knowledge base. Reference material, technical notes, how-to guides, concept breakdowns. Organized by topic, not by project or time.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Atlas/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  API Documentation/ # API references and specs&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  MOCs/              # Maps of Content (navigation hubs)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Notes/             # Topic-organized knowledge&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Cyber Security/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Gaming/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Hardware/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Networking/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Operating Systems/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Programming/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Systems Administration/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Sources/           # Book notes, articles, external references&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Spaces/            # Personal life areas&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    About/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Family/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Home Office/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    House/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Military/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Music/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Pets/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Recipes/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;MOCs (Maps of Content)&lt;/strong&gt; are the key innovation here. A MOC is a note that links to all related notes in a topic. Think of it as a manually curated index page. Your “Networking MOC” links to every networking note you have: &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-dns&quot;&gt;DNS&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-dns&quot;&gt;The system that translates human-readable domain names into IP addresses so devices can find each other on a network. &lt;a href=&quot;https://bytesnation.com/dictionary/dns/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-dhcp&quot;&gt;DHCP&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-dhcp&quot;&gt;A protocol that automatically assigns IP addresses and network settings to devices when they connect to a network. &lt;a href=&quot;https://bytesnation.com/dictionary/dhcp/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-vpn&quot;&gt;VPN&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-vpn&quot;&gt;A virtual private network that creates an encrypted tunnel between your device and a remote network, protecting your traffic from interception. &lt;a href=&quot;https://bytesnation.com/dictionary/vpn/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, wireless, protocols, guides.&lt;/p&gt;
&lt;p&gt;MOCs give you a two-hop navigation pattern: Note &gt; MOC &gt; Home. You can always find anything within two clicks.&lt;/p&gt;
&lt;h3 id=&quot;calendar-what-happened-when&quot;&gt;Calendar: What Happened When&lt;/h3&gt;
&lt;p&gt;Time-stamped content. Daily notes, meeting notes, weekly reviews. Anything where the date is the primary context.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Calendar/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Daily Notes/       # YYYY/MM/YYYY-MM-DD.md&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Meeting Notes/     # Organized by entity/project&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Daily notes are the heartbeat of the system. More on that below.&lt;/p&gt;
&lt;h3 id=&quot;efforts-what-you-are-working-on&quot;&gt;Efforts: What You Are Working On&lt;/h3&gt;
&lt;p&gt;Active projects and initiatives. Each effort gets its own folder with a MOC, tasks, and relevant documentation. When a project wraps up, move it to a Dormant folder. Do not delete it.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Efforts/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Active/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Project Alpha/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Project Bravo/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  Dormant/&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    Archived Project/&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id=&quot;the-inbox&quot;&gt;The Inbox&lt;/h3&gt;
&lt;p&gt;One more folder outside ACE: the inbox. Call it &lt;code&gt;+Encounters/&lt;/code&gt; or &lt;code&gt;Inbox/&lt;/code&gt;. The &lt;code&gt;+&lt;/code&gt; prefix keeps it sorted to the top of the file explorer. In my vault, &lt;code&gt;+Encounters/&lt;/code&gt; is the manual capture inbox, and a separate &lt;code&gt;Clippings/&lt;/code&gt; folder at the vault root receives web articles saved by the Obsidian Web Clipper browser extension.&lt;/p&gt;
&lt;p&gt;This concept comes from the &lt;a href=&quot;https://en.wikipedia.org/wiki/Zettelkasten&quot;&gt;Zettelkasten method&lt;/a&gt;, the slip-box system developed by German sociologist Niklas Luhmann. In Zettelkasten, the inbox is where raw captures land before being processed into permanent, atomic notes. Luhmann used this system to produce over 70 books and 400 academic papers from a single collection of 90,000 handwritten notes. The principle is simple: capture everything, process deliberately, connect intentionally.&lt;/p&gt;
&lt;p&gt;Every new note starts here. Raw captures, quick thoughts, meeting dumps. Nothing stays in the inbox permanently. During your daily review, you file each note into the correct ACE location, apply frontmatter, and link it to the appropriate MOC.&lt;/p&gt;
&lt;p&gt;If your inbox has more than 20 items in it, you are behind on processing. Fix that.&lt;/p&gt;
&lt;h2 id=&quot;frontmatter-your-metadata-layer&quot;&gt;Frontmatter: Your Metadata Layer&lt;/h2&gt;
&lt;p&gt;Every note in the vault should have &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-yaml&quot;&gt;YAML&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-yaml&quot;&gt;A human-readable data format used for configuration files, favored for its clean syntax with indentation instead of brackets and braces. &lt;a href=&quot;https://bytesnation.com/dictionary/yaml/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; frontmatter. This is non-negotiable. Frontmatter enables search, filtering, Dataview queries, and graph organization.&lt;/p&gt;
&lt;p&gt;Standard format:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;yaml&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;up&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;[[Parent MOC]]&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;tags&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;domain/topic&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;created&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;2026-04-09&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;---&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;up&lt;/code&gt;&lt;/strong&gt; is the upstream link. It tells you where this note lives in the hierarchy. Your “DNS Deep Dive” note points &lt;code&gt;up&lt;/code&gt; to &lt;code&gt;[[Networking MOC]]&lt;/code&gt;. The Networking MOC points &lt;code&gt;up&lt;/code&gt; to &lt;code&gt;[[Home]]&lt;/code&gt;. This creates a navigable chain from any note back to the vault root.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;tags&lt;/code&gt;&lt;/strong&gt; use a hierarchical prefix system:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;atlas/networking&lt;/code&gt;, &lt;code&gt;atlas/cyber-security&lt;/code&gt; for knowledge notes&lt;/li&gt;
&lt;li&gt;&lt;code&gt;effort/project-name&lt;/code&gt; for project notes&lt;/li&gt;
&lt;li&gt;&lt;code&gt;calendar/daily&lt;/code&gt;, &lt;code&gt;calendar/meeting&lt;/code&gt; for time-stamped notes&lt;/li&gt;
&lt;li&gt;&lt;code&gt;spaces/personal&lt;/code&gt; for life areas&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;created&lt;/code&gt;&lt;/strong&gt; is the creation date. Simple, but critical for filtering and sorting.&lt;/p&gt;
&lt;h2 id=&quot;the-daily-note-system&quot;&gt;The Daily Note System&lt;/h2&gt;
&lt;p&gt;This is where most knowledge management systems fall apart. People build beautiful folder structures and then never use them because there is no daily habit to drive input.&lt;/p&gt;
&lt;p&gt;The daily note is your operating system. One note per day, auto-generated from a template, structured to capture everything and route it to the right place.&lt;/p&gt;
&lt;p&gt;My daily note system is heavily influenced by &lt;a href=&quot;https://www.danmartell.com/&quot;&gt;Dan Martell&lt;/a&gt; and his work on time management, the Perfect Week, and shutdown routines. His book &lt;em&gt;Buy Back Your Time&lt;/em&gt; and his content on &lt;a href=&quot;https://www.danmartell.com/ceoday/&quot;&gt;designing your ideal day&lt;/a&gt; shaped how I think about daily planning, energy management, and the hard stop. What follows is my adaptation of those principles built directly into Obsidian.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/daily-note-system.png&quot; alt=&quot;Daily note system with priority matrix and time blocks&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;the-rhythm&quot;&gt;The Rhythm&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Night before (15 min):&lt;/strong&gt; Brain dump, park open loops, set tomorrow’s top 2. Hard stop. Walk away.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Morning (30 min):&lt;/strong&gt; Hydrate. Brain dump. Confirm priorities. Gratitude. This is not optional. This is how you start the day with intention instead of reaction.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Throughout the day:&lt;/strong&gt; Capture tasks to the Task Board with context tags. Log meeting notes. Add items to the Ingest Log.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;End of day (15 min):&lt;/strong&gt; What got done. What got punted. One improvement for tomorrow. Check North Star Metrics. Shutdown complete.&lt;/p&gt;
&lt;p&gt;Total daily overhead: about 60 minutes. The return on that hour is every other hour of your day being more focused.&lt;/p&gt;
&lt;h3 id=&quot;automating-the-rhythm&quot;&gt;Automating the Rhythm&lt;/h3&gt;
&lt;p&gt;The daily rhythm works. But it has friction. Opening yesterday’s note, copying uncompleted tasks, building the template, filling in navigation links. That is 10 minutes of bookkeeping before you even start thinking. At the end of the day, it is worse: pulling meeting notes, cross-referencing what got done, building tomorrow’s note. That overhead is what kills the habit.&lt;/p&gt;
&lt;p&gt;I automated both ends with &lt;a href=&quot;https://docs.anthropic.com/en/docs/claude-code&quot;&gt;Claude Code&lt;/a&gt; skills: custom command sequences that execute against the vault with full filesystem access.&lt;/p&gt;
&lt;h4 id=&quot;morning-stack&quot;&gt;Morning Stack&lt;/h4&gt;
&lt;p&gt;One command. The &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-llm&quot;&gt;LLM&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-llm&quot;&gt;A neural network trained on massive text datasets that can understand and generate human language, powering tools like ChatGPT and Claude. &lt;a href=&quot;https://bytesnation.com/dictionary/llm/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; locates the most recent daily note, extracts the Night Before Shutdown section (brain dump, open loops, tomorrow’s top 2), carries forward any uncompleted tasks from the Task Board with their priority scores intact, and creates today’s daily note from the template. Then it walks through the morning questions one at a time: confirm or drop carried-over tasks, brain dump, today’s top 2, gratitude. Every answer gets written directly into the daily note.&lt;/p&gt;
&lt;p&gt;No copy-pasting. No template fiddling. You sit down, run the command, answer the questions, and your day is set.&lt;/p&gt;
&lt;h4 id=&quot;end-of-day-shutdown&quot;&gt;End of Day Shutdown&lt;/h4&gt;
&lt;p&gt;Same concept, reverse direction. The LLM reads today’s daily note, gathers completed and uncompleted tasks, pulls meeting transcripts from the day, and creates standalone meeting notes filed into the correct project folder with proper frontmatter and cross-links. It pre-populates “what got done” grouped by project, then walks through the shutdown questions: confirm accomplishments, identify what got punted, one thing to do differently, North Star Metrics check, brain dump, open loops, and tomorrow’s top 2 priorities.&lt;/p&gt;
&lt;p&gt;Once complete, it writes everything to today’s daily note and creates tomorrow’s note pre-filled with the Night Before Shutdown section and the carried-over Task Board.&lt;/p&gt;
&lt;h4 id=&quot;where-the-data-comes-from&quot;&gt;Where the Data Comes From&lt;/h4&gt;
&lt;p&gt;The skills do not operate in a vacuum. They pull from multiple sources to build a complete picture of your day.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The vault itself.&lt;/strong&gt; The LLM reads the previous daily note to extract carried-over tasks, open loops, and planned priorities. It reads the Task Board to know what is still incomplete and what priority scores are assigned. It reads the Night Before Shutdown section to know what you brain-dumped before bed. All of this is just markdown files on disk; the LLM parses them directly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Meeting transcription services.&lt;/strong&gt; If you use a meeting recorder (Granola, Otter.ai, Fireflies, or any tool that produces transcripts), the EOD skill can pull the day’s meetings via API or &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-mcp-protocol&quot;&gt;MCP&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-mcp-protocol&quot;&gt;An open standard for connecting AI assistants to external data sources and tools, enabling them to access real-time information and take actions. &lt;a href=&quot;https://bytesnation.com/dictionary/mcp-protocol/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; connector, extract key decisions and action items, and generate structured meeting notes. The richer your transcript source, the better the output. At minimum, you need attendee names, a title, and a transcript or summary. The LLM handles the rest: routing the note to the right project folder, applying frontmatter, cross-linking to related vault content.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Calendar integrations.&lt;/strong&gt; Connected calendars (Google Calendar, Outlook, iCloud) give the LLM context on what meetings happened, when, and with whom. This lets it cross-reference transcripts against your schedule and fill gaps where a meeting was on the calendar but no transcript exists.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Email and messaging.&lt;/strong&gt; If you connect email or Slack via MCP, the LLM can surface action items or threads relevant to your open tasks. This is optional but useful for catching things that did not make it into the Task Board during the day.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The schema file.&lt;/strong&gt; The skill definition itself tells the LLM how to route notes, what frontmatter to apply, what folder structure to follow, and what questions to ask. Change the schema, change the behavior. No code changes required.&lt;/p&gt;
&lt;p&gt;The more sources you connect, the more complete the daily note becomes. Start with just the vault and add integrations as you need them. The system works at any level of connectivity.&lt;/p&gt;
&lt;h4 id=&quot;why-this-matters&quot;&gt;Why This Matters&lt;/h4&gt;
&lt;p&gt;The daily note system described above is a 60-minute manual process. With automation, the human input drops to the parts that actually require thinking: answering the questions, making decisions about priorities, and reflecting on the day. The LLM handles the rest. File creation, task carryover, meeting note extraction, cross-linking, template population. All the bookkeeping that causes people to abandon the habit after two weeks.&lt;/p&gt;
&lt;p&gt;The skills are just text files that describe the workflow. The LLM reads the instructions, reads the vault, and executes. No custom code, no API integrations, no build step. If the workflow needs to change, you edit the skill file. The LLM adapts on the next run.&lt;/p&gt;
&lt;h2 id=&quot;the-priority-matrix&quot;&gt;The Priority Matrix&lt;/h2&gt;
&lt;p&gt;The Task Board is not a to-do list. It is a scoring system.&lt;/p&gt;
&lt;p&gt;Each task gets scored on two axes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Impact&lt;/strong&gt; (1-3): How much does completing this move the needle?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Urgency&lt;/strong&gt; (1-3): How time-sensitive is it?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Score = Impact x Urgency. Highest score gets done first. Ties go to the task with higher impact.&lt;/p&gt;
&lt;p&gt;This prevents the common failure mode of spending all day on urgent-but-low-impact tasks while the important work sits untouched.&lt;/p&gt;
&lt;p&gt;For more complex tasks, use RICE scoring:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Reach:&lt;/strong&gt; How many people/systems does this affect?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Impact:&lt;/strong&gt; How significant is the effect?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Confidence:&lt;/strong&gt; How sure are you about the estimates?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Effort:&lt;/strong&gt; How much time/resources required?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;RICE Score = (Reach x Impact x Confidence) / Effort&lt;/p&gt;
&lt;h2 id=&quot;plugins-that-matter&quot;&gt;Plugins That Matter&lt;/h2&gt;
&lt;p&gt;Obsidian’s plugin ecosystem is massive. Most of it is noise. Here are the ones that earn their keep, organized by function.&lt;/p&gt;
&lt;h3 id=&quot;core-data-layer&quot;&gt;Core Data Layer&lt;/h3&gt;
&lt;h4 id=&quot;dataview&quot;&gt;Dataview&lt;/h4&gt;
&lt;p&gt;The single most important plugin. &lt;a href=&quot;https://obsidian.md/plugins?id=dataview&quot;&gt;Dataview&lt;/a&gt; lets you write queries against your vault metadata and render dynamic tables, lists, and task views.&lt;/p&gt;
&lt;p&gt;Example: Show all notes created this week in your Networking folder:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;TABLE WITHOUT ID&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  link(file.link, file.name) AS &quot;Note&quot;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;  dateformat(file.ctime, &quot;MMM dd&quot;) AS &quot;Added&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;FROM &quot;Atlas/Notes/Networking&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;WHERE file.ctime &gt;= date(today) - dur(7 days)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;SORT file.ctime DESC&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Your Home note becomes a live dashboard. Overdue tasks, notes created today, effort status, meeting history. All generated dynamically from your actual notes.&lt;/p&gt;
&lt;h4 id=&quot;tasks&quot;&gt;Tasks&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=obsidian-tasks-plugin&quot;&gt;Tasks&lt;/a&gt; turns markdown checkboxes into a full task management system with due dates, priorities, recurrence, and global queries. Your Home note can aggregate every open task across the entire vault using context tags, grouped by project, with overdue, due today, and due this week views.&lt;/p&gt;
&lt;h3 id=&quot;daily-operations&quot;&gt;Daily Operations&lt;/h3&gt;
&lt;h4 id=&quot;templater&quot;&gt;Templater&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=templater-obsidian&quot;&gt;Templater&lt;/a&gt; is a template engine with variable interpolation and logic. Your daily note template auto-generates the date, day of week, previous/next day navigation links, and Dataview queries specific to that date. Templates live in &lt;code&gt;Extras/Templates/&lt;/code&gt; and use &lt;code&gt;tp.file.title&lt;/code&gt; to derive the date from the filename.&lt;/p&gt;
&lt;p&gt;Without Templater, you are manually creating structured notes every day. That friction kills the habit within a week.&lt;/p&gt;
&lt;h4 id=&quot;calendar-and-periodic-notes&quot;&gt;Calendar and Periodic Notes&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=calendar&quot;&gt;Calendar&lt;/a&gt; gives you a visual sidebar for navigating daily notes. Click a date, jump to that note. &lt;a href=&quot;https://obsidian.md/plugins?id=periodic-notes&quot;&gt;Periodic Notes&lt;/a&gt; extends this with weekly, monthly, and quarterly note templates on the same calendar interface.&lt;/p&gt;
&lt;h4 id=&quot;day-planner&quot;&gt;Day Planner&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=obsidian-day-planner&quot;&gt;Day Planner&lt;/a&gt; lets you time-block your tasks directly in the daily note. Renders a visual timeline from markdown task lists with time annotations.&lt;/p&gt;
&lt;h3 id=&quot;knowledge-and-search&quot;&gt;Knowledge and Search&lt;/h3&gt;
&lt;h4 id=&quot;omnisearch&quot;&gt;Omnisearch&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=omnisearch&quot;&gt;Omnisearch&lt;/a&gt; is full-text search that actually works. Obsidian’s built-in search is decent. Omnisearch is better, especially in large vaults.&lt;/p&gt;
&lt;h4 id=&quot;smart-connections&quot;&gt;Smart Connections&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=smart-connections&quot;&gt;Smart Connections&lt;/a&gt; provides AI-powered note linking. It surfaces semantically related notes you might not have linked manually. Useful for finding connections across domains that keyword search would miss.&lt;/p&gt;
&lt;h3 id=&quot;visual-and-editing&quot;&gt;Visual and Editing&lt;/h3&gt;
&lt;h4 id=&quot;excalidraw&quot;&gt;Excalidraw&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=obsidian-excalidraw-plugin&quot;&gt;Excalidraw&lt;/a&gt; provides embedded diagramming directly inside Obsidian. Network topologies, architecture decisions, flowcharts, mind maps. The diagrams live as &lt;code&gt;.excalidraw.md&lt;/code&gt; files in your vault, linked to the context they belong to.&lt;/p&gt;
&lt;h4 id=&quot;advanced-tables&quot;&gt;Advanced Tables&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=table-editor-obsidian&quot;&gt;Advanced Tables&lt;/a&gt; makes editing markdown tables tolerable. Tab between cells, add/remove rows and columns without fighting pipe characters.&lt;/p&gt;
&lt;h4 id=&quot;outliner&quot;&gt;Outliner&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=obsidian-outliner&quot;&gt;Outliner&lt;/a&gt; enhances bullet list editing with folding, indenting, and reordering shortcuts. Turns Obsidian into an outliner when you need it.&lt;/p&gt;
&lt;h4 id=&quot;iconize-and-style-settings&quot;&gt;Iconize and Style Settings&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=obsidian-icon-folder&quot;&gt;Iconize&lt;/a&gt; adds visual icons to folders and files in the file explorer for faster scanning. &lt;a href=&quot;https://obsidian.md/plugins?id=obsidian-style-settings&quot;&gt;Style Settings&lt;/a&gt; exposes theme customization options as a settings panel.&lt;/p&gt;
&lt;h3 id=&quot;integration-layer&quot;&gt;Integration Layer&lt;/h3&gt;
&lt;h4 id=&quot;local-rest-api&quot;&gt;Local REST API&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=obsidian-local-rest-api&quot;&gt;Local REST API&lt;/a&gt; exposes your vault to external tools via HTTP. This is how you integrate Obsidian with automation platforms, scripts, or AI tools. Programmatic access to create, read, and update notes without opening Obsidian.&lt;/p&gt;
&lt;h4 id=&quot;mcp-tools&quot;&gt;MCP Tools&lt;/h4&gt;
&lt;p&gt;&lt;a href=&quot;https://obsidian.md/plugins?id=mcp-tools&quot;&gt;MCP Tools&lt;/a&gt; provides Model Context Protocol integration. This lets LLM agents interact with your vault through a standardized tool interface. Combined with the Local REST API, it is the bridge that makes the LLM Wiki pattern work with agents that do not have direct filesystem access.&lt;/p&gt;
&lt;p&gt;For the full list of tools, software, and services that power the lab (including Obsidian), check the &lt;a href=&quot;https://bytesnation.com/tools/&quot;&gt;Tools and Resources&lt;/a&gt; page.&lt;/p&gt;
&lt;h2 id=&quot;mocs-the-navigation-layer&quot;&gt;MOCs: The Navigation Layer&lt;/h2&gt;
&lt;p&gt;Maps of Content deserve their own section because they are the difference between a vault you use and a vault you abandon.&lt;/p&gt;
&lt;p&gt;A MOC is a note that serves as a curated index for a topic. It is not auto-generated. You maintain it manually, which forces you to think about how your knowledge connects.&lt;/p&gt;
&lt;p&gt;Example structure for a Networking MOC:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;markdown&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;up&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;[[Home]]&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;tags&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;MOC&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  - &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;atlas/networking&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#22863A;--shiki-dark:#85E89D&quot;&gt;created&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;2026-01-15&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold&quot;&gt;# Networking&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold&quot;&gt;## Fundamentals&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[DNS Deep Dive]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[DHCP Architecture]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[Subnetting Reference]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold&quot;&gt;## Protocols&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[802.1X Authentication]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[WPA3 Hardening]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[BGP Basics]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold&quot;&gt;## Lab&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[VLAN Design]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[Homelab Network Topology]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[VPN Comparison]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-light-font-weight:bold;--shiki-dark:#79B8FF;--shiki-dark-font-weight:bold&quot;&gt;## Guides&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[Firewall Rule Methodology]]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [[Packet Capture Workflow]]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When you create a new networking note, you add it to this MOC. When you need to find something about networking, you start here. The MOC is your table of contents for that domain.&lt;/p&gt;
&lt;p&gt;Aim for one MOC per major knowledge area. Six to twelve MOCs is the sweet spot for most people. More than twenty and you are over-indexing.&lt;/p&gt;
&lt;h2 id=&quot;the-graph-view&quot;&gt;The Graph View&lt;/h2&gt;
&lt;p&gt;Obsidian’s graph view visualizes every note and link in your vault as a network diagram. It looks impressive in screenshots. Its real value is diagnostic.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://bytesnation.com/blog/obsidian-graph.png&quot; alt=&quot;Obsidian graph view showing 700+ connected notes with color-coded clusters by domain&quot;&gt;&lt;/p&gt;
&lt;p&gt;Use the graph to find:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Orphan notes.&lt;/strong&gt; Notes with no links in or out. These need to be filed and connected, or deleted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Clusters.&lt;/strong&gt; Dense clusters indicate well-developed knowledge areas. Sparse areas are gaps.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bridge notes.&lt;/strong&gt; Notes that connect two otherwise separate clusters. These are often your most valuable notes because they represent cross-domain insights.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Color-code your graph groups by domain (knowledge, efforts, calendar, personal) so you can visually scan the balance of your vault at a glance.&lt;/p&gt;
&lt;h2 id=&quot;the-weekly-review&quot;&gt;The Weekly Review&lt;/h2&gt;
&lt;p&gt;Once a week, step back from the daily notes and review at a higher altitude.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Last week:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Did you hit your North Star Metrics?&lt;/li&gt;
&lt;li&gt;What worked? What broke down?&lt;/li&gt;
&lt;li&gt;What patterns need to die?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;This week:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Two objectives per active project. No more.&lt;/li&gt;
&lt;li&gt;Project health check: Red, Yellow, Green for each effort.&lt;/li&gt;
&lt;li&gt;Blockers identified and escalation planned.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Environment audit:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Is your workspace set up for deep work?&lt;/li&gt;
&lt;li&gt;Are your calendar blocks protecting focus time?&lt;/li&gt;
&lt;li&gt;What are you avoiding?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The weekly review takes 30 to 45 minutes. It prevents drift. Without it, you will slowly stop using the daily notes, the task board goes stale, and the vault becomes a graveyard of good intentions.&lt;/p&gt;
&lt;h2 id=&quot;scaling-the-vault&quot;&gt;Scaling the Vault&lt;/h2&gt;
&lt;p&gt;A vault with 50 notes works no matter how you organize it. A vault with 500 notes exposes every structural weakness. A vault with 5,000 notes either runs like a machine or collapses under its own weight.&lt;/p&gt;
&lt;p&gt;Rules for scale:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Frontmatter on everything.&lt;/strong&gt; No exceptions. Notes without metadata are invisible to Dataview and useless for automation.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;File before you forget.&lt;/strong&gt; Process your inbox daily. A note left in the inbox for a week is a note that will never be filed.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Link aggressively.&lt;/strong&gt; Every note should link to at least one MOC and one related note. Isolated notes are wasted notes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Prune regularly.&lt;/strong&gt; Delete notes that add no value. Merge duplicates. Update stale content. A lean vault is a fast vault.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Templates for everything repeatable.&lt;/strong&gt; Daily notes, meeting notes, project kickoffs, task breakdowns. If you create the same structure more than twice, it needs a template. Store them in a dedicated folder (mine lives at &lt;code&gt;Extras/Templates/&lt;/code&gt;) and use the Templater plugin to auto-populate dates, navigation links, and Dataview queries on creation.&lt;/p&gt;
&lt;h2 id=&quot;the-llm-wiki-letting-ai-maintain-your-vault&quot;&gt;The LLM Wiki: Letting AI Maintain Your Vault&lt;/h2&gt;
&lt;p&gt;Everything above is manual. You build the structure, you file the notes, you maintain the MOCs, you process the inbox. It works. It also creates a maintenance burden that grows with every note you add. Cross-references go stale. Summaries fall behind. Connections get missed because you forgot what you wrote six months ago.&lt;/p&gt;
&lt;p&gt;This is the problem &lt;a href=&quot;https://karpathy.ai/&quot;&gt;Andrej Karpathy&lt;/a&gt; addressed in his &lt;a href=&quot;https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f&quot;&gt;LLM Wiki&lt;/a&gt; pattern: a framework where LLMs incrementally build and maintain a persistent, interlinked wiki on top of your raw sources. Instead of retrieving from documents on every query (the standard RAG approach), the LLM compiles knowledge once and keeps it current. Cross-references are already there. Contradictions are already flagged. The synthesis reflects everything in the vault.&lt;/p&gt;
&lt;p&gt;As Karpathy puts it: “The tedious part of maintaining a knowledge base is not the reading or the thinking; it is the bookkeeping.” LLMs handle that bookkeeping at near-zero cost.&lt;/p&gt;
&lt;p&gt;I integrated this pattern directly into my Obsidian vault. Here is how it works alongside the ACE framework.&lt;/p&gt;
&lt;h3 id=&quot;the-three-layer-architecture&quot;&gt;The Three-Layer Architecture&lt;/h3&gt;
&lt;div style=&quot;position: relative; margin: 1.5em 0;&quot;&gt;
&lt;iframe src=&quot;https://link.excalidraw.com/readonly/R9AqZJ6h85zJvYRZ6kPH?darkMode=true&quot; width=&quot;100%&quot; height=&quot;600&quot; style=&quot;border: none; border-radius: 12px;&quot;&gt;&lt;/iframe&gt;
&lt;a href=&quot;https://link.excalidraw.com/readonly/R9AqZJ6h85zJvYRZ6kPH?darkMode=true&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot; style=&quot;display: inline-block; margin-top: 8px; font-size: 0.875rem; color: var(--accent-2);&quot;&gt;Open diagram in new tab for full zoom controls&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Karpathy’s pattern defines three layers that map cleanly onto what already exists in the vault:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Raw sources.&lt;/strong&gt; Your curated collection of source documents: articles, papers, transcripts, data files. These are immutable. The LLM reads from them but never modifies them. In the ACE framework, these live in &lt;code&gt;Atlas/Sources/&lt;/code&gt; and &lt;code&gt;+Encounters/&lt;/code&gt; (the inbox).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The wiki.&lt;/strong&gt; LLM-generated markdown files: summaries, entity pages, concept pages, comparisons, synthesis documents. The LLM owns this layer. It creates pages, updates them when new sources arrive, maintains cross-references, and keeps everything consistent. In my vault, these pages land in &lt;code&gt;Atlas/Notes/&lt;/code&gt; organized by topic, with proper frontmatter and MOC links.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The schema.&lt;/strong&gt; A configuration document that tells the LLM how the wiki is structured, what conventions to follow, and what workflows to execute. If you are using Claude Code, this is your &lt;code&gt;CLAUDE.md&lt;/code&gt;. For OpenAI Codex, it is &lt;code&gt;AGENTS.md&lt;/code&gt;. The schema describes your folder structure, frontmatter conventions, routing rules, and operational workflows in the format that agent expects. This is the difference between a disciplined wiki maintainer and a generic chatbot. You and the LLM co-evolve it over time.&lt;/p&gt;
&lt;h3 id=&quot;the-core-operations&quot;&gt;The Core Operations&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Ingest.&lt;/strong&gt; Drop a new source into the raw collection and tell the LLM to process it. The LLM reads the source, writes a summary page, updates the index, updates relevant entity and concept pages across the wiki, and appends an entry to the log. A single source can touch 10 to 15 wiki pages. I prefer to ingest one source at a time and stay involved, checking summaries and guiding emphasis. Batch ingestion with less supervision is also viable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Query.&lt;/strong&gt; Ask questions against the wiki. The LLM searches relevant pages, reads them, and synthesizes an answer with citations. The critical insight from Karpathy: good answers should be filed back into the wiki as new pages. A comparison you asked for, an analysis, a connection you discovered. These compound in the knowledge base instead of disappearing into chat history.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Lint.&lt;/strong&gt; Periodically, the LLM health-checks the wiki. It looks for contradictions between pages, stale claims superseded by newer sources, orphan pages with no inbound links, important concepts that lack their own page, and missing cross-references. It also suggests new questions to investigate and new sources to seek out.&lt;/p&gt;
&lt;h3 id=&quot;how-this-integrates-with-ace&quot;&gt;How This Integrates With ACE&lt;/h3&gt;
&lt;p&gt;The LLM Wiki pattern does not replace the ACE framework. It automates the parts of ACE that humans abandon. The bridge between the two is the ingest operation.&lt;/p&gt;
&lt;h4 id=&quot;the-ingest-skill&quot;&gt;The Ingest Skill&lt;/h4&gt;
&lt;p&gt;This is the workhorse. You point the LLM at a source (a file in your inbox, a URL, pasted text, a meeting transcript) and tell it to ingest. The LLM executes a defined sequence:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Analyze.&lt;/strong&gt; Read the source. Extract the title, key concepts, source type (article, meeting, video, book, transcript, note), any actionable items, and which knowledge domains it touches.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Route.&lt;/strong&gt; Determine where the note belongs in the ACE structure. Meeting with attendees and a date goes to &lt;code&gt;Calendar/Meeting Notes/&lt;/code&gt;. Technical knowledge matching an existing MOC topic goes to &lt;code&gt;Atlas/Notes/&amp;#x3C;Topic&gt;/&lt;/code&gt;. External reference material goes to &lt;code&gt;Atlas/Sources/&lt;/code&gt;. Project-specific content goes to &lt;code&gt;Efforts/Active/&amp;#x3C;Project&gt;/&lt;/code&gt;. The routing rules are defined in the schema file, not hardcoded. Change the rules, change the behavior.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Build frontmatter.&lt;/strong&gt; Construct the YAML metadata: &lt;code&gt;up:&lt;/code&gt; link to the parent MOC, hierarchical tags, creation date, source type, source URL or file path, and an ingested date. Every note gets the full metadata layer from the moment it is created. No cleanup pass needed later.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. Write and link.&lt;/strong&gt; Create the note with organized content sections, wikilinks to related existing notes (found by searching the vault), and an Action Items section if tasks were extracted. Tasks get formatted with project context tags and due dates where applicable.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. Update the MOC.&lt;/strong&gt; Read the parent MOC and add a wikilink to the new note in the appropriate section. This is the step humans skip. The LLM does not skip it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;6. Log the ingest.&lt;/strong&gt; Append an entry to today’s daily note under the Ingest Log section: timestamp, what was ingested, where it was filed, which MOC was updated. This creates a chronological record of everything that entered the vault and where it went.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;7. Mark the source.&lt;/strong&gt; If the source came from the inbox (&lt;code&gt;+Encounters/&lt;/code&gt;), the LLM marks it as processed in its frontmatter. The original is never deleted. You always have the raw source to reference.&lt;/p&gt;
&lt;h4 id=&quot;duplicate-detection-and-edge-cases&quot;&gt;Duplicate Detection and Edge Cases&lt;/h4&gt;
&lt;p&gt;Before creating a note, the LLM searches the vault for existing notes with the same or similar title. If a match is found, it asks whether to merge, rename, or skip. For large sources (over 2,000 words), it creates a summary with key takeaways instead of a verbatim copy, linking back to the original. If the content spans multiple projects, it files under the primary and cross-links to the secondary. If the content does not fit any existing MOC, it suggests creating a new one.&lt;/p&gt;
&lt;h4 id=&quot;what-this-means-for-inbox-processing&quot;&gt;What This Means for Inbox Processing&lt;/h4&gt;
&lt;p&gt;The inbox (&lt;code&gt;+Encounters/&lt;/code&gt;) is where raw captures land. Without the ingest skill, you process them manually: read the note, decide where it goes, move it, add frontmatter, link it to a MOC, update the MOC. That is five steps per note. Fall behind for a week and you have 20 unfiled notes. Fall behind for a month and the inbox is a graveyard.&lt;/p&gt;
&lt;p&gt;With the ingest skill, you point the LLM at an inbox item and it handles all five steps. One command per note. Batch through the whole inbox in minutes instead of an hour.&lt;/p&gt;
&lt;h4 id=&quot;moc-maintenance&quot;&gt;MOC Maintenance&lt;/h4&gt;
&lt;p&gt;The ingest skill handles this as a side effect. Every time the LLM creates or updates a note, it also updates the corresponding MOC. No more stale navigation hubs. No more orphan notes sitting outside the link graph because you forgot to add them to the index.&lt;/p&gt;
&lt;h4 id=&quot;meeting-note-processing&quot;&gt;Meeting Note Processing&lt;/h4&gt;
&lt;p&gt;Meeting transcripts get ingested through the same pipeline. The LLM creates structured meeting notes with attendees, key decisions, discussion sections organized by topic, and action items. The note gets filed into the correct project folder, linked to the parent MOC, and cross-referenced against related vault content. If you are already using the EOD shutdown skill described earlier, meeting ingestion happens automatically at the end of each day.&lt;/p&gt;
&lt;h4 id=&quot;two-index-files&quot;&gt;Two Index Files&lt;/h4&gt;
&lt;p&gt;Karpathy recommends &lt;code&gt;index.md&lt;/code&gt; (a content-oriented catalog of every wiki page with one-line summaries) and &lt;code&gt;log.md&lt;/code&gt; (an append-only chronological record of ingests, queries, and lint passes). The index replaces embedding-based search at moderate scale. The log gives you a timeline of the wiki’s evolution. In the ACE vault, the daily note’s Ingest Log serves the same purpose as &lt;code&gt;log.md&lt;/code&gt;, and the MOCs collectively serve as the index.&lt;/p&gt;
&lt;h3 id=&quot;the-workflow-in-practice&quot;&gt;The Workflow in Practice&lt;/h3&gt;
&lt;p&gt;Karpathy describes the working arrangement: “I have the LLM agent open on one side and Obsidian open on the other. The LLM makes edits based on our conversation, and I browse the results in real time, following links, checking the graph view, reading the updated pages. Obsidian is the IDE; the LLM is the programmer; the wiki is the codebase.”&lt;/p&gt;
&lt;p&gt;That is exactly how I run it. Claude Code (or any LLM agent with filesystem access) operates on the vault files. Obsidian renders them in real time with graph view, backlinks, and Dataview queries. The human curates sources, directs analysis, and asks the right questions. The LLM does the filing, cross-referencing, and bookkeeping.&lt;/p&gt;
&lt;h3 id=&quot;scaling-with-llm-maintenance&quot;&gt;Scaling With LLM Maintenance&lt;/h3&gt;
&lt;p&gt;This changes the scaling equation entirely. The manual rules from the previous section still apply: frontmatter on everything, link aggressively, prune regularly. But the LLM handles the bulk of that work. A vault with 5,000 notes is no longer a maintenance nightmare when the LLM can touch 15 files in one pass without getting bored, forgetting a cross-reference, or losing context.&lt;/p&gt;
&lt;p&gt;The idea traces back to Vannevar Bush’s &lt;a href=&quot;https://en.wikipedia.org/wiki/Memex&quot;&gt;Memex&lt;/a&gt; (1945): a personal, curated knowledge store with associative trails between documents. Bush’s vision was closer to this than to what the web became. Private, actively curated, with the connections between documents as valuable as the documents themselves. The part he could not solve was who does the maintenance. The LLM handles that.&lt;/p&gt;
&lt;h2 id=&quot;the-bottom-line&quot;&gt;The Bottom Line&lt;/h2&gt;
&lt;p&gt;Obsidian is not a note-taking app. It is a knowledge operating system. The ACE framework gives it structure. The daily rhythm gives it input. The LLM Wiki pattern gives it a maintenance engine that scales.&lt;/p&gt;
&lt;p&gt;Build the ACE framework. Set up your frontmatter standard. Create your MOCs. Use your daily note every single day. Review weekly. Prune monthly. Then hand the bookkeeping to an LLM and focus on what humans are actually good at: sourcing, exploring, and thinking.&lt;/p&gt;
&lt;p&gt;The vault is not the goal. The goal is to think more clearly, decide more quickly, and never lose track of what matters.&lt;/p&gt;
&lt;p&gt;The vault is just the infrastructure that makes that possible.&lt;/p&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/obsidian-icon.png" length="0" type="image/png"/></item><item><title>Building a Proxmox Cluster on Beelink Mini PCs</title><link>https://bytesnation.com/blog/proxmox-cluster-beelink-mini-pcs/</link><guid isPermaLink="true">https://bytesnation.com/blog/proxmox-cluster-beelink-mini-pcs/</guid><description>Rack servers are loud, hot, and expensive. Two Beelink mini PCs running Proxmox VE give you a proper virtualization cluster for a fraction of the cost. Here is the full build.</description><pubDate>Thu, 09 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;rack-servers-are-overrated&quot;&gt;Rack Servers Are Overrated&lt;/h2&gt;
&lt;p&gt;Here is the pitch most homelab content gives you: buy a decommissioned Dell R720, shove it in a closet, and pretend you are running a datacenter. Then your power bill spikes, your spouse hears a jet engine at 2am, and you realize you are cooling a server that idles at 200W to run three containers.&lt;/p&gt;
&lt;p&gt;Stop that.&lt;/p&gt;
&lt;p&gt;Mini PCs changed the game. Low power draw, dead silent, and enough compute for everything short of heavy GPU workloads. Two Beelink nodes running Proxmox VE give you a real cluster with HA, live migration, and room to grow.&lt;/p&gt;
&lt;h2 id=&quot;the-hardware&quot;&gt;The Hardware&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;&lt;a href=&quot;https://www.amazon.com/dp/B0CRKXMKDT?tag=bytesnation-20&quot;&gt;Beelink SER5 MAX (AMD Ryzen 7 5800H)&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;









































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Spec&lt;/th&gt;&lt;th&gt;Value&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;CPU&lt;/td&gt;&lt;td&gt;AMD Ryzen 7 5800H, 8C/16T, up to 4.4 GHz&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;TDP&lt;/td&gt;&lt;td&gt;54W (upgraded from the standard 45W 5800H config)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;RAM&lt;/td&gt;&lt;td&gt;32 GB DDR4&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Storage&lt;/td&gt;&lt;td&gt;1 TB NVMe M.2 2280 SSD&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Networking&lt;/td&gt;&lt;td&gt;WiFi 6, Gigabit Ethernet&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Bluetooth&lt;/td&gt;&lt;td&gt;BT 5.2&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Display&lt;/td&gt;&lt;td&gt;4K triple output (HDMI + DP + USB-C)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Form Factor&lt;/td&gt;&lt;td&gt;Desktop mini PC, roughly 5” x 5”&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Two of these. That is your cluster. 64 GB total RAM, 16 cores / 32 threads, 2 TB NVMe. Quiet enough to sit on your desk.&lt;/p&gt;
&lt;p&gt;Total hardware cost: under &lt;a href=&quot;https://www.amazon.com/dp/B0CRKXMKDT?tag=bytesnation-20&quot;&gt;$700 for both units&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Compare that to a used R720 at $300+ that pulls 150W idle and sounds like a leaf blower. The math is not close.&lt;/p&gt;
&lt;h2 id=&quot;why-proxmox-ve&quot;&gt;Why Proxmox VE&lt;/h2&gt;
&lt;p&gt;Proxmox is a Type 1 &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-hypervisor&quot;&gt;hypervisor&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-hypervisor&quot;&gt;Software that creates and manages virtual machines by abstracting physical hardware resources and allocating them to isolated guest operating systems. &lt;a href=&quot;https://bytesnation.com/dictionary/hypervisor/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; built on Debian. &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-kvm&quot;&gt;KVM&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-kvm&quot;&gt;A Linux kernel module that turns the Linux operating system itself into a Type 1 hypervisor, enabling hardware-accelerated virtual machines. &lt;a href=&quot;https://bytesnation.com/dictionary/kvm/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; for full VMs, LXC for lightweight containers, and a web UI that does not make you want to throw your keyboard. Free tier is production-ready. No license keys, no feature gates.&lt;/p&gt;
&lt;p&gt;What matters for this build:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Native clustering with two or more nodes&lt;/li&gt;
&lt;li&gt;Live migration between nodes&lt;/li&gt;
&lt;li&gt;&lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-zfs&quot;&gt;ZFS&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-zfs&quot;&gt;A combined filesystem and volume manager that provides built-in data integrity verification, snapshots, compression, and RAID-like redundancy. &lt;a href=&quot;https://bytesnation.com/dictionary/zfs/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; support for snapshots and replication&lt;/li&gt;
&lt;li&gt;Web management on &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-port&quot;&gt;port&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-port&quot;&gt;A numbered endpoint on a device that identifies a specific application or service, allowing multiple network services to run on the same IP address. &lt;a href=&quot;https://bytesnation.com/dictionary/port/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; 8006&lt;/li&gt;
&lt;li&gt;LXC containers that boot in seconds and use minimal overhead&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you have used ESXi, Proxmox is the same weight class without the licensing headache. VMware killed their free tier. Proxmox never had one to kill because the whole thing is free.&lt;/p&gt;
&lt;h2 id=&quot;cluster-architecture&quot;&gt;Cluster Architecture&lt;/h2&gt;
&lt;p&gt;Two Proxmox nodes on a dedicated management &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-vlan&quot;&gt;VLAN&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-vlan&quot;&gt;A virtual local area network that segments a single physical switch into multiple isolated broadcast domains without needing separate hardware. &lt;a href=&quot;https://bytesnation.com/dictionary/vlan/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;. Nothing else lives on this segment.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;PVE-01: 10.10.10.10  |  pve01.bytesnation.com:8006&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;PVE-02: 10.10.10.20  |  pve02.bytesnation.com:8006&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Both nodes joined into a single Proxmox cluster. Corosync handles quorum and inter-node communication. With two nodes, quorum is the critical design decision.&lt;/p&gt;
&lt;h3 id=&quot;the-two-node-quorum-problem&quot;&gt;The Two-Node Quorum Problem&lt;/h3&gt;
&lt;p&gt;In a standard three-node cluster, losing one node still leaves two votes. Quorum holds. With two nodes, losing one means the survivor has one vote out of two. That is not a majority. The cluster goes read-only. HA stops. VMs will not start.&lt;/p&gt;
&lt;p&gt;Three options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;QDevice (recommended).&lt;/strong&gt; A lightweight Corosync daemon running on a third machine (a Raspberry Pi, a NAS, an LXC &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-container&quot;&gt;container&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-container&quot;&gt;A lightweight, portable package that bundles an application with its dependencies and runs in an isolated process on the host OS, sharing the kernel. &lt;a href=&quot;https://bytesnation.com/dictionary/container/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; on a different host). It acts as a tie-breaking voter. It does not run VMs or store data. It just votes. The QDevice must be physically separate from both nodes and reachable by both. If you put it on one of the nodes, you have solved nothing.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Manual quorum override.&lt;/strong&gt; Set &lt;code&gt;expected_votes&lt;/code&gt; to 1 on the surviving node during an outage. This works but requires &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-ssh&quot;&gt;SSH&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-ssh&quot;&gt;A cryptographic protocol for secure remote login, command execution, and file transfer over an unsecured network. &lt;a href=&quot;https://bytesnation.com/dictionary/ssh/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; access and manual intervention. Not ideal at 2am.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Accept the limitation.&lt;/strong&gt; If HA is not critical and you are fine manually starting VMs after a node failure, skip the complexity.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For a homelab that runs real services, option 1 is the right call. A Raspberry Pi running the QDevice daemon costs $35 and eliminates the split-brain risk entirely.&lt;/p&gt;
&lt;h2 id=&quot;network-segmentation&quot;&gt;Network Segmentation&lt;/h2&gt;
&lt;p&gt;This is not a flat network. Every workload type gets its own VLAN with &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-firewall&quot;&gt;firewall&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-firewall&quot;&gt;A security device or software that monitors and controls incoming and outgoing network traffic based on predefined rules. &lt;a href=&quot;https://bytesnation.com/dictionary/firewall/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; rules controlling east-west traffic.&lt;/p&gt;





















































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;VLAN&lt;/th&gt;&lt;th&gt;ID&lt;/th&gt;&lt;th&gt;Subnet&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Management&lt;/td&gt;&lt;td&gt;10&lt;/td&gt;&lt;td&gt;10.10.10.0/24&lt;/td&gt;&lt;td&gt;Proxmox nodes, infrastructure management&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Security Ops&lt;/td&gt;&lt;td&gt;20&lt;/td&gt;&lt;td&gt;10.10.20.0/24&lt;/td&gt;&lt;td&gt;Wazuh, security tooling&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Workstations&lt;/td&gt;&lt;td&gt;30&lt;/td&gt;&lt;td&gt;192.168.30.0/24&lt;/td&gt;&lt;td&gt;User machines&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;IoT&lt;/td&gt;&lt;td&gt;40&lt;/td&gt;&lt;td&gt;172.16.40.0/24&lt;/td&gt;&lt;td&gt;IoT devices, fully isolated&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Cameras&lt;/td&gt;&lt;td&gt;50&lt;/td&gt;&lt;td&gt;192.168.50.0/24&lt;/td&gt;&lt;td&gt;Surveillance, no internet egress&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;DMZ&lt;/td&gt;&lt;td&gt;66&lt;/td&gt;&lt;td&gt;192.168.66.0/24&lt;/td&gt;&lt;td&gt;Public-facing services&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Lab&lt;/td&gt;&lt;td&gt;99&lt;/td&gt;&lt;td&gt;192.168.99.0/24&lt;/td&gt;&lt;td&gt;Hands-on testing and breakable things&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Core routing handled by a UniFi Dream Machine Pro. Inter-VLAN firewall rules enforce least privilege. The Proxmox management interface is only accessible from VLAN 10. Nothing else touches it.&lt;/p&gt;
&lt;p&gt;If you are running a homelab on a flat network with everything on the default VLAN: fix that before you do anything else. Segmentation is not optional. It is baseline hygiene.&lt;/p&gt;
&lt;h2 id=&quot;installation&quot;&gt;Installation&lt;/h2&gt;
&lt;p&gt;Download the Proxmox VE ISO. Flash it to USB with Balena Etcher or Ventoy. Boot from USB. Follow the installer. Set a static IP on the management VLAN.&lt;/p&gt;
&lt;p&gt;Post-install on each node:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;apt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; update&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; &amp;#x26;&amp;#x26; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;apt&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; full-upgrade&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -y&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then hit the web UI at &lt;code&gt;https://&amp;#x3C;node-ip&gt;:8006&lt;/code&gt;. Create the cluster on PVE-01:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;pvecm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; create&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; bytesnation-cluster&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Join PVE-02:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;pvecm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; add&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 10.10.10.10&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Verify:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;pvecm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; status&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You should see two nodes, two votes, quorum achieved. The whole process takes about 20 minutes per node.&lt;/p&gt;
&lt;p&gt;Proxmox community helper scripts can automate post-install housekeeping: removing the enterprise repo nag, enabling the no-subscription repo, disabling the subscription notice. Worth running on a fresh install.&lt;/p&gt;
&lt;h2 id=&quot;storage-strategy&quot;&gt;Storage Strategy&lt;/h2&gt;
&lt;p&gt;Each node has 1 TB NVMe local storage. For this cluster size, local ZFS is the right call.&lt;/p&gt;
&lt;p&gt;ZFS gives you:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Copy-on-write snapshots (instant, zero-cost)&lt;/li&gt;
&lt;li&gt;Built-in compression (LZ4 default, roughly 1.5x space savings on &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-virtual-machine&quot;&gt;VM&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-virtual-machine&quot;&gt;A software-based emulation of a complete computer that runs its own operating system and applications, isolated from the host hardware. &lt;a href=&quot;https://bytesnation.com/dictionary/virtual-machine/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; disks)&lt;/li&gt;
&lt;li&gt;Data integrity checksums on every block&lt;/li&gt;
&lt;li&gt;Replication between nodes for disaster recovery&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;One thing to know: ZFS is memory-hungry. The general guidance is 1 GB of ARC cache per 1 TB of storage. With 32 GB per node and 1 TB drives, you have plenty of headroom. But if you expand storage later, account for it or you will watch your VMs swap.&lt;/p&gt;
&lt;p&gt;For bulk storage (media, backups, ISOs), a separate TrueNAS box handles that over NFS or SMB. The Proxmox nodes stay compute-focused.&lt;/p&gt;
&lt;p&gt;Backup strategy follows 3-2-1: three copies, two different media types, one off-site. Proxmox Backup Server integrates natively and handles incremental, deduplicated backups. For off-site, Restic or Duplicati push encrypted snapshots to cloud storage.&lt;/p&gt;
&lt;h2 id=&quot;what-runs-on-the-cluster&quot;&gt;What Runs on the Cluster&lt;/h2&gt;
&lt;p&gt;The cluster is not a science project. It runs real workloads.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Full VMs (KVM):&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Wazuh: XDR and SIEM for threat detection across the entire network&lt;/li&gt;
&lt;li&gt;GitLab: self-hosted source control and CI runners&lt;/li&gt;
&lt;li&gt;Fedora workstations: testing and development&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;LXC Containers:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Nginx Proxy Manager: reverse proxy with automatic Let’s Encrypt SSL&lt;/li&gt;
&lt;li&gt;Docker host: runs lightweight containerized services&lt;/li&gt;
&lt;li&gt;K3s: single-node Kubernetes for orchestration experiments&lt;/li&gt;
&lt;li&gt;Dev/test environments that get rebuilt constantly&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;LXC containers are the force multiplier here. They boot in under a second, share the host kernel, and use a fraction of the resources a full VM needs. For anything that does not require a custom kernel or Windows, LXC is the move. A container running Nginx Proxy Manager uses about 128 MB of RAM. The equivalent VM would burn 512 MB minimum just on the OS.&lt;/p&gt;
&lt;h2 id=&quot;power-and-thermals&quot;&gt;Power and Thermals&lt;/h2&gt;
&lt;p&gt;Two Beelink SER5 MAX nodes under moderate load pull roughly 70 to 100W combined. The 54W TDP is per-node max, but sustained homelab workloads rarely pin the CPU. Real-world draw sits closer to 25 to 35W per node.&lt;/p&gt;
&lt;p&gt;Compare that to a single rack server idling at 150 to 200W doing nothing.&lt;/p&gt;
&lt;p&gt;No fans screaming. No dedicated cooling. No heat buildup in a closet. These sit on a shelf and do their job.&lt;/p&gt;
&lt;p&gt;At $0.12/kWh, two Beelink nodes cost roughly $8 to $10 per month in electricity. A rack server idles at $15 to $20. Over a year, the savings cover a meaningful chunk of the hardware cost.&lt;/p&gt;
&lt;h2 id=&quot;lessons-learned&quot;&gt;Lessons Learned&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Start with VLANs.&lt;/strong&gt; Retrofitting network segmentation after you have 20 services running is painful. Design your VLAN scheme before you deploy the first VM.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Plan quorum before you need it.&lt;/strong&gt; A two-node cluster without a QDevice will bite you during the one outage you did not plan for. Spend the $35 on a Pi and set it up on day one.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LXC over VMs when possible.&lt;/strong&gt; Every full VM you replace with an LXC container frees up RAM and CPU for workloads that actually need isolation. Most services do not.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ZFS replication is your safety net.&lt;/strong&gt; Schedule replication jobs between nodes. If a drive fails, you have a recent copy on the other node ready to promote. This is not backup. This is continuity.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Document everything.&lt;/strong&gt; Your future self at 2am troubleshooting a VLAN firewall rule will thank you. If it is not written down, it does not exist.&lt;/p&gt;
&lt;h2 id=&quot;bottom-line&quot;&gt;Bottom Line&lt;/h2&gt;
&lt;p&gt;You do not need enterprise hardware to run enterprise workloads at home. Two Beelink mini PCs, Proxmox VE, and deliberate network design give you a cluster that is silent, efficient, and capable of running security monitoring, source control, reverse proxies, and Kubernetes.&lt;/p&gt;
&lt;p&gt;Total investment: under &lt;a href=&quot;https://www.amazon.com/dp/B0CRKXMKDT?tag=bytesnation-20&quot;&gt;$700 in hardware&lt;/a&gt; and zero in software licensing.&lt;/p&gt;
&lt;p&gt;Stop overbuilding. Start operating.&lt;/p&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/proxmox-cluster-header.png" length="0" type="image/png"/></item><item><title>Claude Code Hooks: The Field Manual You Actually Need</title><link>https://bytesnation.com/blog/claude-code-hooks-comprehensive-guide/</link><guid isPermaLink="true">https://bytesnation.com/blog/claude-code-hooks-comprehensive-guide/</guid><description>A no-BS field manual for Claude Code hooks. What they are, when to use them, how to configure them, and practical cases that actually matter. Written for engineers who build, not tourists who browse.</description><pubDate>Wed, 08 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;stop-letting-claude-run-unsupervised&quot;&gt;Stop Letting Claude Run Unsupervised&lt;/h2&gt;
&lt;p&gt;Here is the problem. You hand Claude Code a task, it starts executing tools, and you are sitting there babysitting every permission prompt like a hall monitor. Or worse, you turn on auto-accept and pray nothing catches fire.&lt;/p&gt;
&lt;p&gt;Hooks fix this. They are shell commands, HTTP calls, or AI prompts that fire at specific points in Claude’s execution lifecycle. Think of them as tripwires and gate checks you plant across the workflow. Claude hits a trigger point, your hook runs, and you decide what happens next: allow, deny, modify, log, or block.&lt;/p&gt;
&lt;p&gt;No plugins. No extensions. Just config and scripts.&lt;/p&gt;
&lt;h2 id=&quot;what-hooks-actually-are&quot;&gt;What Hooks Actually Are&lt;/h2&gt;
&lt;p&gt;A hook is a user-defined action that executes when Claude Code hits a specific event during a session. You are not modifying Claude’s behavior. You are inserting control points around it.&lt;/p&gt;
&lt;p&gt;The mental model: hooks are middleware for your AI coding assistant. Same concept as &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-git&quot;&gt;Git&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-git&quot;&gt;A distributed version control system that tracks changes to files over time, enabling collaboration, branching, and complete history of every modification. &lt;a href=&quot;https://bytesnation.com/dictionary/git/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; hooks, CI pipeline stages, or request interceptors. An event fires, your code runs, and the output determines what happens next.&lt;/p&gt;
&lt;p&gt;Hooks can be:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Command hooks&lt;/strong&gt;: Shell scripts or CLI commands that run locally&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;HTTP hooks&lt;/strong&gt;: Outbound requests to a local or remote endpoint&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prompt hooks&lt;/strong&gt;: An AI prompt that gets evaluated inline&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Agent hooks&lt;/strong&gt;: A sub-agent that spins up to handle the check&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Most of the time, you are writing command hooks. Shell scripts. The thing you already know how to do.&lt;/p&gt;
&lt;h2 id=&quot;where-hooks-live&quot;&gt;Where Hooks Live&lt;/h2&gt;
&lt;p&gt;Configuration goes in &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-json&quot;&gt;JSON&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-json&quot;&gt;A lightweight, human-readable data format used to exchange structured information between systems, based on JavaScript object syntax. &lt;a href=&quot;https://bytesnation.com/dictionary/json/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; files. Three scopes, hierarchical precedence:&lt;/p&gt;

























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;File&lt;/th&gt;&lt;th&gt;Scope&lt;/th&gt;&lt;th&gt;Shared&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;~/.claude/settings.json&lt;/code&gt;&lt;/td&gt;&lt;td&gt;All projects on this machine&lt;/td&gt;&lt;td&gt;No&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;.claude/settings.json&lt;/code&gt;&lt;/td&gt;&lt;td&gt;This project, all contributors&lt;/td&gt;&lt;td&gt;Yes, commit it&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;.claude/settings.local.json&lt;/code&gt;&lt;/td&gt;&lt;td&gt;This project, only you&lt;/td&gt;&lt;td&gt;No, gitignore it&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;Higher specificity wins. Local overrides project. Project overrides user. Simple chain of command.&lt;/p&gt;
&lt;p&gt;The structure inside any of these files:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;EventName&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;ToolNameOrPattern&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;/path/to/your/script.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;30&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That is the skeleton. Every hook config follows this pattern. Event name as the key, array of matcher objects, each matcher containing an array of hook definitions.&lt;/p&gt;
&lt;h2 id=&quot;the-event-catalog&quot;&gt;The Event Catalog&lt;/h2&gt;
&lt;p&gt;Claude Code fires events at every meaningful lifecycle point. Here are the ones that matter for day-to-day operations, grouped by when you would actually care about them.&lt;/p&gt;
&lt;h3 id=&quot;session-lifecycle&quot;&gt;Session Lifecycle&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;SessionStart&lt;/strong&gt;: Fires when a session begins or resumes. Use this to load environment variables, set up tooling context, or initialize project-specific state. Your script gets access to &lt;code&gt;CLAUDE_ENV_FILE&lt;/code&gt;; write exports to that file and they persist for the entire session.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SessionEnd&lt;/strong&gt;: Session terminates. Cleanup, logging, metrics collection.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CwdChanged&lt;/strong&gt;: Working directory changes mid-session. Reload environment configs, update path-dependent state.&lt;/p&gt;
&lt;h3 id=&quot;before-a-tool-runs&quot;&gt;Before a Tool Runs&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;PreToolUse&lt;/strong&gt;: The big one. Fires before any tool executes. You can inspect what Claude is about to do and return a decision:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;allow&lt;/code&gt;: Let it through, skip the permission prompt&lt;/li&gt;
&lt;li&gt;&lt;code&gt;deny&lt;/code&gt;: Kill it. Tool does not execute. Claude gets your reason.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ask&lt;/code&gt;: Force the permission prompt regardless of mode&lt;/li&gt;
&lt;li&gt;&lt;code&gt;defer&lt;/code&gt;: Pause execution for external approval (CI, Slack, whatever)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also return &lt;code&gt;updatedInput&lt;/code&gt; to modify the tool’s parameters before execution. Rewrite a command, change a file path, sanitize an argument. Claude never knows you touched it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PermissionRequest&lt;/strong&gt;: Fires when the permission dialog would appear. Same decision options. This is your programmatic “approve all” or “deny all” gate.&lt;/p&gt;
&lt;h3 id=&quot;after-a-tool-runs&quot;&gt;After a Tool Runs&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;PostToolUse&lt;/strong&gt;: Tool succeeded. Inspect the output, run validation, trigger linters, log the action, or inject feedback that Claude will see in its context.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;PostToolUseFailure&lt;/strong&gt;: Tool failed. Provide corrective context so Claude adjusts its approach instead of blindly retrying.&lt;/p&gt;
&lt;h3 id=&quot;response-lifecycle&quot;&gt;Response Lifecycle&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Stop&lt;/strong&gt;: Claude finished its response. You can block the completion and force it to continue, or inject a system message. Useful for enforcing output standards.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;SubagentStop&lt;/strong&gt;: A sub-agent finished. Same controls as Stop but scoped to delegated work.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UserPromptSubmit&lt;/strong&gt;: Fires before Claude processes what you typed. Add context, validate input, or block the prompt entirely.&lt;/p&gt;
&lt;h3 id=&quot;notification-events&quot;&gt;Notification Events&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Notification&lt;/strong&gt;: Fires on permission prompts, idle states, auth events. The matcher filters by notification type: &lt;code&gt;permission_prompt&lt;/code&gt;, &lt;code&gt;idle_prompt&lt;/code&gt;, &lt;code&gt;auth_success&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;matchers-targeting-your-hooks&quot;&gt;Matchers: Targeting Your Hooks&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;matcher&lt;/code&gt; field is a regex pattern that filters which specific tools or event subtypes trigger your hook. No matcher means it fires on everything for that event.&lt;/p&gt;
&lt;p&gt;Common patterns:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&quot;Bash&quot;              # Only Bash tool calls&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&quot;Write|Edit&quot;        # File write or edit operations&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&quot;mcp__memory__.*&quot;   # Any tool from the memory MCP server&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&quot;mcp__.*__write.*&quot;  # Any write operation on any MCP server&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;&quot;*&quot;                 # Everything (same as omitting matcher)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For &lt;code&gt;PreToolUse&lt;/code&gt; and &lt;code&gt;PostToolUse&lt;/code&gt;, the matcher targets tool names. For &lt;code&gt;Notification&lt;/code&gt;, it targets notification types. For &lt;code&gt;SubagentStop&lt;/code&gt;, it targets agent types.&lt;/p&gt;
&lt;p&gt;There is also the &lt;code&gt;if&lt;/code&gt; field for tighter filtering within tool events:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Bash&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      &quot;if&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Bash(rm *)&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;./hooks/block-destructive.sh&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;if&lt;/code&gt; pattern matches against the tool name and a substring of its arguments. This hook only fires on Bash calls that contain “rm” in the command. Everything else passes through untouched.&lt;/p&gt;
&lt;h2 id=&quot;what-your-hook-receives&quot;&gt;What Your Hook Receives&lt;/h2&gt;
&lt;p&gt;Every hook gets a JSON payload on stdin with context about the event. The common fields across all events:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;session_id&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;abc123&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;transcript_path&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;/path/to/transcript.jsonl&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;cwd&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;/current/working/directory&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;permission_mode&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;default&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hook_event_name&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;PreToolUse&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Tool events add &lt;code&gt;tool_name&lt;/code&gt; and &lt;code&gt;tool_input&lt;/code&gt; with the full parameters Claude passed. A Bash hook gets &lt;code&gt;tool_input.command&lt;/code&gt;. A Write hook gets &lt;code&gt;tool_input.file_path&lt;/code&gt; and &lt;code&gt;tool_input.content&lt;/code&gt;. You parse what you need with &lt;code&gt;jq&lt;/code&gt; and act on it.&lt;/p&gt;
&lt;p&gt;Environment variables available to command hooks:&lt;/p&gt;





















&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Variable&lt;/th&gt;&lt;th&gt;Purpose&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;CLAUDE_PROJECT_DIR&lt;/code&gt;&lt;/td&gt;&lt;td&gt;Root of the current project&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;CLAUDE_ENV_FILE&lt;/code&gt;&lt;/td&gt;&lt;td&gt;File path for persisting env vars (SessionStart)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;code&gt;CLAUDE_CODE_REMOTE&lt;/code&gt;&lt;/td&gt;&lt;td&gt;”true” if running in web mode&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h2 id=&quot;what-your-hook-returns&quot;&gt;What Your Hook Returns&lt;/h2&gt;
&lt;p&gt;Your hook communicates back through exit codes and JSON on stdout.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Exit codes:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;0&lt;/strong&gt;: Success. stdout JSON is processed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;2&lt;/strong&gt;: Blocking error. stderr is fed back to Claude. Execution halts for this hook.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;1, 3+&lt;/strong&gt;: Non-blocking error on most events. Hook failure does not stop the workflow.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;JSON output for PreToolUse:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hookSpecificOutput&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;hookEventName&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;PreToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;permissionDecision&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;deny&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;permissionDecisionReason&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Blocked: destructive filesystem operation&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;additionalContext&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Use targeted rm commands instead of recursive wildcards&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;JSON output for PostToolUse/Stop (blocking):&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;decision&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;block&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;reason&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Output failed validation. Fix lint errors before continuing.&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Universal fields any hook can return:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;continue&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;suppressOutput&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;systemMessage&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Warning shown to the user in the UI&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;additionalContext&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Injected into Claude&apos;s context window&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Set &lt;code&gt;continue&lt;/code&gt; to &lt;code&gt;false&lt;/code&gt; with a &lt;code&gt;stopReason&lt;/code&gt; to kill the session. Use &lt;code&gt;additionalContext&lt;/code&gt; to feed Claude information it would not otherwise have. Use &lt;code&gt;systemMessage&lt;/code&gt; to surface warnings in the terminal.&lt;/p&gt;
&lt;h2 id=&quot;practical-cases-that-actually-matter&quot;&gt;Practical Cases That Actually Matter&lt;/h2&gt;
&lt;p&gt;Theory is useless without application. Here are real scenarios, configured and explained.&lt;/p&gt;
&lt;h3 id=&quot;case-1-block-destructive-commands&quot;&gt;Case 1: Block Destructive Commands&lt;/h3&gt;
&lt;p&gt;You do not want Claude running &lt;code&gt;rm -rf&lt;/code&gt;, &lt;code&gt;git push --force&lt;/code&gt;, &lt;code&gt;DROP TABLE&lt;/code&gt;, or anything that nukes state. This is your first hook. Deploy it before anything else.&lt;/p&gt;
&lt;p&gt;Script at &lt;code&gt;.claude/hooks/guard-destructive.sh&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cat&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;COMMAND&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; jq&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;.tool_input.command // empty&apos;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-z&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$COMMAND&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ]; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;then&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;BLOCKED_PATTERNS&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;rm -rf&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;rm -r /&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;git push.*--force&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;git reset --hard&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;DROP TABLE&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;DROP DATABASE&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;mkfs\.&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;&gt; /dev/sd&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; PATTERN &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;${&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;BLOCKED_PATTERNS&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;]}&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;do&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$COMMAND&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; grep&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -qE&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$PATTERN&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;then&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      \&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;hookSpecificOutput&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        \&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;hookEventName&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;PreToolUse&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        \&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;permissionDecision&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deny&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        \&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;permissionDecisionReason&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;Blocked: matched destructive pattern &apos;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$PATTERN&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    }&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  fi&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;done&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Config in &lt;code&gt;.claude/settings.json&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;PreToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Bash&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/guard-destructive.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;statusMessage&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Checking command safety...&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Make the script executable: &lt;code&gt;chmod +x .claude/hooks/guard-destructive.sh&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Claude tries &lt;code&gt;rm -rf /tmp/build&lt;/code&gt;, the hook catches it, denies it, and tells Claude why. Claude adjusts. No data lost. No drama.&lt;/p&gt;
&lt;h3 id=&quot;case-2-auto-lint-after-every-file-change&quot;&gt;Case 2: Auto-Lint After Every File Change&lt;/h3&gt;
&lt;p&gt;Every time Claude writes or edits a file, run the linter. If it fails, feed the errors back so Claude fixes them in the same pass instead of you catching it later.&lt;/p&gt;
&lt;p&gt;Script at &lt;code&gt;.claude/hooks/lint-on-write.sh&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cat&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;FILE_PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; jq&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;.tool_input.file_path // empty&apos;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-z&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$FILE_PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ]; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;then&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;case&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$FILE_PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; in&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  *&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;.ts&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;|*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;.tsx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;|*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;.js&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;|*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;.jsx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    LINT_OUTPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;cd&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; &amp;#x26;&amp;#x26; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;npx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; eslint&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$FILE_PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; 2&gt;&amp;#x26;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    LINT_EXIT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;$?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  *&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#DBEDFF&quot;&gt;.py&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    LINT_OUTPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;cd&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; &amp;#x26;&amp;#x26; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;python&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -m&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; ruff&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; check&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$FILE_PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; 2&gt;&amp;#x26;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    LINT_EXIT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;$?&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  *)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ;;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;esac&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [ $LINT_EXIT &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-ne&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ]; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;then&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  ESCAPED&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$LINT_OUTPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; jq&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -Rs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; .&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    \&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;additionalContext&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;Lint errors detected in &lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$FILE_PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;. Fix these before moving on:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\\&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$LINT_OUTPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  }&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Config:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;PostToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Write|Edit&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/lint-on-write.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;30&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;statusMessage&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Running linter...&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Claude writes a TypeScript file with an unused import. The hook catches it, feeds the error back, and Claude removes the import. All in one cycle. No second pass needed.&lt;/p&gt;
&lt;h3 id=&quot;case-3-session-bootstrap&quot;&gt;Case 3: Session Bootstrap&lt;/h3&gt;
&lt;p&gt;Load your NVM version, set environment variables, and prime the session with project context on startup. No more “please use Node 20” prompts.&lt;/p&gt;
&lt;p&gt;Script at &lt;code&gt;.claude/hooks/session-init.sh&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-z&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$CLAUDE_ENV_FILE&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ]; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;then&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Load NVM and set Node version&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; NVM_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$HOME&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.nvm&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-s&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$NVM_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/nvm.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ]; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;then&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  source&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$NVM_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/nvm.sh&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;  nvm&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; use&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 20&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; /dev/null&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; 2&gt;&amp;#x26;1&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# Persist environment for the session&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;export NODE_ENV=development&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &gt;&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$CLAUDE_ENV_FILE&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;export EDITOR=vim&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &gt;&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$CLAUDE_ENV_FILE&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;# If there is a .nvmrc, respect it&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; [ &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;-f&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.nvmrc&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; ]; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;then&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  NODE_VERSION&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cat&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.nvmrc&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;export PATH=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$NVM_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/versions/node/v&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$NODE_VERSION&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/bin:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\$&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &gt;&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$CLAUDE_ENV_FILE&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;fi&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Config:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;SessionStart&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/session-init.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;15&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;statusMessage&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Initializing session environment...&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Session starts. Environment is loaded. No asking, no prompting, no wasted cycles.&lt;/p&gt;
&lt;h3 id=&quot;case-4-audit-log-for-compliance&quot;&gt;Case 4: Audit Log for Compliance&lt;/h3&gt;
&lt;p&gt;Every tool call gets logged with a timestamp, tool name, and parameters. Useful for security reviews, incident reconstruction, or just knowing what happened in a session.&lt;/p&gt;
&lt;p&gt;Script at &lt;code&gt;.claude/hooks/audit-log.sh&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cat&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;TOOL_NAME&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; jq&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;.tool_name // &quot;unknown&quot;&apos;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;EVENT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; jq&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;.hook_event_name // &quot;unknown&quot;&apos;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;TIMESTAMP&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;date&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -u&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; +&quot;%Y-%m-%dT%H:%M:%SZ&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;SESSION&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; jq&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;.session_id // &quot;unknown&quot;&apos;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;LOG_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/logs&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;mkdir&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -p&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$LOG_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; jq&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -c&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  timestamp: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$TIMESTAMP&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  session: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$SESSION&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  event: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$EVENT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  tool: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$TOOL_NAME&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  input: .tool_input&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;}&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; &gt;&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$LOG_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/audit-$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;date&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; +%Y-%m-%d).jsonl&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Config:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;PreToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/audit-log.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every action, timestamped, structured, searchable. Pipe it into your &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-siem&quot;&gt;SIEM&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-siem&quot;&gt;A platform that collects, correlates, and analyzes log data from across your infrastructure to detect security threats and support incident investigation. &lt;a href=&quot;https://bytesnation.com/dictionary/siem/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, grep it for &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-incident-response&quot;&gt;incident response&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-incident-response&quot;&gt;The structured process of detecting, containing, eradicating, and recovering from a cybersecurity incident to minimize damage and prevent recurrence. &lt;a href=&quot;https://bytesnation.com/dictionary/incident-response/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;, or just keep receipts.&lt;/p&gt;
&lt;h3 id=&quot;case-5-protect-sensitive-files&quot;&gt;Case 5: Protect Sensitive Files&lt;/h3&gt;
&lt;p&gt;Deny reads or writes to files that contain secrets, credentials, or infrastructure configs that Claude has no business touching.&lt;/p&gt;
&lt;p&gt;Script at &lt;code&gt;.claude/hooks/protect-sensitive.sh&lt;/code&gt;:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6A737D;--shiki-dark:#6A737D&quot;&gt;#!/bin/bash&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;cat&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;FILE_PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$INPUT&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; jq&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -r&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &apos;.tool_input.file_path // .tool_input.command // empty&apos;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;PROTECTED_PATTERNS&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;\.env&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;credentials&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;\.pem$&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;\.key$&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;secrets\.&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;terraform\.tfstate&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;kubeconfig&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;  &apos;\.kube/config&apos;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; PATTERN &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;in&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;${&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;PROTECTED_PATTERNS&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;]}&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;do&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$FILE_PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; grep&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; -qE&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$PATTERN&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;; &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;then&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    echo&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt; &quot;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;      \&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;hookSpecificOutput&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        \&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;hookEventName&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;PreToolUse&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        \&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;permissionDecision&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;deny&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        \&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;permissionDecisionReason&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;Access denied: &apos;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;$FILE_PATH&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&apos; matches protected pattern. Sensitive files are off limits.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    }&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  fi&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;done&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; 0&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Config:&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;PreToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Read|Write|Edit|Bash&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/protect-sensitive.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;statusMessage&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Checking file access...&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Claude tries to read your &lt;code&gt;.env&lt;/code&gt; file to “check the database URL.” Hook says no. Claude works with what it has or asks you for the value. Your secrets stay where they belong.&lt;/p&gt;
&lt;h3 id=&quot;case-6-mcp-server-tool-monitoring&quot;&gt;Case 6: MCP Server Tool Monitoring&lt;/h3&gt;
&lt;p&gt;If you are running &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-mcp-protocol&quot;&gt;MCP&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-mcp-protocol&quot;&gt;An open standard for connecting AI assistants to external data sources and tools, enabling them to access real-time information and take actions. &lt;a href=&quot;https://bytesnation.com/dictionary/mcp-protocol/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; servers (memory, database, external services), you want visibility into what Claude is doing with those tools.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;PreToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;mcp__.*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/audit-log.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;statusMessage&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Logging MCP operation...&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;PostToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;mcp__.*__write.*|mcp__.*__delete.*|mcp__.*__update.*&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/audit-log.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;mcp__&amp;#x3C;server&gt;__&amp;#x3C;tool&gt;&lt;/code&gt; naming convention makes regex targeting clean. Log everything, or scope it to write/delete operations. Your call.&lt;/p&gt;
&lt;h3 id=&quot;case-7-http-webhook-for-team-visibility&quot;&gt;Case 7: HTTP Webhook for Team Visibility&lt;/h3&gt;
&lt;p&gt;Push hook events to an external endpoint. Slack notifications, dashboards, approval workflows. Whatever your team needs.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;PreToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Bash&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;url&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;http://localhost:9090/hooks/pre-tool&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;15&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;headers&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;              &quot;Authorization&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Bearer $HOOK_API_TOKEN&quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;            },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;allowedEnvVars&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;HOOK_API_TOKEN&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;allowedEnvVars&lt;/code&gt; field explicitly whitelists which environment variables get resolved in the headers. Nothing leaks that you did not approve.&lt;/p&gt;
&lt;h2 id=&quot;combining-multiple-hooks&quot;&gt;Combining Multiple Hooks&lt;/h2&gt;
&lt;p&gt;You can stack hooks on the same event. They execute in order. If any hook denies or blocks, the chain stops.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;PreToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Bash&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/guard-destructive.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;10&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/audit-log.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      },&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Write|Edit&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/protect-sensitive.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;5&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;PostToolUse&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;matcher&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;Write|Edit&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/lint-on-write.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;30&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ],&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;    &quot;SessionStart&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;        &quot;hooks&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: [&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/session-init.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;            &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;15&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;          }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;        ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;      }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    ]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This is a real production config. Destructive command guard, audit logging, sensitive file protection, auto-linting, and session bootstrap. All running without you lifting a finger after initial setup.&lt;/p&gt;
&lt;h2 id=&quot;async-hooks&quot;&gt;Async Hooks&lt;/h2&gt;
&lt;p&gt;Some hooks do not need to block execution. Logging is a perfect example. Set &lt;code&gt;&quot;async&quot;: true&lt;/code&gt; and the hook fires in the background. Claude does not wait for it.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;json&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;{&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;type&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;command&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;$CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;\&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;/.claude/hooks/audit-log.sh&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;async&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;  &quot;timeout&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;10&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Use async for: logging, metrics, notifications. Keep synchronous for: guards, validators, linters.&lt;/p&gt;
&lt;h2 id=&quot;debugging-hooks&quot;&gt;Debugging Hooks&lt;/h2&gt;
&lt;p&gt;Hooks not firing? Here is the checklist:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Check the file location.&lt;/strong&gt; Is your config in the right settings file for the scope you need?&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Validate the JSON.&lt;/strong&gt; One misplaced comma kills the entire hooks config. Use &lt;code&gt;jq . .claude/settings.json&lt;/code&gt; to validate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check script permissions.&lt;/strong&gt; &lt;code&gt;chmod +x&lt;/code&gt; on your hook scripts. This catches people more than anything.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check the matcher.&lt;/strong&gt; &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-regex&quot;&gt;Regex&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-regex&quot;&gt;A pattern language for matching, searching, and manipulating text, used in everything from input validation to log analysis. &lt;a href=&quot;https://bytesnation.com/dictionary/regex/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; is exact. &lt;code&gt;&quot;Bash&quot;&lt;/code&gt; matches &lt;code&gt;Bash&lt;/code&gt;, not &lt;code&gt;bash&lt;/code&gt;. Tool names are PascalCase.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check exit codes.&lt;/strong&gt; Exit 0 means success. Exit 2 means blocking error. Anything else is a soft failure.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Read stderr.&lt;/strong&gt; If your script errors, stderr output shows in the Claude Code interface.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use &lt;code&gt;/hooks&lt;/code&gt; in the CLI.&lt;/strong&gt; Type it during a session to see all configured hooks and their status.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Test your script standalone.&lt;/strong&gt; Pipe sample JSON into your script and check the output: &lt;code&gt;echo &apos;{&quot;tool_input&quot;:{&quot;command&quot;:&quot;rm -rf /&quot;}}&apos; | ./hooks/guard-destructive.sh&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&quot;security-considerations&quot;&gt;Security Considerations&lt;/h2&gt;
&lt;p&gt;Hooks run with your user permissions. They can do anything you can do. That means:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Do not put secrets in hook scripts. Use environment variables.&lt;/li&gt;
&lt;li&gt;Do not fetch or execute remote code in hooks without verifying the source.&lt;/li&gt;
&lt;li&gt;Commit &lt;code&gt;.claude/settings.json&lt;/code&gt; with your hook configs so the team gets the same guardrails.&lt;/li&gt;
&lt;li&gt;Keep &lt;code&gt;.claude/settings.local.json&lt;/code&gt; in &lt;code&gt;.gitignore&lt;/code&gt; for machine-specific overrides.&lt;/li&gt;
&lt;li&gt;Review hook scripts in PRs the same way you review application code. They are part of your security posture.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;allowedEnvVars&lt;/code&gt; field on HTTP hooks exists for a reason. Use it. Do not leak tokens through lazy wildcard configs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;when-not-to-use-hooks&quot;&gt;When Not to Use Hooks&lt;/h2&gt;
&lt;p&gt;Hooks are not a silver bullet. Do not use them for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Complex business logic.&lt;/strong&gt; If your hook script exceeds 50 lines, you are building a service, not a hook. Extract it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Replacing &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-ci-cd&quot;&gt;CI/CD&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-ci-cd&quot;&gt;The practice of automatically building, testing, and deploying code changes whenever developers push updates, catching bugs early and shipping faster. &lt;a href=&quot;https://bytesnation.com/dictionary/ci-cd/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;.&lt;/strong&gt; Hooks run locally. They are not a substitute for pipeline gates.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Micromanaging Claude.&lt;/strong&gt; If you are writing a hook for every possible edge case, you are fighting the tool instead of using it. Set the big guardrails and trust the model for the rest.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;the-bottom-line&quot;&gt;The Bottom Line&lt;/h2&gt;
&lt;p&gt;Hooks give you programmatic control over Claude Code’s execution lifecycle. Set them up once, forget about them, and let them enforce your standards automatically. The five minutes you spend writing a guard script saves you from the one time Claude decides &lt;code&gt;rm -rf&lt;/code&gt; is the right answer.&lt;/p&gt;
&lt;p&gt;Start with the destructive command guard. Add the sensitive file protector. Layer in audit logging. Then customize from there. That is your deployment order. That is your minimum viable hook setup.&lt;/p&gt;
&lt;p&gt;Now stop reading and go configure them.&lt;/p&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/claude-code-hooks-header.png" length="0" type="image/png"/></item><item><title>Welcome to the Lab</title><link>https://bytesnation.com/blog/welcome-to-the-lab/</link><guid isPermaLink="true">https://bytesnation.com/blog/welcome-to-the-lab/</guid><description>First post from the BytesNation lab. What this space is about, what to expect, and why I build in the open.</description><pubDate>Wed, 08 Apr 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;welcome-to-the-lab&quot;&gt;Welcome to the Lab&lt;/h2&gt;
&lt;p&gt;This is BytesNation, a handcrafted tech lab where I document builds, experiments, and field notes across 3D printing, networking, cybersecurity, and datacenter architecture.&lt;/p&gt;
&lt;p&gt;Everything here is built by one person, broken on purpose, and written down so the next person does not start from scratch.&lt;/p&gt;
&lt;h3 id=&quot;who-is-running-this-lab&quot;&gt;Who Is Running This Lab&lt;/h3&gt;
&lt;p&gt;Combat veteran. Self-taught systems architect. Sixteen years of enterprise infrastructure, firewalls, datacenter design, and network operations. Started hosting gaming servers as a teenager. That turned into managing enterprise networks. Networks turned into firewalls. Firewalls turned into datacenter architecture and capacity planning. Somewhere along the way, 3D printers and microcontrollers showed up on the bench, because the fastest way to understand a system is to build one from the floor up.&lt;/p&gt;
&lt;p&gt;No computer science degree. No formal training pipeline. Just obsessive curiosity and a habit of breaking things until they work.&lt;/p&gt;
&lt;h3 id=&quot;the-physical-lab&quot;&gt;The Physical Lab&lt;/h3&gt;
&lt;p&gt;The current setup is a two-node Proxmox cluster running on Beelink mini PCs. Quiet enough to run in a home office, powerful enough to virtualize a real network stack. VMs for pfSense, a &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-vlan&quot;&gt;VLAN&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-vlan&quot;&gt;A virtual local area network that segments a single physical switch into multiple isolated broadcast domains without needing separate hardware. &lt;a href=&quot;https://bytesnation.com/dictionary/vlan/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;-segmented flat network, Unifi access points, and a monitoring stack built on Prometheus and Grafana. The cluster runs continuously on a UPS.&lt;/p&gt;
&lt;p&gt;On the bench right now: a 3D printer for enclosures and cable management hardware, a Raspberry Pi cluster for experimenting with edge compute, and a dedicated test network for running attack-and-defend scenarios without touching production.&lt;/p&gt;
&lt;p&gt;The lab is not a showroom. It is a working environment. Things break. That is the point.&lt;/p&gt;
&lt;h3 id=&quot;what-gets-documented-here&quot;&gt;What Gets Documented Here&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Homelab and Infrastructure:&lt;/strong&gt; Proxmox builds, network topologies, VLAN segmentation, storage configuration, monitoring stacks. The kind of setup you can replicate at home for a few hundred dollars instead of a few hundred thousand.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cybersecurity:&lt;/strong&gt; Threat modeling, &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-firewall&quot;&gt;firewall&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-firewall&quot;&gt;A security device or software that monitors and controls incoming and outgoing network traffic based on predefined rules. &lt;a href=&quot;https://bytesnation.com/dictionary/firewall/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; configuration, &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-incident-response&quot;&gt;incident response&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-incident-response&quot;&gt;The structured process of detecting, containing, eradicating, and recovering from a cybersecurity incident to minimize damage and prevent recurrence. &lt;a href=&quot;https://bytesnation.com/dictionary/incident-response/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; workflows, CTF writeups, and analysis of real-world breaches. Defensive security first, always.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;AI and Automation:&lt;/strong&gt; Large language models, agentic workflows, &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-mcp-protocol&quot;&gt;Model Context Protocol&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-mcp-protocol&quot;&gt;An open standard for connecting AI assistants to external data sources and tools, enabling them to access real-time information and take actions. &lt;a href=&quot;https://bytesnation.com/dictionary/mcp-protocol/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; integrations, and what it actually means to wire AI into a production environment. Not hype. Hands-on builds.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3D Printing and Hardware:&lt;/strong&gt; Functional prints, not decorative ones. Enclosures, rack accessories, cable management, custom brackets. If it saves time or improves a build, it gets documented.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Networking:&lt;/strong&gt; Protocols, architecture, routing decisions, and the reasoning behind them. Why you would choose one topology over another. How to think about network design when budget, noise, and physical space are all real constraints.&lt;/p&gt;
&lt;h3 id=&quot;why-build-in-the-open&quot;&gt;Why Build in the Open&lt;/h3&gt;
&lt;p&gt;Most of what I know came from someone else’s build log. A forum post from 2014. A GitHub repo with no README but a config file that answered the exact question I had been stuck on for three days. A YouTube video from a homelab channel with 800 subscribers that explained subnetting better than any book I read.&lt;/p&gt;
&lt;p&gt;Knowledge hoarding is a dead end. The field moves fast enough that yesterday’s secrets are tomorrow’s blog posts anyway. BytesNation exists because I got tired of being the person who figured something out and never wrote it down.&lt;/p&gt;
&lt;p&gt;When I document a build, I document the failures too. The things that looked right on paper and did not work in practice. The edge cases. The second and third attempts. The polished end result without that context is useless to the next person who hits the same wall.&lt;/p&gt;
&lt;h3 id=&quot;the-stack-running-this-site&quot;&gt;The Stack Running This Site&lt;/h3&gt;
&lt;p&gt;This site is built with Astro, a static site framework that outputs plain HTML. Blog posts are markdown files processed at build time. No CMS, no database, no runtime server, no dependencies I cannot audit. React handles the interactive pieces, Tailwind handles the styling, and the whole thing deploys to Render as a static site.&lt;/p&gt;
&lt;p&gt;The code is available on GitHub. If something looks wrong or could be done better, the repository is open.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;typescript&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;export&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; function&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; getAllPosts&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; BlogPost&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;[] {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  const&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt; markdownFiles&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; =&lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt; import&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;meta&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;glob&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;    &quot;../content/blog/*.md&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;,&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    { query: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;?raw&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, import: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#032F62;--shiki-dark:#9ECBFF&quot;&gt;&quot;default&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, eager: &lt;/span&gt;&lt;span style=&quot;--shiki-light:#005CC5;--shiki-dark:#79B8FF&quot;&gt;true&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; }&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;  );&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;  return&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; Object.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;entries&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(markdownFiles)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    .&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(([&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;filepath&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;raw&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;]) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt; parsePost&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(filepath, raw))&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    .&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;post&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; post.published)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;    .&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;sort&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;((&lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;a&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;--shiki-light:#E36209;--shiki-dark:#FFAB70&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;) &lt;/span&gt;&lt;span style=&quot;--shiki-light:#D73A49;--shiki-dark:#F97583&quot;&gt;=&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt; b.date.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#6F42C1;--shiki-dark:#B392F0&quot;&gt;localeCompare&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;(a.date));&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292E;--shiki-dark:#E1E4E8&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Static output means every page is pre-rendered HTML. No JavaScript required to read an article. No tracking pixels beyond Google Analytics, which you can block. No paywalls.&lt;/p&gt;
&lt;h3 id=&quot;what-is-next&quot;&gt;What Is Next&lt;/h3&gt;
&lt;p&gt;The first batch of posts covers the foundational layer: understanding how AI models actually work, building a Proxmox cluster on mini PCs, configuring network firewalls and WAFs, and wiring AI into your personal knowledge management system. From there, the content follows what is actually on the bench.&lt;/p&gt;
&lt;p&gt;If you have a question about a build, a post, or the lab setup, the About page has the channels I actually check. The lab is open. Come in.&lt;/p&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/welcome-to-the-lab-header.png" length="0" type="image/png"/></item><item><title>Network Firewalls vs. Web Application Firewalls: What Each One Actually Defends</title><link>https://bytesnation.com/blog/web-application-firewall-vs-firewall/</link><guid isPermaLink="true">https://bytesnation.com/blog/web-application-firewall-vs-firewall/</guid><description>Network firewalls and WAFs both block traffic, but they operate at completely different layers and defend against completely different attacks. Here is what each one does, where each one fails, and how to deploy them together.</description><pubDate>Thu, 26 Dec 2024 00:00:00 GMT</pubDate><content:encoded>&lt;h2 id=&quot;network-firewalls-vs-web-application-firewalls-what-each-one-actually-defends&quot;&gt;Network Firewalls vs. Web Application Firewalls: What Each One Actually Defends&lt;/h2&gt;
&lt;p&gt;Both devices are called firewalls. Both block traffic. That is where the similarity ends.&lt;/p&gt;
&lt;p&gt;Network firewalls and Web Application Firewalls (WAFs) operate at different layers of the &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-osi-model&quot;&gt;OSI&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-osi-model&quot;&gt;A seven-layer framework that describes how data travels from an application on one device to an application on another device across a network. &lt;a href=&quot;https://bytesnation.com/dictionary/osi-model/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; model, inspect different things, and fail against different attack types. Running one without the other leaves real gaps. Understanding the difference is not an academic exercise; it is the foundation of any layered security architecture.&lt;/p&gt;
&lt;h3 id=&quot;the-core-distinction-which-layer-they-inspect&quot;&gt;The Core Distinction: Which Layer They Inspect&lt;/h3&gt;
&lt;p&gt;A network &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-firewall&quot;&gt;firewall&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-firewall&quot;&gt;A security device or software that monitors and controls incoming and outgoing network traffic based on predefined rules. &lt;a href=&quot;https://bytesnation.com/dictionary/firewall/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; works at Layers 3 and 4 of the OSI model, the Network and Transport layers. It sees &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-ip-address&quot;&gt;IP&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-ip-address&quot;&gt;A unique numerical label assigned to every device on a network, used to identify it and route traffic to the correct destination. &lt;a href=&quot;https://bytesnation.com/dictionary/ip-address/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; addresses, ports, and protocols. It makes decisions based on those values: allow &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-tcp&quot;&gt;TCP&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-tcp&quot;&gt;A transport protocol that guarantees reliable, ordered delivery of data between two devices by establishing a connection before sending. &lt;a href=&quot;https://bytesnation.com/dictionary/tcp/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; from this IP to &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-port&quot;&gt;port&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-port&quot;&gt;A numbered endpoint on a device that identifies a specific application or service, allowing multiple network services to run on the same IP address. &lt;a href=&quot;https://bytesnation.com/dictionary/port/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; 443, block everything else from this subnet, deny &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-udp&quot;&gt;UDP&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-udp&quot;&gt;A lightweight transport protocol that sends data without establishing a connection first, prioritizing speed over guaranteed delivery. &lt;a href=&quot;https://bytesnation.com/dictionary/udp/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; except from these sources.&lt;/p&gt;
&lt;p&gt;A &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-waf&quot;&gt;WAF&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-waf&quot;&gt;A firewall that operates at the application layer (Layer 7) to protect web applications from attacks like SQL injection and cross-site scripting. &lt;a href=&quot;https://bytesnation.com/dictionary/waf/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; works at Layer 7, the Application layer. It sees the actual content of HTTP and HTTPS requests: the URL path, query parameters, headers, cookies, and request body. It makes decisions based on what is inside the traffic, not just where it came from.&lt;/p&gt;
&lt;p&gt;That distinction determines everything about what each device can and cannot protect against.&lt;/p&gt;
&lt;h3 id=&quot;what-network-firewalls-do-well&quot;&gt;What Network Firewalls Do Well&lt;/h3&gt;
&lt;p&gt;Network firewalls are the perimeter. They answer the question: should this connection be allowed to exist at all?&lt;/p&gt;
&lt;p&gt;A well-configured network firewall blocks inbound connections to ports you are not running services on. It prevents direct access to your database server from the public internet. It enforces network segmentation so a compromised web server cannot directly reach your internal &lt;span class=&quot;dict-term-wrapper&quot;&gt;&lt;dfn class=&quot;dict-term&quot; tabindex=&quot;0&quot; aria-describedby=&quot;dict-tip-dns&quot;&gt;DNS&lt;/dfn&gt;&lt;span class=&quot;dict-tooltip&quot; role=&quot;tooltip&quot; id=&quot;dict-tip-dns&quot;&gt;The system that translates human-readable domain names into IP addresses so devices can find each other on a network. &lt;a href=&quot;https://bytesnation.com/dictionary/dns/&quot; class=&quot;dict-tooltip-link&quot;&gt;Read more →&lt;/a&gt;&lt;/span&gt;&lt;/span&gt; or Active Directory. It rate-limits or drops flood traffic before it saturates upstream links.&lt;/p&gt;
&lt;p&gt;Stateful packet inspection lets a modern firewall track connection state, not just individual packets. It can allow an outbound TCP connection to be initiated from inside your network and permit the inbound response traffic without opening a broad inbound rule. This is the difference between a stateless packet filter and an actual firewall.&lt;/p&gt;
&lt;p&gt;Intrusion prevention capabilities in next-generation firewalls (NGFWs) extend this further. They can detect and block known exploit patterns, command-and-control callbacks, and malicious DNS lookups using signature-based detection at the network layer.&lt;/p&gt;
&lt;p&gt;What a network firewall cannot do: it cannot read the contents of an HTTP request that arrives on port 443. If the connection is allowed, the firewall lets it through. What happens inside that HTTP request is invisible to it.&lt;/p&gt;
&lt;h3 id=&quot;what-web-application-firewalls-do-well&quot;&gt;What Web Application Firewalls Do Well&lt;/h3&gt;
&lt;p&gt;A WAF defends the application from traffic that already has permission to connect.&lt;/p&gt;
&lt;p&gt;SQL injection is the canonical example. An attacker sends a POST request to your login form with a payload like &lt;code&gt;&apos; OR 1=1 --&lt;/code&gt; in the username field. The connection came from a legitimate IP, over port 443, using HTTPS. A network firewall sees nothing wrong. The WAF reads the request body, matches the payload against SQL injection signatures, and blocks the request before it reaches your application code.&lt;/p&gt;
&lt;p&gt;The same principle applies to cross-site scripting (XSS), where an attacker tries to inject &lt;code&gt;&amp;#x3C;script&gt;&lt;/code&gt; tags into a form field that will later be rendered in another user’s browser. Or path traversal attacks, where a request to &lt;code&gt;/api/files?path=../../etc/passwd&lt;/code&gt; is trying to read your server’s password file. Or HTTP request smuggling, where malformed headers try to desynchronize a proxy and backend server to sneak unauthorized requests through.&lt;/p&gt;
&lt;p&gt;All of these attacks arrive on allowed ports from non-blocked IPs. The network firewall has no mechanism to detect them. The WAF exists specifically to inspect the HTTP layer and block them.&lt;/p&gt;
&lt;p&gt;WAFs also handle rate limiting at the application layer. Not just “this IP is sending too many TCP connections” but “this IP has submitted 50 login attempts in 30 seconds” or “this client is scraping every product page on your site at 200 requests per minute.” Application-layer rate limiting lets you enforce much more meaningful thresholds than connection-level throttling.&lt;/p&gt;
&lt;h3 id=&quot;where-each-one-fails&quot;&gt;Where Each One Fails&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Network firewall blind spots:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Encrypted HTTPS traffic is the biggest gap. A network firewall sees that encrypted data is flowing over port 443, but it cannot inspect the contents without performing TLS termination, which introduces latency, certificates, and complexity that most organizations skip. Everything inside TLS is opaque to a standard network firewall.&lt;/p&gt;
&lt;p&gt;Zero-day application exploits that do not match known signatures will pass through most network firewall inspection engines. A novel SQL injection technique or a new deserialization gadget chain in your Java application is not a network-layer event.&lt;/p&gt;
&lt;p&gt;Authorized users abusing their access. If an authenticated user is exfiltrating data through a legitimate API endpoint, the network firewall sees legitimate traffic from an authorized source.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;WAF blind spots:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Network-layer attacks are completely out of scope. A volumetric DDoS flood, a port scan, an attempt to connect directly to a database port, ARP spoofing on the local network. The WAF only sees HTTP/HTTPS. Everything else is invisible to it.&lt;/p&gt;
&lt;p&gt;Encrypted bypasses. If a WAF is deployed in a pass-through mode without TLS termination, encrypted traffic is as opaque to it as it is to the network firewall. Many WAFs require you to terminate TLS at the WAF to inspect traffic properly, which means your WAF holds your SSL certificates.&lt;/p&gt;
&lt;p&gt;Business logic flaws. A WAF cannot understand that your application should only allow a user to purchase one unit of a limited item, or that a password reset token should expire after one use, or that an account should lock after five failed login attempts if you have not implemented that logic in your app. WAFs block known attack patterns; they do not understand your application’s intent.&lt;/p&gt;
&lt;h3 id=&quot;osi-layer-reference&quot;&gt;OSI Layer Reference&lt;/h3&gt;





























&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Device&lt;/th&gt;&lt;th&gt;OSI Layers&lt;/th&gt;&lt;th&gt;Sees&lt;/th&gt;&lt;th&gt;Cannot See&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Network Firewall&lt;/td&gt;&lt;td&gt;3-4 (Network, Transport)&lt;/td&gt;&lt;td&gt;IP, port, protocol, connection state&lt;/td&gt;&lt;td&gt;HTTP content, URLs, query params, cookies&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;WAF&lt;/td&gt;&lt;td&gt;7 (Application)&lt;/td&gt;&lt;td&gt;HTTP/HTTPS content, headers, body, URLs&lt;/td&gt;&lt;td&gt;Non-HTTP traffic, IP-level attacks&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;NGFW with TLS inspection&lt;/td&gt;&lt;td&gt;3-7&lt;/td&gt;&lt;td&gt;Everything above, decrypted&lt;/td&gt;&lt;td&gt;Attacks that evade signatures&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;h3 id=&quot;deployment-patterns&quot;&gt;Deployment Patterns&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Edge network firewall, WAF in front of web tier:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The most common architecture. Network firewall at the perimeter handles all inbound traffic. Only ports 80 and 443 pass through to the DMZ. WAF sits in front of the web servers, terminates TLS, inspects HTTP, and forwards clean traffic. Network firewall also enforces east-west rules: the web tier cannot initiate connections to the database tier except on the application port.&lt;/p&gt;
&lt;pre class=&quot;astro-code astro-code-themes github-light github-dark&quot; style=&quot;--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e; overflow-x: auto; white-space: pre-wrap; word-wrap: break-word;&quot; tabindex=&quot;0&quot; data-language=&quot;plaintext&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Internet&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[Network Firewall]  ← blocks all non-80/443 inbound&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[WAF / Load Balancer]  ← terminates TLS, inspects HTTP&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[Web Servers]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[Network Firewall]  ← internal segmentation rule&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;    |&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[Database Servers]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Cloud WAF with on-prem network firewall:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you are running on AWS, GCP, or Azure, you likely have cloud-native WAF options (AWS WAF, Azure Application Gateway with WAF, Cloudflare WAF). These sit in front of your cloud-hosted application and handle HTTP inspection. Your VPC security groups or cloud firewall rules handle network-layer access control. The two layers stack without requiring you to run your own WAF appliance.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Reverse proxy as WAF:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;NGINX and HAProxy can perform basic WAF functions via ModSecurity or similar modules. If you do not have budget for a dedicated WAF appliance, a reverse proxy configured with the OWASP Core Rule Set (CRS) provides a meaningful baseline. It is not a full commercial WAF, but it will catch the most common automated attacks.&lt;/p&gt;
&lt;h3 id=&quot;when-you-need-both&quot;&gt;When You Need Both&lt;/h3&gt;
&lt;p&gt;The answer to “do I need both?” is almost always yes if you are running any web-facing application.&lt;/p&gt;
&lt;p&gt;The network firewall protects your infrastructure. It enforces the principle that only the services you intend to expose are reachable from the internet. It prevents lateral movement if a host is compromised. It gives you the ability to block entire IP ranges, countries, or ASNs at scale.&lt;/p&gt;
&lt;p&gt;The WAF protects your application. It handles the attack surface that exists within legitimate HTTP traffic, which is the attack surface that matters most for anything a user can reach through a browser.&lt;/p&gt;
&lt;p&gt;Neither replaces the other. A network firewall with no WAF leaves your application unprotected against SQL injection, XSS, and every other Layer 7 attack. A WAF with no network firewall leaves your infrastructure directly exposed: a misconfigured port, an unintended service, a debug endpoint that should never have been reachable from the internet.&lt;/p&gt;
&lt;p&gt;Run both. Put the network firewall at the edge. Put the WAF in front of the application tier. Configure rules on both. Review logs on both.&lt;/p&gt;
&lt;h3 id=&quot;virtual-firewalls-in-cloud-environments&quot;&gt;Virtual Firewalls in Cloud Environments&lt;/h3&gt;
&lt;p&gt;Cloud environments blur the hardware distinction but not the functional one. Virtual firewalls and security groups handle Layer 3 and 4 access control for your cloud network: which VMs can talk to which, which ports are open, what traffic is allowed in from the internet. Cloud WAFs handle Layer 7 inspection for web-facing services.&lt;/p&gt;



































&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Aspect&lt;/th&gt;&lt;th&gt;WAF&lt;/th&gt;&lt;th&gt;Virtual Firewall / Security Group&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;OSI Layer&lt;/td&gt;&lt;td&gt;7 (Application)&lt;/td&gt;&lt;td&gt;3-4 (Network, Transport)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Protection Target&lt;/td&gt;&lt;td&gt;Web servers, APIs, applications&lt;/td&gt;&lt;td&gt;Networks, VMs, containers, cloud resources&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Attack Types&lt;/td&gt;&lt;td&gt;XSS, SQLi, path traversal, API abuse&lt;/td&gt;&lt;td&gt;Port scans, unauthorized connections, DDoS at L3/4&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Traffic Inspected&lt;/td&gt;&lt;td&gt;HTTP/HTTPS content&lt;/td&gt;&lt;td&gt;Any protocol (TCP, UDP, ICMP)&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Typical Deployment&lt;/td&gt;&lt;td&gt;In front of application tier&lt;/td&gt;&lt;td&gt;VPC/network perimeter and internal segments&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;
&lt;p&gt;The cloud provider gives you both primitives. Use both. Security groups are not optional because you have a WAF. A WAF is not optional because you have security groups.&lt;/p&gt;
&lt;h3 id=&quot;the-practical-summary&quot;&gt;The Practical Summary&lt;/h3&gt;
&lt;p&gt;If someone compromises a router on your network, a network firewall controls whether that router can reach your database. A WAF has nothing to say about it. If someone submits a SQL injection payload through your contact form, a WAF catches it. A network firewall has nothing to say about it.&lt;/p&gt;
&lt;p&gt;Different threats. Different defenses. Neither is complete without the other.&lt;/p&gt;</content:encoded><enclosure url="https://bytesnation.com/blog/waf-vs-firewall-header.png" length="0" type="image/png"/></item></channel></rss>