By xiaolai
Enforce per-file pure LOC limits with automated optimization strategies — counts, flags violations, and provides opus-powered extraction plans
Use this agent to count lines of code and produce LOC statistics reports with file size limit enforcement. <example> Context: User wants to see code metrics for their project. user: "/loc-guardian:scan" assistant: "I'll use the counter agent to count lines of code." <commentary> Standard scan request — count all languages in the current directory. </commentary> </example> <example> Context: User wants LOC for a specific language. user: "/loc-guardian:scan python" assistant: "I'll use the counter agent to count Python lines of code." <commentary> Language-filtered scan — only count Python files. </commentary> </example>
Use this agent to analyze over-limit files and provide concrete optimization strategies. This agent is called by the scan command when files exceed the pure LOC limit. It reads the actual file contents and suggests specific extractions. <example> Context: counter found files over the LOC limit. assistant: "I'll use the optimizer agent to analyze the over-limit files and suggest optimizations." <commentary> The counter flagged violations. The optimizer reads each file and provides line-level extraction suggestions. </commentary> </example> <example> Context: counter's loc-data block contains only WARN lines (no OVER lines) — files are in the 80%+ warning zone but none have exceeded the limit. assistant: "No files are over the limit, but some are in the warning zone. I'll run the lighter warning-zone analysis — reading each WARN file and noting one obvious extraction candidate per file to prevent it from going over." <commentary> No OVER files — optimizer runs lighter WARN-only pass per the documented workflow. Per Step 3, each warning-zone file gets a single-line suggestion with one extraction candidate, rather than the full extraction + optimization report reserved for over-limit files. </commentary> </example>
Uses power tools
Uses Bash, Write, or Edit tools
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Enforce per-file pure LOC limits with automated optimization strategies.
| Command | Description |
|---|---|
/loc-guardian:init | Configure LOC limit and extraction rules for your project |
/loc-guardian:scan | Count LOC, check limits, get optimization strategies |
/loc-guardian:scan python | Count only Python files |
/loc-guardian:scan src/ | Count only files under src/ |
Part of the xiaolai plugin marketplace.
Install tokei:
brew install tokei
Add the marketplace (once):
/plugin marketplace add xiaolai/claude-plugin-marketplace
Then install:
/plugin install loc-guardian@xiaolai
Install fails with "Plugin not found in marketplace 'xiaolai'"? Your local marketplace clone is stale. Run
claude plugin marketplace update xiaolaiand retry —plugin installdoes not auto-refresh.
| Scope | Command | Effect |
|---|---|---|
| User (default) | /plugin install loc-guardian@xiaolai | Available in all your projects |
| Project | /plugin install loc-guardian@xiaolai --scope project | Shared with team via .claude/settings.json |
| Local | /plugin install loc-guardian@xiaolai --scope local | Only you, only this repo |
Run /loc-guardian:init in your project to set your LOC limit and extraction rules
/loc-guardian:init creates .claude/loc-guardian.local.md in your project:
---
max_pure_loc: 350
---
## Extraction Rules
- [What to extract] → `[target file pattern]`
- [What to extract] → `[target file pattern]`
The extraction rules are yours — tailored to your language, framework, and conventions.
ISC
npx claudepluginhub xiaolai/claude-plugin-marketplace --plugin loc-guardianNatural-Language Programming Manager — score, check, fix, and test NL artifacts across Claude Code, Codex CLI, and Antigravity. Tier-aware scoring with per-tool overlays.
A 260-token system prompt that overrides three structural presumptions every RLHF-trained LLM inherits from training: that you want confirmation, that old scarcity still applies, that best practices are ceilings.
English language coach for non-native speakers — auto-corrects prompts, translates non-English, refines with :: prefix, tracks improvement over time
One plugin to bridge and delegate across Claude Code, Codex CLI, and Gemini CLI — single-source AGENTS.md, shared skills, mirrored hooks and MCP servers, and full Claude↔Codex bidirectional delegation.
Auto-updated multi-skill reference for the whole Anthropic doc ecosystem. 8 skills covering claude-code, claude-agent-sdk, anthropic-api, anthropic-platform-features, claude-connectors, claude-cowork, mcp-spec, and anthropic-pulse (news + research digests). Pipeline refreshes daily.
Monitor code complexity and maintain code quality
Dead code analysis, duplication detection, complexity hotspots, and auto-fix for JavaScript/TypeScript using fallow
Lumin Repo Lens: evidence-backed TS/JS repo structure lens for Claude Code.
Find and remove dead code across the codebase
Structural codebase indexing for efficient navigation. Reduces token consumption by 60-80% through targeted line-range reads instead of full file scans.
Local codebase intelligence + change-safety gates for coding agents. Pre-indexes your repo's symbols, call graph, deps, and git history into SQLite (28 languages, 100% local, zero API keys), then exposes a lean 16-tool MCP core preset: graph-precise search, callers/impact blast radius, coupling, dead code, taint reachability, and pre-merge verify/critique gates that catch regressions, broken references, AI-slop duplication, and convention drift before they ship.