detect-repo-host

detect-repo-host is a skill for Claude Code from sgaunet/claude-plugins. It costs 42 tokens per session (2,860 once invoked), scanned A, original, MIT.

A helper that reads a Git remote—the address connecting a local repository to its online copy—and identifies whether it is hosted on GitHub, GitLab, or Forgejo.

In plain words
What is it for?
It is for finding the hosting service, server name, owner, repository path, and API address needed by platform-specific commands.
Why use it?
It prevents other tools from using the wrong hosting service or repository address when working with a project online.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool; positional $N argument.

Part of the software-engineering plugin — 4 skills, 12 commands, 7 agents shipped together

Good fit It is for finding the hosting service, server name, owner, repository path, and API address needed by platform-specific commands.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sgaunet/claude-plugins/detect-repo-host
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 sgaunet/claude-plugins --skill detect-repo-host
Clone the repo
git clone --depth 1 https://github.com/sgaunet/claude-plugins

Made for: Claude Code.

Or install software-engineering, the plugin that ships this one along with the rest of its 4 skills, 12 commands, 7 agents.

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 detect-repo-host

README.md
[![agentmods](https://agentmods.dev/badge/skills/sgaunet/claude-plugins/detect-repo-host/github.svg)](https://agentmods.dev/skills/sgaunet/claude-plugins/detect-repo-host)
Your own site
<a href="https://agentmods.dev/skills/sgaunet/claude-plugins/detect-repo-host"><img src="https://agentmods.dev/badge/skills/sgaunet/claude-plugins/detect-repo-host/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 detect-repo-host

Your own site · 80×15
<a href="https://agentmods.dev/skills/sgaunet/claude-plugins/detect-repo-host"><img src="https://agentmods.dev/badge/skills/sgaunet/claude-plugins/detect-repo-host.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,860 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00042 $0.02860
Opus 5 $0.00021 $0.01430
Sonnet 5 $0.00008 $0.00572
Haiku 4.5 $0.00004 $0.00286

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

Security

Grade A, and why

detect-repo-host 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.

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.

plugins/software-engineering/skills/detect-repo-host/SKILL.md · 260 lines

How it starts

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

Detect Repository Host Skill

Detect the repository hosting service from git remote configuration and extract structured metadata for platform-aware command routing.

Overview

Many commands need to determine whether the current repository is hosted on GitHub, GitLab, or Forgejo to route CLI calls correctly. This skill centralizes that detection logic so commands can invoke it via the Skill tool instead of duplicating git remote -v parsing.

When to Use

  • Before calling GitHub, GitLab, or Forgejo CLI tools that require owner/repo or project_path
  • When a command needs to branch logic based on hosting platform
  • Any workflow requiring platform-aware routing

Workflow

Step 1: Read Git Remotes

git remote -v

Parse the output to find the origin remote. If origin is not set, prefer a remote named upstream before falling back to the first available one, and say which one you picked.

Step 2: Parse Remote URL

Support both SSH and HTTPS URL formats:

SSH formats (scp-style):

[email protected]:owner/repo.git
[email protected]:group/subgroup/project.git
[email protected]:group/project.git
[email protected]:owner/repo.git

SSH formats (ssh:// scheme, may include a custom port):

ssh://[email protected]/owner/repo.git
ssh://[email protected]:2222/sylvain/mountain-blog-test.git

HTTPS formats:

https://github.com/owner/repo.git
https://gitlab.com/group/subgroup/project.git
https://gitlab.self-hosted.example.com/group/project.git
https://git.sylvlab.fr/owner/repo.git

Parsing rules:

  1. Strip trailing .git suffix if present
  2. Strip a trailing / if present. Do this before splitting path segments — otherwise .../group/project/ yields an empty last segment and repo comes back blank.
  3. Extract hostname from URL:
    • scp-style ([user@]host:path): hostname is between @ (if present) and the first :.
    • ssh://[user@]host[:port]/path: strip the ssh:// scheme and any user@, then the hostname is up to the next / or :drop the :<port> segment (e.g. :2222); it is not part of the path.
    • https://[user[:password]@]host/path: drop the https:// scheme, then take everything up to the first / as the authority. If the authority contains @, keep only what follows the last @ — credentials are not part of the hostname. This matters for tokenised CI remotes such as https://x-access-token:[email protected]/owner/repo.git, which otherwise produce the hostname x-access-token:[email protected] and fail the platform lookup in Step 3. Drop a :<port> suffix here too.
  4. Extract path segments after the hostname (after the : for scp-style, after the host[:port] for ssh://, after the host for HTTPS). The port number is never an owner/path segment.

Read the full file on GitHub · 260 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. 9d ago First seen · 260 lines · 42 tokens per session scan A 76c25efa2ac7

Subscribe to this mod's changes

detect-repo-host is a skill published in the GitHub repository sgaunet/claude-plugins (16 stars, last pushed 7d ago), licensed MIT. It adds 42 tokens to every session and 2,860 once invoked, about $0.0002 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 skills, from other repositories

review-pr

Review a Pull Request in one of two postures: an expository "tour guide" that walks through changes in logical order, or an adversarial audit that assumes the change is wrong until proven safe and hunts for the failure mode. Triggers: "review PR #123", "adversarial review", "walk me through this PR", "PR tour guide"…

jontsai/claude-plugins · 139 tokens

release-notes

Generate user-facing release notes from tickets, PRDs, or changelogs. Creates clear, engaging summaries organized by category (new features, improvements, fixes). Use when writing release notes, creating changelogs, announcing product updates, or summarizing what shipped.

phuryn/pm-skills · 57 tokens

glab

Expert guidance for using the GitLab CLI (glab) to manage GitLab issues, merge requests, CI/CD pipelines, repositories, and other GitLab operations from the command line. Use this skill when the user needs to interact with GitLab resources or perform GitLab workflows.

NikiforovAll/claude-code-rules · 59 tokens

version-bump

This skill automates version bumping during the release process for the Claude Code Handbook monorepo. It should be used when the user requests to bump versions, prepare a release, or increment version numbers across the repository.

NikiforovAll/claude-code-rules · 48 tokens

commit-message

Use ANY time the user signals they want to commit staged changes — including bare "commit", "/commit", "commit this", "commit these changes", "let's commit", "make a commit", "git commit", "write a commit message", "make a conventional commit", "use conventional commits", or any equivalent phrasing in context (e.g.…

netopsengineer/axiom · 218 tokens

spring-clean

Deep-clean and simplify a whole repo or codebase, then leave guardrails so it stays clean. Delete dead surfaces, gitignore build artifacts, relocate dev docs, notes, clones and dumps to the project's workspace repo (the assistant-dev home base), split oversized files and functions, unify duplicated logic, draw package…

smk-labs/claude-plugins · 226 tokens