Contextslice — AI skill for Claude Code
零配置 AST 代碼符號索引與動態上下文注入工作台 以「計算外移(Out-of-Band Slicing)」與「三層漸進式骨架展開」徹底解決 AI 模型上下文溢位、超長單檔截斷,以及傳統 Skill/多工具 MCP 協議稅負過高的問題.
How to install Contextslice
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open grundy40wk/contextslice and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Contextslice does
零配置 AST 代碼符號索引與動態上下文注入工作台 以「計算外移(Out-of-Band Slicing)」與「三層漸進式骨架展開」徹底解決 AI 模型上下文溢位、超長單檔截斷,以及傳統 Skill/多工具 MCP 協議稅負過高的問題。通用支援 瀏覽器開發、CLI(Claude Code、Pi Agent)與 Desktop Agent(Hermes Desktop、Cursor、Windsurf、Cline)。
Alternatives in AI
- Jcodemunch MCP — Cut AI token costs 95%+ on code exploration 2.6k ★
- Skilldock — SkillDock is an AI skill manager and skill management desktop app for Claude Code, Cursor, Codex, Windsurf, Ge 490 ★
- Memtrace Public — Structural memory for AI coding agents 466 ★
README
ContextSlice Studio (`v0.1.1`)
**幫 AI 挑重點、省 Token 的程式結構分析與精簡工作台** 在把程式碼交給 AI 之前,先自動找出要修改的函式與上下游關聯,將其他無關細節摺疊成「只留名稱與參數的外框」,大幅縮小體積並避免上下文溢位。
目錄
1. 為什麼做這個工具?
平常請 AI 改程式時,最常遇到三個問題:
- 一次貼太多檔案,Token 花費爆表:改一個功能往往牽涉好幾個檔案,全部貼進去不只花錢,AI 也容易看到無關內容而答偏。
- 單一檔案太長,貼不進對話框:幾千行的長檔案沒辦法靠單純篩選檔名解決。
- 傳統 AI 工具說明書太肥:如果外掛了 20 個讀寫檔案工具,每輪對話都要先附上幾千個 Token 的工具說明書,浪費額度。
**ContextSlice Studio 的做法**: 先在瀏覽器或本機幫程式碼畫出關聯圖,只把**要改的重點留完整**,有直接關聯的程式**只留標題與參數外框**,其餘無關程式自動略過;而且能用「自動補齊重點」功能偵測邏輯較複雜的模組,在額度內自動補全所需內容。
2. 支援的程式語言與核心能力
- 支援多語言解析與精簡:TypeScript / JavaScript、Python、Go、C / C++、Swift、PHP、HTML / Vue / Svelte、CSS / SCSS、Rust、Java / Kotlin、C#、Ruby、SQL。
- 長檔案自動分段:單檔過長時,自動拆解內部函式與類別,只展開你要修改的區塊。
- 彈性 Token 上限:支援
1K、4K、8K、16K、32K、64K、128K、256K、1M快速切換。 - 互動式程式關聯圖:支援滑鼠滾輪縮放、拖曳平移、全景小地圖,以及「誰用到它 / 修改重點 / 它用到誰」分層檢視。
- 自動補齊重點(Proactive Discovery):當關聯節點邏輯較複雜時,自動呼叫
expand_skeleton_cluster展開完整內容,並在頂部列提示補齊狀態。 - 省量分析與實戰基準測試:
- 內建 Recharts 迷你折線圖,跨重整保存最近 10 次操作的 Token 花費趨勢。
- 內建 多任務實戰基準測試(Benchmark),可針對目前專案一鍵實測精簡比率與執行耗時(ms)。
- 個人偏好記憶與一鍵重新掃描:自動記住您的預算、關聯層數、工具資料夾與提問模板;支援瀏覽器資料夾權限的一鍵重新讀取(若處於不支援環境會自動切換為標準資料夾選取)。
3. 本機安裝與啟動
環境需求
- Node.js:建議
v20.0.0以上(匯出至電腦使用的ctxslice.mjs與ctxslice-mcp.mjs僅依賴 Node 內建模組,不需額外npm install)。
一鍵啟動(macOS / Linux / Windows 通用)
下載或 `git clone` 專案後,進入專案資料夾只需執行這**同一行指令**(會自動安裝缺少的套件、啟動伺服器並開啟瀏覽器):
node start.mjs
也可使用 npm 指令啟動:`npm run launch`
傳統分段啟動指令
# 1. 安裝相依套件
npm install
# 2. 啟動開發伺服器(預設 http://localhost:3000)
npm run dev
# 3. 執行 Type
Related Skills
Token Saver
Zero-cost token optimization engine for AI coding assistants (Claude Code, Cursor, Antigravity, Windsurf). Sav
TokenJar
Zero-cost token optimization engine for AI coding assistants (Claude Code, Cursor, Antigravity, Windsurf). Sav
Std Agent
One .stdai/ source of truth, fanned out to 22 AI coding tools: Claude Code, Codex, Cursor, Copilot, Gemini CLI
Std AI
One .stdai/ source of truth, fanned out to 22 AI coding tools: Claude Code, Codex, Cursor, Copilot, Gemini CLI
Code Context MCP
🧠 Python MCP Server for AST Codebase Intelligence, Symbol Extraction, Cyclomatic Complexity & Refactoring Ana
Krusch Git
Git DAG indexing, AST symbol graphs, and hybrid semantic code search MCP server for AI coding agents (Claude C
Related Agents
10x Tool Calls
Cursor and Windsurf meter usage by requests and tool calls rather than tokens, which means a finished or stall
Core Developer
Core development protocol for the EITR engine containing 4 explicit workflows and constraints for modifying AS
Infrastructure Expert
Infrastructure expert for bare-metal, out-of-band (iDRAC/iLO), networking, and physical-server operations.