소스 정보
- 저장소
- andrem-sec/psc-comet
- 최근 소스 활동
- 2026년 4월 1일 00:39
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/andrem-sec/psc-comet --skill context-budget명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | context-budget |
| description | Token audit across agents, skills, and MCP with cost optimization guidance |
| version | 0.1.0 |
| level | 2 |
| triggers | ["audit context usage","token budget","context cost","optimize context"] |
| context_files | ["context/project.md"] |
| steps | [{"name":"Inventory Collection","description":"Count skills, agents, MCP servers, and hooks"},{"name":"Token Estimation","description":"Estimate tokens per component category"},{"name":"Cost Calculation","description":"Calculate per-session cost at current model pricing"},{"name":"Bottleneck Identification","description":"Identify highest token consumers"},{"name":"Optimization Recommendations","description":"Suggest consolidation or reduction strategies"}] |
Token audit and cost optimization for Claude Code configurations. Identifies context bloat and suggests fixes.
Without context budgeting, you:
Context budgeting makes token consumption visible and actionable.
~300 tokens per skill, loaded only when invoked. Typically 1-3 per session = 600-1,500 tokens. Already efficient (on-demand loading).
~1,500 tokens per agent, loaded when spawned. Typically 1-2 per session = 1,500-3,000 tokens. Session-isolated. Consolidate if spawning 5+ per session.
Base cost per tool: ~500 tokens (tool schema with parameters, descriptions, examples) Loaded when: MCP server connected at session start
Critical insight: 30-tool MCP server = 15,000 tokens per message. Example: 4 MCP servers (filesystem, github, brave-search, obsidian) = ~19,000 tokens per message. 50-turn session: 950K tokens just for schemas. Primary cost driver.
~1,500 tokens (loaded per message). Keep under 200 lines.
~1,000 tokens per file when loaded. 5 files = 5,000 tokens. Low priority.
~75 tokens per hook. Hooks run outside LLM. Negligible cost.
Session Configuration:
Per-Message Cost: 19,000 (MCP) + 1,500 (CLAUDE.md) + 3,000 (context) + 750 (hooks) = 24,250 tokens 50-Turn Session: 24,250 × 50 = 1,212,500 tokens input At Sonnet pricing ($3/MTok): $3.64 per session (input only)
MCP contribution: 19,000 / 24,250 = 78% of per-message cost
Problem: 38 tools loaded, only using 12 regularly
Solution: Split MCP servers by usage frequency
Savings: 26 tools × 500 = 13,000 tokens per message 50-turn session: 650,000 tokens saved = $1.95 per session
Problem: MCP tools loaded on main agent even though only subagents use them
Solution: Follow psc_comet pattern (mcp-agent with MCP-only access)
Savings: 19,000 tokens × 40 turns (if mcp-agent needed for 10/50 turns) = 760,000 tokens = $2.28
Problem: 8 skills with 60%+ overlap (e.g., multiple research skills)
Solution: Merge into 1-2 unified skills
Savings: Marginal (skills are on-demand), but improves usability
Problem: CLAUDE.md at 180 lines with verbose descriptions
Solution: Use directive imperatives (short commands) instead of explanations
Savings: 500-1,000 tokens per message = 25,000-50,000 per session = $0.08-$0.15
Problem: All 5 context files loaded at session start, even if only 2 are needed
Solution: Skills specify which context files they need (already implemented in frontmatter)
Savings: 3 files × 1,000 tokens × 50 turns = 150,000 tokens = $0.45 per session
# Context Budget Report
**Date:** 2026-03-28
**Configuration:** psc_comet
## Component Inventory
- Skills: 31 (on-demand)
- Agents: 10 (spawn-on-need)
- MCP Servers: 4 (38 tools total)
- CLAUDE.md: 140 lines
- Context Files: 5
- Hooks: 10
## Token Breakdown (Per Message)
| Component | Tokens | % of Total |
|-----------|--------|------------|
| MCP Tools | 19,000 | 78% |
| CLAUDE.md | 1,500 | 6% |
| Context Files | 3,000 | 12% |
| Hooks | 750 | 3% |
| Skills | 600 | 2% |
| **Total** | **24,850** | **100%** |
## Session Cost Estimate
**50-turn session:** 24,850 × 50 = 1,242,500 input tokens
**Model:** Sonnet ($3/MTok input, $15/MTok output)
**Input cost:** $3.73
**Output cost (est 50K tokens):** $0.75
**Total:** ~$4.48 per session
## Optimization Opportunities
1. **MCP isolation** (high impact): Move MCP to mcp-agent only
- Savings: ~$2.28 per session (51% reduction)
2. **MCP server splitting** (high impact): Separate core vs extended tools
- Savings: ~$1.95 per session (44% reduction)
3. **Context file lazy-loading** (medium impact): Load only when skill requires
- Savings: ~$0.45 per session (10% reduction)
**Combined potential savings:** $4.68 → $2.00 per session (57% reduction)
Premature optimization: Optimizing context before measuring. Audit first, optimize second.
Ignoring MCP cost: Focusing on skill consolidation (2% of cost) while ignoring MCP bloat (78% of cost).
No tracking over time: Running audit once. Context bloat accumulates. Audit quarterly.
Optimizing for tokens, ignoring value: Removing high-value MCP tools to save tokens. Optimize low-value components first.