Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Context Audit

ASecurity

Report what's consuming your Claude Code context window — token estimates, loaded files, MCP servers

8 stars
0 votes
0 copies
0 views
Added 9/20/2026
devopsshellbash

Works with

claude codemcp

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add tstapler/dotfiles --skill context-audit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Context Audit?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Context Audit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tstapler-context-audit-dotfiles/badge)](https://www.skillsdirectory.com/skills/tstapler-context-audit-dotfiles)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
description: Report what's consuming your Claude Code context window — token estimates, loaded files, MCP servers
---

# Context Budget Audit

Context is a finite budget. This command reports what's consuming it and surfaces opportunities to trim.

## Step 0: Locate Key Paths

The Logseq wiki is at `~/Documents/personal-wiki/logseq` by default. A shell function `logseq_path` (defined in `~/.shell/functions.sh`) returns the path, respecting the `$LOGSEQ_PATH` env var override if set. The wiki root (one level up) is returned by `wiki_path`.

```bash
# If the shell function is available:
source ~/.shell/functions.sh && logseq_path   # → ~/Documents/personal-wiki/logseq
source ~/.shell/functions.sh && wiki_path     # → ~/Documents/personal-wiki
```

Default fallbacks if shell functions unavailable:
- **Logseq library**: `~/Documents/personal-wiki/logseq`
- **Wiki root**: `~/Documents/personal-wiki`
- **Today's journal**: `$(wiki_path)/logseq/journals/$(date +%Y_%m_%d).md`

## Step 1: Measure Always-Loaded Files

Use word count to estimate tokens (1 token ≈ 0.75 words, so words × 1.33 ≈ tokens):

```bash
wc -w ~/.claude/CLAUDE.md ~/.claude/skills-index.md ~/.claude/STAPLER.md 2>/dev/null
wc -w ~/.claude/projects/*/memory/MEMORY.md 2>/dev/null | tail -5
```

Also check the project-local CLAUDE.md if in a project:
```bash
wc -w CLAUDE.md 2>/dev/null
```

## Step 2: Count Skills

```bash
ls ~/.claude/skills/ | wc -l
ls ~/.claude/commands/ -R | grep "\.md$" | wc -l
```

## Step 3: Check MCP Servers

Read `~/.claude/settings.json` or `~/.claude/claude_desktop_config.json` (whichever exists) and count configured MCP servers.

## Step 4: Build Report

Output a formatted table:

```
=== Context Budget Report ===

Always-Loaded Files
───────────────────
~/.claude/CLAUDE.md          ~XXX tokens
~/.claude/skills-index.md    ~XXX tokens
~/.claude/STAPLER.md         ~XXX tokens  (if present)
MEMORY.md (global)           ~XXX tokens
MEMORY.md (project)          ~XXX tokens  (if present)
Project CLAUDE.md            ~XXX tokens  (if in project)
───────────────────
Subtotal (always loaded):    ~XXXX tokens

Registered Resources
────────────────────
Skills available:            XX files
Commands available:          XX files
MCP servers:                 XX configured

Total context overhead:      ~XXXX tokens
Estimated % of 200k budget:  X.X%

=== Recommendations ===
[Generated based on findings]
```

## Step 5: Generate Recommendations

Apply these rules to generate recommendations:

- **If CLAUDE.md > 3000 tokens**: "Consider using `@`-references to external files instead of inline content. Run `/meta:refine-claude-md` to compress."
- **If skills-index.md > 4000 tokens**: "skills-index.md is large. Consider splitting into domain-specific index files loaded conditionally."
- **If STAPLER.md > 5000 tokens**: "STAPLER.md is large. Consider a 1-page summary version for always-loaded context."
- **If MEMORY.md > 2000 tokens**: "MEMORY.md is approaching the 200-line limit. Archive older entries to a dated topic file."
- **If total > 20,000 tokens**: "Always-loaded context exceeds 10% of a 200k window. This will consistently crowd out working context."
- **If total < 8,000 tokens**: "Context overhead is healthy. No action needed."

## Output Format

Use this structure:
1. The metrics table (always)
2. A brief "what's largest" callout
3. Numbered recommendations (only if issues found)
4. A one-line summary verdict: healthy / watch / trim needed

Attribution

tstaplertstapler
View sourceMore from tstapler →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Terraform Module Library

Build reusable Terraform modules for AWS, Azure, and GCP infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

393431 votes

sematext-otel

Wire a service's OpenTelemetry output to Sematext Cloud. Walks through region, App-type, instrumentation flow (managed OTLP endpoint vs Sematext Agent), and signal selection (traces/metrics/logs), then produces the exact env-var block and points at a runnable reference example in this repo. Invoke when instrumenting a new app for Sematext.

01 votes

Deployment Patterns

Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications. Use when setting up deployment infrastructure or planning releases.

2459130 votes

Babysit

Watch a pull request or review cycle until it is ready to merge. Use when asked to babysit, monitor, or keep checking PR comments, reviews, and CI until all actionable issues are resolved.

942310 votes

V7 Roster

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

805540 votes
View all in devops →