SkillAgentSearch skills...

Agent-MemGC

⚡ High-performance linter, cache-layout optimizer, and garbage collector for AI agent instruction files (AGENTS.md, CLAUDE.md, .cursorrules) in Rust.

Install / Use

claude mcp add ronitgupta138 -- npx -y github:ronitgupta138/Agent-MemGC

If the server publishes to npm under a different name, use that package instead — check the repo README.

About this skill
🔌

MCP Server

Model Context Protocol server

Quality Score

81/100

Supported Platforms

Claude Code
Claude Desktop
Cursor
OpenAI Codex

Our assessment of Agent-MemGC

Agent-MemGC scores 81/100 on our quality scale, 734th of 967 AI & Machine Learning skills we index.

Its MCP Server is 7.5 KB long, well organised into 17 sections with 9 code examples: a thorough specification that gives an agent plenty to work with.

It has 3 GitHub stars, so there is little community track record yet; judge it on its content.

Substance
29/30
Structure
20/20
Description
15/15
Adoption
3/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated today, so Agent-MemGC is actively maintained.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 92/100, with 1 caution from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.

Automated pattern scan on 2026-10-19. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

Agent-MemGC compared with similar skills

All 4 of these similar skills score higher than Agent-MemGC; compare them before choosing.

SkillScoreStarsUpdatedFormat
Agent-MemGC (this skill)by ronitgupta138813todayMCP Server
claude-memby thedotmack100101.7ktodayCLAUDE.md
Agent-Reachby Panniantong10099.2k3d agoCLAUDE.md
Understand-Anythingby Egonex-AI10086.9k6d agoCLAUDE.md
headroomby headroomlabs-ai10075.9k1d agoCLAUDE.md

Frequently asked questions

How do I install Agent-MemGC?
Run claude mcp add ronitgupta138 -- npx -y github:ronitgupta138/Agent-MemGC. The install tabs above show the steps for each supported agent.
Which AI agents does Agent-MemGC work with?
It is written for Claude Code, Claude Desktop, Cursor and OpenAI Codex, as a MCP Server file. Other agents that read the same format can often use it too.
Is Agent-MemGC safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is MIT-licensed and scores 92/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is Agent-MemGC still maintained?
The repository was last updated today, so Agent-MemGC is actively maintained.
<div align="center">
███╗   ███╗ ███████╗ ███╗   ███╗             ██████╗   ██████╗
████╗ ████║ ██╔════╝ ████╗ ████║            ██╔════╝  ██╔════╝
██╔████╔██║ █████╗   ██╔████╔██║   ██████   ██║  ███╗ ██║     
██║╚██╔╝██║ ██╔══╝   ██║╚██╔╝██║   ╚═════   ██║   ██║ ██║     
██║ ╚═╝ ██║ ███████╗ ██║ ╚═╝ ██║            ╚██████╔╝ ╚██████╗
╚═╝     ╚═╝ ╚══════╝ ╚═╝     ╚═╝             ╚═════╝   ╚═════╝

The Linter, Cache-Layout Optimizer & Generational Garbage Collector for AI Agent Instructions

GitHub Stars Crates.io Rust: 1.80+ License: MIT MCP Protocol Build Status Views Sponsor

Audit, clean, and deduplicate your AI instructions. Detects dead file paths, resolves contradictory rules, and eliminates prompt-cache-busting bloat.
Built for CLAUDE.md (Claude Code), AGENTS.md (Hermes Agent / OpenCode), .cursorrules (Cursor), and long-term memory files.

</div>

🎯 The Problem: Instruction Rot & Cache Invalidation

As developers collaborate with AI coding agents, project instructions degrade over weeks into unmaintainable technical debt:

  1. Dead File Path References (30%+): Referenced paths (src/utils/auth.ts, scripts/build.sh) were deleted or renamed weeks ago, triggering agent hallucination loops.
  2. Semantic Contradictions: Conflicting rules added across separate turns ("Keep components synchronous" vs "Use async server actions everywhere").
  3. Prompt Cache Destruction: Putting volatile dates, timestamps, or session IDs at the top of instruction files breaks Anthropic and OpenAI KV-cache prefix hits, doubling agent API token bills.
  4. Context Bloat: Accumulates transient debugging notes and duplicated rules that waste 400–1,500 tokens on every turn.

