gitlab-file

gitlab-file is a skill for Claude Code, Codex from grandcamel/GitLab-Assistant-Skills. It costs 56 tokens per session (2,904 once invoked), scanned A, original, MIT.

GitLab repository file access through the GitLab API, which lets an agent work with files stored online rather than only local files.

In plain words
What is it for?
Reading file details or raw contents, checking file history by line, and creating, updating, or deleting files in GitLab repositories.
Why use it?
It avoids manually opening GitLab or assembling API requests to inspect or change repository files. It also provides blame information showing who changed lines.

Skill for Claude CodeCodex

Part of the gitlab-assistant-skills plugin — 19 skills, 3 commands shipped together

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.

agentmods
npx agentmods add skills/grandcamel/gitlab-assistant-skills/gitlab-file
Any agent
npx skills add grandcamel/GitLab-Assistant-Skills --skill gitlab-file
Clone the repo
git clone --depth 1 https://github.com/grandcamel/GitLab-Assistant-Skills

Made for: Claude Code, Codex.

Or install gitlab-assistant-skills, the plugin that ships this one along with the rest of its 19 skills, 3 commands.

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 gitlab-file

README.md
[![agentmods](https://agentmods.dev/badge/skills/grandcamel/gitlab-assistant-skills/gitlab-file.svg)](https://agentmods.dev/skills/grandcamel/gitlab-assistant-skills/gitlab-file)
Your own site
<a href="https://agentmods.dev/skills/grandcamel/gitlab-assistant-skills/gitlab-file"><img src="https://agentmods.dev/badge/skills/grandcamel/gitlab-assistant-skills/gitlab-file.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,904 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00056 $0.02904
Opus 5 $0.00028 $0.01452
Sonnet 5 $0.00011 $0.00581
Haiku 4.5 $0.00006 $0.00290

Measured 5d ago against content hash 8a57451ef32c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gitlab-file 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 5d 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.

skills/gitlab-file/SKILL.md · 319 lines

How it starts

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

File Skill

Repository file operations for GitLab using glab api raw endpoint calls.

Quick Reference

Operation Command Pattern Risk
Get file info glab api projects/:id/repository/files/:path?ref=:branch -
Get raw content glab api projects/:id/repository/files/:path/raw?ref=:branch -
Get blame glab api projects/:id/repository/files/:path/blame?ref=:branch -
Create file glab api projects/:id/repository/files/:path -X POST -f ... ⚠️
Update file glab api projects/:id/repository/files/:path -X PUT -f ... ⚠️
Delete file glab api projects/:id/repository/files/:path -X DELETE -f ... ⚠️⚠️

Risk Legend: - Safe | ⚠️ Caution | ⚠️⚠️ Warning | ⚠️⚠️⚠️ Danger

When to Use This Skill

ALWAYS use when:

  • User wants to read file content from GitLab (not local)
  • User wants to create/update/delete files via GitLab API
  • User needs file blame information
  • User wants to download raw file content
  • User mentions "repository file", "blob", "raw content"

NEVER use when:

  • User wants to edit local files (use file editing tools)
  • User wants to search code (use gitlab-search)
  • User wants to browse repository tree (use gitlab-repo)
  • User wants to commit multiple files (use git locally)

API Prerequisites

Required Token Scopes: api

Permissions:

  • Read files: Reporter+ (for private repos)
  • Create/update/delete files: Developer+ (need push access)

URL Encoding

File paths must be URL-encoded. Slashes in paths become %2F:

# src/main.py -> src%2Fmain.py
echo 'src/main.py' | jq -Rr @uri
# Output: src%2Fmain.py

Available Commands

Get File Info (Base64 Encoded)

# Get file metadata and content (base64)
glab api "projects/123/repository/files/README.md?ref=main" --method GET

# With URL-encoded path
glab api "projects/123/repository/files/$(echo 'src/main.py' | jq -Rr @uri)?ref=main"

# From specific branch
glab api "projects/123/repository/files/config.json?ref=develop" --method GET

# From tag
glab api "projects/123/repository/files/version.txt?ref=v1.0.0" --method GET

# From commit SHA
glab api "projects/123/repository/files/app.py?ref=abc123" --method GET

Read the full file on GitHub · 319 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. 5d ago First seen · 319 lines · 56 tokens per session scan A 8a57451ef32c

Subscribe to this mod's changes

gitlab-file is a skill published in the GitHub repository grandcamel/GitLab-Assistant-Skills (4 stars, last pushed 7mo ago), licensed MIT. It adds 56 tokens to every session and 2,904 once invoked, about $0.0003 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

code-gauntlet

Prefer this skill for code review requests — it runs a multi-agent pipeline with blind challenge verification for high-confidence results. Trigger for ANY of these situations: (1) user says "review" in the context of code, PRs, MRs, branches, diffs, or changes, (2) user references a PR/MR number and wants feedback or…

liatrio-labs/claude-code-gauntlet · 218 tokens

build-review-md

Use this skill when the user wants to create or set up a REVIEW.md configuration file for their repository. Trigger for ANY of these: (1) user says "create REVIEW.md", "set up REVIEW.md", or "configure review rules", (2) code-gauntlet Phase 2d detects no REVIEW.md and suggests creating one, (3) user wants to customize…

liatrio-labs/claude-code-gauntlet · 171 tokens

asana-sweep

Scheduled sweep of incomplete Asana tasks assigned to you — triage into auto/ask/skip, dedupe against existing work, then call asana-to-harness to open GitLab issues that trigger an AI coding harness. Built for headless scheduled runs (claude -p); also runs interactively, with --dry-run support.

YCyrus/asana-sweep · 72 tokens

asana-to-harness

Turn one Asana task into an implementation plan for an AI coding harness, open a GitLab issue with the plan as its description, and leave a trigger comment (e.g. @claude). Used standalone ("turn this Asana task into a harness issue") or invoked by the asana-sweep skill.

YCyrus/asana-sweep · 68 tokens

create-site

Creates a new Power Pages code site (SPA) using React, Angular, Vue, or Astro. Guides through the full process from initial concept to deployed site: requirements discovery, scaffolding, component planning, design, implementation, validation, and deployment. Use when the user wants to create, build, or scaffold a new…

microsoft/power-platform-skills · 73 tokens

review

5-pass structured code review — correctness, security, performance, readability, consistency.

SethGammon/Citadel · 17 tokens