view-file
FreeRuns bundled scriptsNot checkedFetch raw file content from GitHub URLs. Trigger when user shares a GitHub file link (https://github.com/user/repo/blob/main/file.go) and wants to view the…
About this skill
View GitHub Files
Fetch raw file content from GitHub URLs without HTML/JS clutter.
Prerequisites
GitHub CLI must be installed and authenticated:
gh auth status
When to Use
When a user shares a GitHub file URL like:
https://github.com/user/repo/blob/main/src/file.gohttps://github.com/user/repo/tree/v1.0/docs/README.md
Use this skill instead of WebFetch to get clean source code.
Helper Script
python3 scripts/view_github_file.py https://github.com/user/repo/blob/main/path/to/file.go
The script:
- Parses the GitHub URL to extract owner, repo, ref, and path
- Uses
gh apito fetch file content - Decodes base64-encoded response
- Returns clean source code
Supported URL Formats
https://github.com/{owner}/{repo}/blob/{ref}/{path}
https://github.com/{owner}/{repo}/tree/{ref}/{path}
Where {ref} can be a branch name, tag, or commit SHA.
Fallback (if script fails)
Parse the URL manually and use gh api:
# From URL: https://github.com/golang/go/blob/master/README.md
# Extract: owner=golang, repo=go, ref=master, path=README.md
gh api repos/golang/go/contents/README.md?ref=master --jq '.content' | base64 --decode
Or use raw.githubusercontent.com:
curl https://raw.githubusercontent.com/golang/go/master/README.md
Install view-file in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
FAQ
What does the view-file skill do?
Fetch raw file content from GitHub URLs. Trigger when user shares a GitHub file link (https://github.com/user/repo/blob/main/file.go) and wants to view the source code. Avoids HTML/JS clutter from WebFetch.
How do I install the view-file skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the view-file skill run scripts?
Yes, this skill bundles executable scripts. Review the source before installing.
Related skills
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
by Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
by Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
by Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
by Anthropic