metagit-gating

metagit-gating is a skill for Claude Code, Codex from metagit-ai/metagit-cli. It costs 29 tokens per session (527 once invoked), scanned A, original, MIT.

A rule system that controls whether Metagit tools are available. Metagit is a workspace tool for managing related code repositories, and .metagit.yml is its workspace configuration file.

In plain words
What is it for?
It helps check the workspace root, validate the configuration, and report whether Metagit tools are missing, invalid, or active.
Why use it?
It keeps higher-risk repository and multi-repository tools disabled when the workspace configuration is missing or invalid.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit It helps check the workspace root, validate the configuration, and report whether Metagit tools are missing, invalid, or active.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/metagit-ai/metagit-cli/metagit-gating
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.

Any agent
npx skills add metagit-ai/metagit-cli --skill metagit-gating
Clone the repo
git clone --depth 1 https://github.com/metagit-ai/metagit-cli

Made for: Claude Code, Codex.

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 metagit-gating

README.md
[![agentmods](https://agentmods.dev/badge/skills/metagit-ai/metagit-cli/metagit-gating/github.svg)](https://agentmods.dev/skills/metagit-ai/metagit-cli/metagit-gating)
Your own site
<a href="https://agentmods.dev/skills/metagit-ai/metagit-cli/metagit-gating"><img src="https://agentmods.dev/badge/skills/metagit-ai/metagit-cli/metagit-gating/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.

agentmods 80×15 button for metagit-gating

Your own site · 80×15
<a href="https://agentmods.dev/skills/metagit-ai/metagit-cli/metagit-gating"><img src="https://agentmods.dev/badge/skills/metagit-ai/metagit-cli/metagit-gating.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 527 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00029 $0.00527
Opus 5 $0.00015 $0.00264
Sonnet 5 $0.00006 $0.00105
Haiku 4.5 $0.00003 $0.00053

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

Security

Grade A, and why

metagit-gating 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/gate-status.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.agents/skills/metagit-gating/SKILL.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Metagit MCP Gating Skill

Use this skill whenever you need to control whether Metagit MCP tools/resources are exposed.

Purpose

Ensure high-risk tooling and multi-repo context are only available when a valid .metagit.yml exists at the resolved workspace root.

Bundled scripts (optional)

Hermes skill_manage installs SKILL.md only. Resolve scripts from the package or a full metagit skills install:

SKILL_ROOT="$(python3 -c "import metagit, pathlib; print(pathlib.Path(metagit.__file__).parent / 'data/skills/metagit-gating')")"
"$SKILL_ROOT/scripts/gate-status.sh" [root_path]

Expected output (single line, tab-delimited):

  • state=<value>\troot=<path|none>\ttools=<count>

Inline CLI fallback (no scripts)

metagit mcp serve --status-once --root .
metagit config validate -c .metagit.yml

Parse mcp_state= from --status-once output (missing, invalid, or active).

Activation Workflow

  1. Resolve workspace root:
    • METAGIT_WORKSPACE_ROOT
    • CLI --root
    • upward directory walk
  2. Check for .metagit.yml in resolved root.
  3. Validate config through existing Metagit config models.
  4. Derive activation state: missing, invalid, or active.
  5. Register tool surface based on state.

Tool Exposure Contract

Inactive (missing or invalid config)

Expose only:

  • metagit_workspace_status
  • metagit_bootstrap_config_plan_only

Active (valid config)

Expose full set:

  • metagit_workspace_status
  • metagit_workspace_index
  • metagit_workspace_search
  • metagit_upstream_hints
  • metagit_repo_inspect
  • metagit_repo_sync
  • metagit_bootstrap_config

Error Handling

  • Return explicit, machine-readable state and reason.
  • Avoid stack traces in user-facing outputs.
  • Log parser/validation errors with enough detail for debugging.

Safety Rules

  • Never expose mutation-capable tools in inactive state.
  • Never operate outside validated workspace boundaries.
  • Keep defaults read-only unless user/agent explicitly opts in.

Read the full file on GitHub · 76 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 76 lines · 29 tokens per session scan A a1e9306cb977

Subscribe to this mod's changes

metagit-gating is a skill published in the GitHub repository metagit-ai/metagit-cli (3 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 527 once invoked, about $0.0001 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-31.

Related

Other skills, from other repositories