Agent skill

Claude Code Mastery

by borghei in borghei/Claude-Skills

A skill your agent uses when the user asks to "optimize CLAUDE.md", "create a new skill", "write a custom agent", "configure hooks", "manage context window", "set up MCP servers", "scaffold a skill…

MITAuto-check passedAgent Workflows

Install Claude Code Mastery

skills CLI
$ npx skills add borghei/Claude-Skills --skill claude-code-mastery -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install borghei/Claude-Skills claude-code-mastery --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/borghei/Claude-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/engineering/claude-code-mastery .claude/skills/claude-code-mastery && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
claude-code-mastery
GitHub stars
874
Token cost
~1.9k tokens
SKILL.md length
674 words
Files
12 (incl. scripts, references, assets)
Skills in repo
364
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when the user asks to "optimize CLAUDE.md", "create a new skill", "write a custom agent", "configure hooks", "manage context window", "set up MCP servers", "scaffold a skill…

  • The user asks to optimize CLAUDE.md
  • SKILL.md covers Core Capabilities, When to Use, Clarify First and Quick Start, plus 4 more sections
  • Runs Python scripts from its folder; calls python
  • Create a new skill

What it does

Claude Code Mastery is an agent skill from borghei/Claude-Skills. Use when the user asks to "optimize CLAUDE.md", "create a new skill", "write a custom agent", "configure hooks", "manage context window", "set up MCP servers", "scaffold a skill package", "analyze token budget", "create subagents", "configure permissions", "set up worktrees", or "integrate Claude Code with editors". Covers Claude Code CLI mastery, skill authoring, context engineering, hooks automation, subagent creation, and development workflow optimization.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 14 other files, including scripts, reference files and assets (for example `assets/agent-template.md`, `assets/skill-template.md` and `references/hooks-cookbook.md`).

It sits in Agent Workflows, covering Context engineering, Subagents and LLM cost and token optimization. It works with Model Context Protocol. The repository describes itself as: 385 AI skills, 77 expert agents, and 900 stdlib Python tools for every team: engineering, PM, marketing, C-level, compliance, business ops, research, and a LinkedIn toolkit… The licence is MIT.

When your agent uses it

  • The user asks to optimize CLAUDE.md
  • Create a new skill
  • Write a custom agent
  • Configure hooks

Example prompts

  • “optimize CLAUDE.md”
  • “create a new skill”
  • “write a custom agent”
  • “/claude-code-mastery”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit c9a1487. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Claude Code Mastery loads about 1.9k tokens when it runs, and up to ~19k if it reads all its reference files. Until then it costs about 121 tokens; SKILL.md has 674 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~121
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~19k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from borghei/Claude-Skills at commit c9a1487, republished under its MIT licence (© borghei). 674 words, ~1,935 tokens.

Download SKILL.mdSave it as .claude/skills/claude-code-mastery/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
claude-code-mastery
description
Use when the user asks to "optimize CLAUDE.md", "create a new skill", "write a custom agent", "configure hooks", "manage context window", "set up MCP servers", "scaffold a skill package", "analyze token budget", "create subagents", "configure permissions", "set up worktrees", or "integrate Claude Code with editors". Covers Claude Code CLI mastery, skill authoring, context engineering, hooks automation, subagent creation, and development workflow optimization.
license
MIT
metadata.version
1.1.0
metadata.author
borghei
metadata.category
engineering
metadata.domain
development-tools
metadata.updated
2026-06-17
metadata.tags
claude-code, skill-authoring, subagents, hooks

Claude Code Mastery

Expert skill for Claude Code CLI -- CLAUDE.md optimization, skill authoring, subagent creation, hooks automation, and context engineering.

Keywords: claude-code, claude-cli, CLAUDE.md, skill-authoring, subagents, hooks, context-window, token-budget, MCP-servers, worktrees, permission-modes, prompt-engineering, context-engineering, slash-commands

Core Capabilities

  • CLAUDE.md optimization — audit, restructure, compress, and hierarchize config files for token efficiency.
  • Skill authoring — scaffold and write discoverable skill packages with correct layout and frontmatter.
  • Subagent creation — write .claude/agents/<name>.md files with a tools allowlist and a Markdown-body system prompt.
  • Hooks automation — wire PreToolUse/PostToolUse/Stop lifecycle scripts via .claude/settings.json.
  • Context engineering — measure and manage the context-window token budget across a codebase.

When to Use

  • Authoring, structuring, or optimizing a CLAUDE.md file for any project.
  • Scaffolding a new skill package or creating a Claude Code subagent.
  • Configuring hooks for automated quality, security, or workflow steps.
  • Auditing and reducing context-window consumption.

Clarify First

Before scaffolding or optimizing, confirm these inputs. If any is unknown or vague, ASK — do not assume:

  • Which task — scaffold a new skill, optimize a CLAUDE.md, create a subagent, or analyze context budget (selects skill_scaffolder.py vs claudemd_optimizer.py vs context_analyzer.py)
  • Target identity — for a new skill: its name, domain, and one-line description; for optimization: the file or project path (the inputs the scripts require)
  • Token budget — the target ceiling (sets --token-limit and what counts as over-budget)

Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.

