github-content

A rule for retrieving files, history, branches, tags, and code from GitHub repositories through GitHub's dedicated tools.

In plain words
What is it for?
Use it whenever an agent needs to read GitHub files, inspect commits, list branches or tags, or search repository code.
Why use it?
It keeps GitHub access structured and tied to repository versions, while avoiding less reliable methods such as scraping web pages.

Cursor rule for Cursor

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 rules/basher83/lunar-claude/github-content
Clone the repo
git clone --depth 1 https://github.com/basher83/lunar-claude

Made for: Cursor.

Per session 850 This file is loaded in full into every session.
When invoked 850 The same file — it is already loaded in full.
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.00850 $0.00850
Opus 5 $0.00425 $0.00425
Sonnet 5 $0.00170 $0.00170
Haiku 4.5 $0.00085 $0.00085

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

Security

Grade A, and why

github-content 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 2d 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.

.cursor/rules/github-content.mdc · 120 lines

How it starts

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

GitHub Content Access Rules

Always Use GitHub MCP Tools for GitHub Content

When accessing content from GitHub repositories, ALWAYS use GitHub MCP tools instead of web scraping, Firecrawl, or other methods.

Why Use GitHub MCP Tools

  1. Purpose-built: Designed specifically for GitHub API access
  2. More reliable: Uses official GitHub API with proper authentication
  3. Better performance: Handles rate limits and caching automatically
  4. Structured data: Returns metadata (SHA, file size, URLs) along with content
  5. Version control: Can access specific commits, branches, or tags

Available GitHub MCP Tools

File and Directory Access

  • mcp_github_get_file_contents - Get file or directory contents
    • Use for: Reading files, listing directories, accessing specific commits/branches
    • Example: mcp_github_get_file_contents(owner="anthropics", repo="skills", path="mcp-builder/SKILL.md")

Repository Information

  • mcp_github_get_commit - Get commit details
  • mcp_github_list_commits - List commits in a branch
  • mcp_github_list_branches - List repository branches
  • mcp_github_list_tags - List repository tags

Code Search

  • mcp_github_search_code - Search code across repositories
  • mcp_github_search_repositories - Search for repositories

Pull Requests and Issues

  • mcp_github_get_pull_request - Get PR details
  • mcp_github_get_pull_request_files - Get files changed in PR
  • mcp_github_get_pull_request_diff - Get PR diff
  • mcp_github_list_issues - List repository issues
  • mcp_github_get_issue - Get issue details

When to Use GitHub MCP vs Other Tools

Use GitHub MCP For

  • Reading files from GitHub repositories
  • Listing directory contents
  • Accessing specific commits, branches, or tags
  • Searching code within GitHub
  • Getting PR/issue information
  • Any GitHub content access

Do NOT Use GitHub MCP For

  • Non-GitHub websites (use Firecrawl/web_search)
  • GitHub pages/docs sites (use Firecrawl if GitHub MCP doesn't work)
  • General web content

Read the full file on GitHub · 120 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. 2d ago First seen · 120 lines · 850 tokens per session scan A 06579bca3065

Subscribe to this mod's changes

github-content is a cursor rule published in the GitHub repository basher83/lunar-claude (22 stars, last pushed 2d ago), licensed MIT. It adds 850 tokens to every session, about $0.0042 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.