技能潮 SkillTide 提交收录
官方说明开源项目7 天前
nvxtien/context-slice

nvxtien/context-slice

Reduce the context before sending it to the LLM
在 GitHub 查看 ↗直链 · 无中转页
★ 数取值
0 ★ · nvxtien/context-slice · 取自该仓库的 GitHub 页面 · (2026-10-16 20:00:20 核对)
来源明细
从该仓库的 GitHub 页面直接读取 · 条目类型:开源项目
收录与活跃
收录于 2026-10-10 · 最近见到 2026-10-16 · 共见到 20 次 · 被 1 个来源列出
评分构成
综合分 103 · 1 个来源 · repo
常见问题(答案都来自我们的记录)
怎么安装?
我们【没有】从该仓库取到安装命令(我们的 install 覆盖率只有约 4%)。请看它的 README 或 releases 页。
它适合谁 / 用来做什么?
我们把它归在这些标签下: 开源项目。标签来自条目自身,不是我们强加的分类。
谁维护它、还在更新吗?
仓库 nvxtien/context-slice;我们收录于 2026-10-10;最近见到 2026-10-16。这里没有"官方认证"或"质量评级"——我们只记录来源与时间。
第三方质量标记

ContextSlice

以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →

> Less context. Unchanged signal.
>
> Give your coding assistant the smallest useful slice of your codebase.
When you use AI to write code, the model doesn’t spend tokens just writing the
final answer. A large part of the cost often comes from the code it has to
read first: the target file, its callers and callees, dependencies, tests, and
configuration.
Reading more code means more tokens, slower responses, and more noise around
the detail that actually matters. The practical way to reduce that cost is to
reduce how much code the agent has to read in the first place.
ContextSlice does exactly that. It builds a small, task-specific context from
Java, TypeScript, TSX, JavaScript, Python, Rust, Go, C, C++, C#, and Kotlin
source. It finds the target symbol, follows relevant callers and callees,
and reports what was included or left out.
In short: instead of giving an AI assistant the whole repository, give it the
smallest useful slice of the codebase.
It is local, read-only, and deterministic: Tree-sitter performs the structural
analysis, SQLite stores the index, and no source code is sent to a hosted
service by ContextSlice.
The result is:
- Less code to read and pay for: return the target symbol plus the most relevant callers and callees instead of whole files.
- Better signal: rank results by task relevance and keep unresolved runtime dispatch explicit instead of guessing.
- Predictable output: enforce a token budget and explain why items were included or omitted.
- Local control: keep source analysis and the SQLite index in the repository; the target source is never edited.
Quick start
Claude Code plugin
Install it directly from the GitHub marketplace:
The plugin provides a skill that tells Claude Code to request a focused
ContextSlice preview before reading source files. Its PreToolUse hook also
blocks supported source reads until context.preview has completed, so this
is enforced at runtime rather than relying only on prompt compliance. The MCP
server then targets the project Claude Code has open. The plugin starts the published
the latest published context-slice npm runtime, so Claude needs npm registry access on first
use. The package installs native dependencies for the current platform; later
runs use the local npm cache.
Codex plugin
Add the GitHub marketplace to Codex:
Then open /plugins, choose Context Slice Marketplace, and install
context-slice. The plugin includes the same ContextSlice skill and stdio MCP
server for the project Codex has open.
How it works
1. Discover a repository and scan supported source while ignoring common generated/build directories.
2. Store symbols, call edges, hashes, schema version, and refresh time in a local SQLite cache.
3. Refresh before preview or MCP tool execution so changed source files are not silently served stale.
4. Select a target from task text, then include the target body plus ranked direct callers/callees until the strict token budget is full.
Available MCP tools are context.search, context.symbol, context.callers, context.preview, context.slice, and context.diff. MCP stdout contains protocol messages only; diagnostics must not corrupt stdio framing.
CLI
| Command | Purpose |
| ------------------- | ----------------------------------------------------------- |
| init | Discover the repository and create/refresh the local index. |
| index | Refresh the index explicitly. |
| status | Show readiness, schema, cache freshness, and last refresh. |
| doctor | Check repository, source, cache, and MCP command readiness. |
| preview | Return a deterministic, strict-budget context preview. |
| mark-dirty [file] | Tell a running MCP index that source changed. |
| mcp | Start the stdio MCP server with the stable public command. |
来源
github · https://github.com/nvxtien/context-slice
按领域浏览
开源项目
收录于
昨天

更多开源项目

查看开源项目全部 731 条 →

所属领域与标签

每个标签都能点进去看同类的全部条目。数字是当前库里的真实条数。

浏览全部领域 →

← 返回索引