Skip to main content

tokenforge

TokenForge — Full-stack LLM token optimization engine

소스 정보

저장소
Manavarya09/tokenforge
최근 소스 활동
2026년 4월 3일 23:30
감지된 SKILL.md 언어
영어
스타
8
포크
1

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
tokenforge
description
TokenForge — Full-stack LLM token optimization engine
# /tokenforge TokenForge compresses ALL token sources in your Claude Code sessions — code, command output, conversation, JSON, and MCP schemas — with AST-aware intelligence. ## Commands ### `/tokenforge stats` Show compression statistics for the current session. ```bash tokenforge stats --json ``` ### `/tokenforge analyze` Analyze token usage patterns — identifies session type (debugging, code review, feature build) and gives optimization recommendations. ```bash tokenforge analyze ``` ### `/tokenforge budget [total]` View or set per-category token budgets. ```bash # View current budget tokenforge budget --show # Set total budget to 80,000 tokens tokenforge budget --set 80000 ``` ### `/tokenforge quality` Show compression quality score (0-100) for the current session. ```bash tokenforge quality ``` ### `/tokenforge learn` Build a project relevance profile from git history and file access patterns. ```bash tokenforge learn --project . ``` ### `/tokenforge expand <hash>` Retrieve the full original content by its blake3 hash. Use when compressed output has lost information you need. ```bash tokenforge expand abc123def456 ``` ## How It Works TokenForge sits in the PostToolUse hook and compresses tool output before it enters the context window: 1. **Code** — AST-aware folding: keeps signatures, types, imports; folds large function bodies 2. **Command output** — Strips ANSI, deduplicates similar lines, summarizes test/compiler output 3. **Conversation** — Scores turns by recency + relevance, compresses low-value turns 4. **JSON** — Schema extraction + array sampling, depth limiting 5. **MCP schemas** — Tiered virtualization: active tools get full schemas, others get names only All originals are stored losslessly in SQLite (zstd-compressed). Use `tokenforge expand` to retrieve any original. ## Installation ```bash # Build from source cd tokenforge/core && cargo build --release # Install cp target/release/tokenforge ~/.cargo/bin/ # Add hook to Claude Code settings # ~/.claude/settings.json: # { # "hooks": { # "PostToolUse": [ # { "command": "/path/to/tokenforge/hooks/compress-output.sh" } # ] # } # } ```
GitHub에서 보기