LanGuard CLAUDE.md

LanGuard CLAUDE.md is an instructions file for Claude Code from roypadina/LanGuard. It costs 1,190 tokens per session, scanned A, original, MIT.

Technical instructions for LanGuard, a macOS menu-bar app that turns Wi-Fi off when a wired network connects and back on when it disconnects.

In plain words
What is it for?
Building, testing, and running LanGuard, including network-interface detection, connection monitoring, Wi-Fi control, and user notifications.
Why use it?
They describe the app's structure and handle confusing network events, such as brief connection changes while a Mac sleeps or wakes.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/roypadina/languard/claude-md
Clone the repo
git clone --depth 1 https://github.com/roypadina/LanGuard

Made for: Claude Code.

Wrote 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.

agentmods badge for LanGuard CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/roypadina/languard/claude-md.svg)](https://agentmods.dev/instructions/roypadina/languard/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/roypadina/languard/claude-md"><img src="https://agentmods.dev/badge/instructions/roypadina/languard/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,190 This file is loaded in full into every session.
When invoked 1,190 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.01190 $0.01190
Opus 5 $0.00595 $0.00595
Sonnet 5 $0.00238 $0.00238
Haiku 4.5 $0.00119 $0.00119

Measured 6d ago against content hash d99f57b9210d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

LanGuard CLAUDE.md scanned grade A with 0 findings 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 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 Window, AppDelegate starts AppModel.
  • 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).
    • NetworkMonitorSCDynamicStore callbacks (link/IPv4) + NSWorkspace sleep/wake; per-interface link reads (SC kSCPropNetLinkActive, ifconfig fallback). Flap guard: ignores link changes while asleep (willSleepNotificationsuspended), waits a settle interval after didWakeNotification before 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 — CoreWLAN setPower / powerOn (no sudo, no shell).
    • NotifierUNUserNotificationCenter wrapper; banners on Wi-Fi toggle (needs OS permission, requested on launch).
    • Log — opt-in file logger. When debugLoggingEnabled (Settings → Debug) is on, appends timestamped events to ~/Library/Logs/LanGuard/languard.log (rotates at ~1MB, one backup). Log.write is 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.
    • MenuIconMenuState (lan/wifi/paused, pure mapping) + MenuIconStyle (icon / icon+label / label) + MenuBarLabel view used as the MenuBarExtra label.
    • ToggleEngineedge-based decision logic, dependencies injected → testable.
    • AppSettings — UserDefaults. Physical wired + Wi-Fi = opt-out (disabledWired/disabledWiFi); virtual wired = opt-in (enabledVirtual, off by default). notificationsEnabled, menuIconStyle.
    • LoginItem / LegacyCleanup — SMAppService login item (self-healing, see below); removes legacy LaunchAgent.
    • AppModel — wires everything; singleton AppModel.shared. setWiFiPower is idempotent — only toggles interfaces whose power actually differs and only posts the banner when something really changed.
    • ViewsMenuContent (menu), ConfigView (settings window; virtual adapters get a "virtual" badge).
  • Config/ — xcconfig + entitlements. Un-sandboxed (CoreWLAN power + launchctl), ad-hoc signed, LSUIElement=YES (no Dock icon).

Read the full file on GitHub · 56 lines

Changes

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.

  1. 6d ago First seen · 56 lines · 1,190 tokens per session scan A d99f57b9210d

Subscribe to this mod's changes

LanGuard CLAUDE.md is an instructions file published in the GitHub repository roypadina/LanGuard (22 stars, last pushed 2mo ago), licensed MIT. It adds 1,190 tokens to every session, about $0.0060 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories