Borrowing it
Nothing to install: this file belongs to roypadina/LanGuard. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/roypadina/LanGuard/main/CLAUDE.mdgit clone --depth 1 https://github.com/roypadina/LanGuardWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/roypadina/languard/claude-md)<a href="https://agentmods.dev/instructions/roypadina/languard/claude-md"><img src="https://agentmods.dev/badge/instructions/roypadina/languard/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/roypadina/languard/claude-md"><img src="https://agentmods.dev/badge/instructions/roypadina/languard/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02983 | $0.02983 |
| Opus 5.5 | $0.01193 | $0.01193 |
| Sonnet 5.5 | $0.00597 | $0.00597 |
| Haiku 4.5 | $0.00298 | $0.00298 |
Grade C, and why
LanGuard CLAUDE.md scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
rm -rf /Applications/LanGuard.app && ditto "$(built .app)" /Applications/LanGuard.app # replace, never merge: ditto over an old .app leaves stale files → "sealed resource is missing"; not cp -R (nests) How it starts
The opening of the file, as written. The whole thing — 69 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LanGuard
macOS menu-bar app. Turns Wi-Fi off when a wired LAN link goes up, on when it
goes down. Replaces the old shell com.roy.wifitoggle LaunchAgent (the app removes it
on first launch).
Layout
LanGuard/— app target (LanGuardApp.swift):MenuBarExtra(+Settings…command);AppDelegatestartsAppModel, shows the first-launchWelcomeWindow(didShowWelcome; skipped underLANGUARD_TEST=1, set by the UI test) and opens Settings on reopen (Finder/Raycast).LanGuardPackage/Sources/LanGuardFeature/— all logic (modular, unit-tested):InterfaceCatalog— enumerate + classify Ethernet/Wi-Fi via SystemConfiguration.isVirtual(bsdName:displayName:)flags bridge/VPN/VM/tunnel adapters (pure, tested).NetworkMonitor—SCDynamicStorecallbacks (link/IPv4) +NSWorkspacesleep/wake; per-interface link reads (SCkSCPropNetLinkActive, ifconfig fallback). Flap guard: ignores link changes while asleep (willSleepNotification→suspended), waits a settle interval afterdidWakeNotificationbefore evaluating once, and debounces callback bursts/brief flaps (1.5s). Stops a docked Mac's Ethernet dropping on sleep + returning on wake from looking like a real unplug→replug.WiFiController— CoreWLANsetPower/powerOn(no sudo, no shell).Notifier—UNUserNotificationCenterwrapper; banners on Wi-Fi toggle (needs OS permission, requested on launch).Log— opt-in file logger. WhendebugLoggingEnabled(Settings → Debug) is on, appends timestamped events to~/Library/Logs/LanGuard/languard.log(rotates at ~1MB, one backup).Log.writeis a no-op while off.revealInFinder()/clear()back the Settings buttons. Instrumented across start / evaluate / edges / setWiFiPower / sleep-wake so users can capture + send a log.MenuIcon—MenuState(lan/wifi/paused, pure mapping) +MenuIconStyle(icon / icon+label / label) +MenuBarLabelview used as the MenuBarExtra label.ToggleEngine— edge-based decision logic, dependencies injected → testable.Handover— make-before-break moves.toLAN: wait until the LAN reaches the internet (Probe, TCP to 1.1.1.1:443 scoped byrequiredInterfaceType),protection.settle()with preferWiFi=false, then Wi-Fi off (kept on if protection could not leave Wi-Fi).toWiFi(menu + globalHotKey, recordableHotKeyCombo): Wi-Fi on → reachable →protection.settle()with preferWiFi=true → "safe to unplug" popup. FloatingProgressPanelwhile it runs. Pressed again whileswitchedToWiFi(LAN still plugged) →AppModel.backToLAN()(reset → reconcile →engine.reapply()→toLAN).Protection— connection protection: a stable per-network /32 address A on whichever link is active + routes0.0.0.0/1,128.0.0.0/1 -ifa A, so TCP connections survive LAN↔Wi-Fi (TCP is pinned to its source IP; A moves, the IP doesn't change). Own undebounced SCDynamicStore watcher + 5 s common-mode timer; serial queue; settings captured as a main-threadSnapshot. Link-flap refresh: aState:/Network/Interface/<if>/Linkchange on A's interface (or another en* on the same router) marks it pending; once the link is usable again the app re-runsup(down + up = fresh /1s + alias). A 0.25 s en8 flap left A + /1s in place and Network.framework flows to hosts in use then timed out for 12 h while kernel sockets worked (2026-10-30); also once after anadoptat launch. Only on networks (router IP@MAC) where LAN+Wi-Fi shared a router (learned) or ticked by hand; user "off" →disabledNetworks, never re-learned. 30-min hold only when the guardian tore down asunhealthy; 5-min hold on verify failure / no free address.NetHelper— root side (quitting LanGuard KEEPS protection: the guardian guards it, the next launchadopts it; disable/panic/uninstall remove it):Resources/languard-net.sh→/Library/PrivilegedHelperTools/languard-net(verbs up/move/adopt/down/panic/arm/check/status; exit codes mirrored inNetHelper.Exit), LaunchDaemoncom.roypadina.languard-net(KeepAliveguardloop runscheckevery 3 s; launchd only (PPID1); default 10 s throttle, AbandonProcessGroup so a bootout never kills acheckmid-down; stamps/var/run/languard-net.tick; never back to a 3 s StartInterval: the job-respawn flood + an open Login Items settings pane panicked launchd, 2026-10-24), sudoers/etc/sudoers.d/languard= that helper path only. State-changing verbs run one at a time underlockf(/var/run/languard-net.lock, 0600; on a 15 s timeoutpanic/downrun unlocked, others exit 75). Guardian: a vanished interface is a normal strike (iface-gone); instant teardown only on corrupt state (bad-state) — an instant undock teardown raced the app'smove(2026-10-09). Health = router via A AND TCP 1.1.1.1:443 via A vs the plain address (nc -G, never-w: macOS-wis idle-only, a dead SYN waits 75 s);toWiFichecksNet.internetVia(A)before "Safe to unplug", else back to LAN (2026-10-11 office outage).attachalso adds the /1s-ifscopeeach OTHER en* on the same router (scope_others;down→unscope): sockets bound to the still-primary dock NIC (Tailscale NE → MagicDNS 100.100.100.100) otherwise get ENETUNREACH while A is on Wi-Fi = every name lookup SERVFAIL until unplug (root cause of the 10-11/10-12 office outages; by-IP checks never see it).attachanddownunscopeFIRST: with a scoped and an unscoped /1 on the same iface,route getreturns the scoped one (IFSCOPE) →route_ifempty → verify fails (1.1.5 bug). One admin prompt (install/remove). App never arms without a fresh tick. Panic: menu → helperpanic→ admin fallback → inlinepanicOneLiner(also README +~/Raycast-Scripts/languard-panic.sh). Safety contract in the script header; reviewed by 3 Fable gates (2026-10-06).AppSettings— UserDefaults. Physical wired + Wi-Fi = opt-out (disabledWired/disabledWiFi); virtual wired = opt-in (enabledVirtual, off by default).notificationsEnabled(Wi-Fi back on),notifyMovedToLAN,switchProgressPopup,safeToUnplugPopup,hotKey,menuIconStyle,protectionEnabled,protectedNetworks/disabledNetworks, per-network stable address + holds (UserDefaults dicts).LoginItem/LegacyCleanup— SMAppService login item (self-healing, see below); removes legacy LaunchAgent.AppModel— wires everything; singletonAppModel.shared.setWiFiPoweris idempotent — only toggles interfaces whose power actually differs and only posts the banner when something really changed.Views—MenuContent(menu),ConfigView(model:pane:)(one Settings pane; virtual adapters get a "virtual" badge), About window, progress panel.SettingsWindow= AppKitNSTabViewController(toolbar tabs, per-pane height, last pane remembered) hosting oneConfigViewper pane;AccessoryWindowsflips the app to.regularwhile Settings/About/Welcome are open.WelcomeWindowalso holdsLaunchAtLoginToggleandSupportBox.
Config/— xcconfig + entitlements. Un-sandboxed (CoreWLAN power + launchctl), ad-hoc signed,LSUIElement=YES(no Dock icon).
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago Changed · +45 tokens per session 7c7bce4b88c2
- 11d ago Changed · +118 tokens per session e3366be70347
- 12d ago Changed · +149 tokens per session ebbd7aeb3593
- 17d ago Changed · +71 tokens per session 59a860d0bedd
- 18d ago Changed · +2 lines · +104 tokens per session 698df8b13364
- 29d ago Changed · +162 tokens per session 1bffe9873a3f
- 1mo ago Changed · +83 tokens per session 39138210ee01
- 1mo ago Changed · +133 tokens per session d5824d6581ff
- 1mo ago Changed · +11 lines · +928 tokens per session scan A → C ac0f623d4fec
- 2mo ago First seen · 56 lines · 1,190 tokens per session scan A d99f57b9210d
LanGuard CLAUDE.md is an instructions file published in the GitHub repository roypadina/LanGuard (27 stars, last pushed 6d ago), licensed MIT. It adds 2,983 tokens to every session, about $0.0119 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
LanGuard CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| LanGuard CLAUDE.mdroypadina/LanGuard | Instructions file | 27 | 6d ago | MIT | C | 2,983 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,685 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| vscode model-prompts.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 2,022 | GitHub Copilot |