Quick Start

bash
# Scaffold a new skill package
python scripts/skill_scaffolder.py my-new-skill --domain engineering --description "Brief description"

# Analyze and optimize an existing CLAUDE.md
python scripts/claudemd_optimizer.py path/to/CLAUDE.md

# Estimate context window usage across a project
python scripts/context_analyzer.py /path/to/project

# All tools support JSON output
python scripts/claudemd_optimizer.py CLAUDE.md --json

Tools

ToolPurposeCommand
skill_scaffolder.pyScaffold a new skill package with correct structure + frontmatterpython scripts/skill_scaffolder.py my-skill -d engineering --description "Does X"
claudemd_optimizer.pyScore a CLAUDE.md for structure, tokens, and redundancy with recommendationspython scripts/claudemd_optimizer.py CLAUDE.md --token-limit 4000
context_analyzer.pyEstimate context-window consumption by file category with a budget breakdownpython scripts/context_analyzer.py /path/to/project --max-depth 4

All tools support --json. See references/tool-reference.md for full parameter tables and output formats.

References

Load the reference that matches the task — keep this file lean and pull detail on demand:

  • references/workflows.md — the five numbered playbooks: optimize a CLAUDE.md, author a skill, create a subagent, configure hooks, and manage the context budget. Read when executing any of those tasks step-by-step.
  • references/quick-reference.md — slash commands, permission modes, CLAUDE.md loading order, MCP servers, the troubleshooting table, and success criteria. Read for at-a-glance lookups or when debugging configuration.
  • references/tool-reference.md — full parameter tables and output formats for the three Python tools. Read when scripting the tools or interpreting their JSON output.
  • references/skill-authoring-guide.md — comprehensive reference for writing effective skills, from YAML frontmatter to structure. Read when authoring a skill in depth.
  • references/subagent-patterns.md — guide to creating and using subagents for parallel work and scoped tasks. Read when designing a subagent.
  • references/hooks-cookbook.md — practical hook recipes for code quality, security enforcement, and workflow automation. Read when building hooks.

Templates: assets/skill-template.md, assets/agent-template.md

Show full SKILL.md (217 more words)Show less

Scope & Limitations

This skill covers:

  • Authoring, structuring, and optimizing CLAUDE.md files for any project
  • Scaffolding new skill packages with correct directory layout and frontmatter
  • Creating and configuring Claude Code subagents with scoped tool access
  • Analyzing and managing context window token budgets across a codebase

This skill does NOT cover:

Integration Points

SkillIntegrationData Flow
senior-architectArchitecture decisions inform CLAUDE.md structure sectionsArchitecture diagrams and patterns feed into the Architecture Overview section of CLAUDE.md
code-reviewerSubagent creation for automated code reviewClaude Code Mastery creates the agent .md file; Code Reviewer provides the review logic
senior-prompt-engineerPrompt optimization for skill descriptions and agent instructionsPrompt engineering techniques improve YAML frontmatter trigger phrases and agent system prompts (the agent file body)
doc-drift-detectorDetects when CLAUDE.md drifts out of sync with the codebaseContext Analyzer output feeds drift detection; drift findings trigger CLAUDE.md optimization
context-engineAdvanced context management strategiesContext Analyzer provides token budgets; Context Engine applies compression and prioritization
senior-secopsSecurity hooks and permission mode configurationSecOps policies define which tools to deny; Claude Code Mastery configures the permission allowlists

© borghei, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (scripts, references, assets) in engineering/claude-code-mastery of borghei/Claude-Skills.

  • SKILL.md
  • assets/agent-template.md
  • assets/skill-template.md
  • references/hooks-cookbook.md
  • references/quick-reference.md
  • references/skill-authoring-guide.md
  • references/subagent-patterns.md
  • references/tool-reference.md
  • references/workflows.md
  • scripts/claudemd_optimizer.py
  • scripts/context_analyzer.py
  • scripts/skill_scaffolder.py

Open the folder on GitHubat commit c9a1487

Compare with similar skills

Claude Code Mastery next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Claude Code Mastery compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Claude Code Mastery this skillborghei/Claude-Skills874—~1.9kAutomated safety check: PassMIT
Claude Code Mastery Squadohmyjahh/xquads-squads276—~1.1kAutomated safety check: PassMIT
Context Mode Output Sandboxmksglu/context-mode26k—~4.1kAutomated safety check: PassCustom licence
Context Mode for Antigravity CLImksglu/context-mode26k—~850Automated safety check: PassCustom licence
Agent Deckasheshgoplani/agent-deck1k—~1.7kAutomated safety check: PassMIT
Puppetmaster Agent Orchestrationprofessorpalmer/Puppetmaster467—~3.2kAutomated safety check: PassMIT

Similar skills

  • Claude Code Mastery Squad

    ohmyjahh/xquads-squads

    Routes a request to one of eight specialist agents covering hooks, skills, subagents, MCP integration and context engineering for Claude Code.

    276 GitHub stars~1.1k tokensUpdated 8 days ago
    Agent WorkflowsAuto-check passed
  • Context Mode Output Sandbox

    mksglu/context-mode

    Routes large command, file, API and browser output through context-mode tools so only the needed result enters the agent's context, instead of dumping it via Bash.

    26k GitHub stars~4.1k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Routing rules for using context-mode MCP tools in Antigravity CLI: sandboxed code runs, file analysis, indexed search and web fetches that keep large output out of the conversation.

    26k GitHub stars~850 tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Agent Deck

    asheshgoplani/agent-deck

    agent-deck, the terminal session manager for AI coding agents.

    1k GitHub stars~1.7k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Puppetmaster Agent Orchestration

    professorpalmer/Puppetmaster

    Operates and supervises Puppetmaster, a multi-agent orchestrator, through its MCP tools or CLI, picking the right verb for edits, reviews, audits and long-running jobs.

    467 GitHub stars~3.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Claude Docs Consultant

    centminmod/my-claude-code-setup

    Consult official Claude Code documentation from code.claude.com using selective fetching.

    2.7k GitHub stars~959 tokensUpdated 9 days ago
    Agent WorkflowsAuto-check passed

More from borghei/Claude-Skills

All 364 skills in this repo
  • Agents In The Team

    borghei/Claude-Skills

    Run delivery when AI coding and ops agents take tickets. An agent skill from borghei/Claude-Skills.

    874 GitHub stars~4.2k tokensUpdated today
    Auto-check passed
  • AI Content Disclosure

    borghei/Claude-Skills

    Check AI-generated marketing content and reviews for required disclosures under the EU AI Act, FTC rules and platform AI-label policies.

    874 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • AI Prototyping

    borghei/Claude-Skills

    Idea to AI-generated prototype to customer validation to engineering handoff.

    874 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Analytics Engineer

    borghei/Claude-Skills

    Analytics engineering across data modeling, dbt, transformation, and semantic layers.

    874 GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Ansoff Matrix

    borghei/Claude-Skills

    Ansoff Matrix — 4-quadrant framework for growth options: market penetration, market/product development, and diversification.

    874 GitHub stars~2.2k tokensUpdated today
    Auto-check passed
  • Brainstorm Okrs

    borghei/Claude-Skills

    OKR brainstorming and validation using the Radical Focus framework — outcome objectives, measurable key results, counter-metrics.

    874 GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Categories

Questions about Claude Code Mastery

What does Claude Code Mastery do?

A skill your agent uses when the user asks to "optimize CLAUDE.md", "create a new skill", "write a custom agent", "configure hooks", "manage context window", "set up MCP servers", "scaffold a skill…. Claude Code Mastery is an agent skill from borghei/Claude-Skills.md", "create a new skill", "write a custom agent", "configure hooks", "manage context window", "set up MCP servers", "scaffold a skill package", "analyze token budget", "create subagents", "configure permissions", "set up worktrees", or "integrate Claude Code with editors".

When should I use Claude Code Mastery?

Claude Code Mastery fits situations like: the user asks to optimize CLAUDE.md; create a new skill; write a custom agent; configure hooks.

How do I install Claude Code Mastery in Claude Code?

Run `npx skills add borghei/Claude-Skills --skill claude-code-mastery -a claude-code`. Or copy the skill folder (engineering/claude-code-mastery in borghei/Claude-Skills) into .claude/skills/claude-code-mastery in your project. Claude Code loads it when a task matches its description.

How do I install Claude Code Mastery in Codex?

Run `npx skills add borghei/Claude-Skills --skill claude-code-mastery -a codex`. Or copy the skill folder (engineering/claude-code-mastery in borghei/Claude-Skills) into .agents/skills/claude-code-mastery in your project. Codex loads it when a task matches its description.

Can I use Claude Code Mastery in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add borghei/Claude-Skills --skill claude-code-mastery -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/claude-code-mastery, .gemini/skills/claude-code-mastery, .github/skills/claude-code-mastery and .opencode/skills/claude-code-mastery in your project.

What does Claude Code Mastery need to run?

Going by SKILL.md and its folder, Claude Code Mastery needs Python for the scripts in its folder and the command-line tools its instructions call (python). Our summary lists: Python 3.

Does Claude Code Mastery access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Claude Code Mastery safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Claude Code Mastery use?

Claude Code Mastery is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Claude Code Mastery use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 17k tokens, read only when the agent opens those files.

What are the alternatives to Claude Code Mastery?

Skills that share tags, products or a category with Claude Code Mastery: Claude Code Mastery Squad (ohmyjahh/xquads-squads, 276 stars), Context Mode Output Sandbox (mksglu/context-mode, 26k stars), Context Mode for Antigravity CLI (mksglu/context-mode, 26k stars) and Agent Deck (asheshgoplani/agent-deck, 1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Claude Code Mastery?

borghei (a GitHub user) maintains it in borghei/Claude-Skills, which has 874 GitHub stars. The repository holds 364 skills in this directory. The repository was last updated on October 7, 2026.

Source: borghei/Claude-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.