agent-memgc delivers a compiler-grade static analysis engine in pure Rust that audits, fixes, and compacts agent instructions in < 15ms.


⚡ Architectural Blueprint

+-----------------------------------------------------------------------------------+
|               Target Project: [AGENTS.md | CLAUDE.md | .cursorrules]               |
+-----------------------------------------------------------------------------------+
                                          |
                                          | `agent-memgc check` / `agent-memgc fix`
                                          v
+-----------------------------------------------------------------------------------+
|                           `agent-memgc` Systems Engine                            |
|                                                                                   |
|  [ Rule MGC001: Dead Path Verification ]                                          |
|  - Scans all backticked paths (`src/utils/auth.ts`, `scripts/build.sh`)           |
|  - Cross-references against live Git index and workspace filesystem               |
|  - Flags: "Warning: `src/old_api.py` referenced on line 42 does not exist."       |
|                                                                                   |
|  [ Rule MGC002: Semantic Contradiction Detector ]                                 |
|  - Detects diametrically opposing directives (tabs vs spaces, sync vs async)      |
|                                                                                   |
|  [ Rule MGC003: Prompt-Cache Layout Optimizer ]                                   |
|  - Analyzes token ordering: static architectural facts vs volatile guidelines     |
|  - Relocates volatile timestamps and session IDs to preserve KV-cache prefixes    |
|                                                                                   |
|  [ Rule MGC004: Token Bloat & Duplication Pruning ]                               |
|  - Deduplicates identical or near-verbatim instruction rules                      |
|  - Computes exact token savings: "Saved ~420 tokens per request"                  |
+-----------------------------------------------------------------------------------+
                                          |
                                          v
+-----------------------------------------------------------------------------------+
|                        High-Contrast Terminal HUD & Auto-Fix                      |
|  - Emits clean, contradiction-free, cache-optimized output                        |
+-----------------------------------------------------------------------------------+

🛠️ CLI Quickstart

1. Installation

Install directly via Cargo:

cargo install agent-memgc

2. Audit Instruction Files

# Check your project's AGENTS.md or CLAUDE.md
agent-memgc check AGENTS.md

# Output structured findings as JSON for CI/CD gates
agent-memgc check CLAUDE.md --json

3. Automatically Fix & Optimize

# Preview changes and estimated token savings without modifying disk
agent-memgc fix AGENTS.md --dry-run

# Automatically clean dead references, deduplicate rules, and optimize cache ordering
agent-memgc fix AGENTS.md

4. Health Grade & Quality Score

agent-memgc stats AGENTS.md

🔌 Model Context Protocol (MCP) Integration

agent-memgc runs as a native stdio Model Context Protocol (MCP) server for Claude Desktop, Cursor, and Hermes Agent.

Configuration (claude_desktop_config.json)

{
  "mcpServers": {
    "agent-memgc": {
      "command": "agent-memgc",
      "args": ["mcp"]
    }
  }
}

Available MCP Tools

  • lint_instructions: Audits instruction files for dead paths, contradictions, and cache invalidations.
  • fix_instructions: Automatically rewrites files to prune dead references and optimize cache layout.
  • lint_raw_prompt: Evaluates in-memory system prompts before dispatch to prevent conflicting constraints.

🧪 Verification & Benchmarks

Run the automated test suite:

cargo test
running 6 tests
test test_dead_path_detection ... ok
test test_semantic_contradiction_detection ... ok
test test_cache_layout_volatile_prefix_detection ... ok
test test_redundancy_and_duplicate_detection ... ok
test test_fixer_removes_dead_paths_and_duplicates ... ok
test test_mcp_tool_catalog ... ok

test result: ok. 6 passed; 0 failed; 0 ignored; finished in 0.04s
  • Execution Latency: < 12ms across 1,000 lines of Markdown instructions.
  • Average Token Reduction: 35% – 55% reduction in instruction token bloat.

📜 License

MIT License. Designed and engineered by Ronit Gupta.

Related Skills

View on GitHub
GitHub Stars3
CategoryAI
Updated15h ago
Forks0

Languages

Rust

Trust signals

92/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

1 low
Agent-MemGC — MCP Server: Install & Safety Check | SkillAgent