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 — 18 skills, 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 18 skills, 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.5 $0.00017 $0.01144
Sonnet 5.5 $0.00008 $0.00572
Haiku 4.5 $0.00004 $0.00286

Measured 3mo ago against content hash 76c25efa2ac7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 3mo 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. 3mo 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 (19 stars, last pushed 1mo ago), licensed MIT. It adds 42 tokens to every session and 2,860 once invoked, about $0.0002 per session on Opus 5.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

detect-repo-host compared with skills from other repositories

detect-repo-host next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
detect-repo-hostsgaunet/claude-pluginsSkill191mo agoMITA42Claude Code
release-notesphuryn/pm-skillsSkill28k22d agoMITA57Claude Code
glabNikiforovAll/claude-code-rulesSkill14328d agoApache-2.0A59Claude Code
version-bumpNikiforovAll/claude-code-rulesSkill14328d agoApache-2.0A48Claude Code
commit-messagenetopsengineer/axiomSkill52d agoMITA218Claude Code
creating-pr-from-branchqte77/claude-code-pluginsSkill3todayApache-2.0A43Claude Code
review-prjontsai/claude-pluginsSkill61mo agoMITA139Claude Code