ImKK666

SoL ClaudeCode — Development skill for Claude Code

Development community

Port NVIDIA SoL-Pi's context-efficiency mechanisms to Claude Code: a local api.anthropic.com wire gateway + a companion plugin (ObservationPack, Evidence-Preserving Reducer, Trajectory Inspector, Acti.

How to install SoL ClaudeCode

This entry records only its repository, not the path inside it, so there is no exact command to give. Open ImKK666/SoL-ClaudeCode and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What SoL ClaudeCode does

Port NVIDIA SoL-Pi's context-efficiency mechanisms to Claude Code: a local api.anthropic.com wire gateway + a companion plugin (ObservationPack, Evidence-Preserving Reducer, Trajectory Inspector, Action Fusion).

Alternatives in Development

README

SoL-ClaudeCode

**简体中文** | [English](./README.en.md)

把 NVIDIA [SoL-Pi](https://github.com/NVlabs/SoL-Pi) 的上下文与工具效率机制,移植到 [Claude Code](https://claude.com/claude-code) 的**「线路网关 + 配套插件」**组合。

状态:核心机制 **ObservationPack** 已在真实 Claude Code 流量下端到端验证; **Evidence-Preserving Reducer / Trajectory Inspector / Action Fusion** 已实现并有单元测试; **Online Context Compact** 经评估**不可忠实移植**(原因见下)。改造类机制默认关闭(opt-in)。

为什么是两个部件,而不是一个插件

SoL-Pi 是 Pi 的**进程内扩展**,直接挂在它的 `context` 事件上改写"投影给模型的上下文"。Claude Code 没有等价的上下文投影扩展点,于是拆成两侧,各补一半:

  • 网关(wire 层) —— 本地 MITM 代理 api.anthropic.com,改写发往模型的 /v1/messages 请求体。 保持 host 仍是 api.anthropic.com,所以 first-party 功能身份不掉。只有网关能改写"发给模型的上下文"。
  • 插件(harness 层) —— Claude Code 插件,提供 obs_recall 工具与 hooks。只有插件能真正执行工具。

两侧靠一份**内容寻址的共享归档**对接:网关写入,插件读取,不需要 session 关联。

目录结构

shared/      两侧共用的契约(ObservationPack / Reducer 核心逻辑,单一真源)
gateway/     MITM 网关:HTTP/1.1 解析、投影、归档、记账、轨迹
plugin/      Claude Code 插件(自包含):obs_recall MCP、hooks、命令
scripts/     vendor 同步 / 记账报告 / 归档 GC
tests/       node:test(20 条)
bin/solclaudecode    极简启动器
install.sh   一键安装

环境要求

  • Node.js 22 或更高
  • Claude Code(原生二进制;已在 2.1.x 验证)
  • macOS 或 Linux(Windows 未验证)

安装(一键)

./install.sh        # 生成 CA + 注册 marketplace + 安装插件
./bin/solclaudecode         # 最小启动:网关没起就自动拉起,再跑 claude
./bin/solclaudecode -p "…"  # 一次性

把 `bin/` 加进 `PATH`,就能一个词启动(`solclaudecode`)。卸载:

claude plugin uninstall sol-claudecode@sol-claudecode
claude plugin marketplace remove sol-claudecode

机制

机制 位置 状态 说明
ObservationPack 网关 + 插件 超过 10 KB 的 tool_result,在发送 FULL_SENDS(默认 2)次后转为 obs_<24hex> 句柄;原文进内容寻址归档,可按页 / 按原文精确召回。
Evidence-Preserving Reducer 网关 ✅ 默认关 诊断类命令的长日志交 reducer 模型压成可逐字节校验的回执;引文在原文中找不到就原样放行。
Trajectory Inspector 网关 只记元数据的 JSONL(模型、字节、打包/归约计数)。
Action Fusion 插件 ✅ 默认关 Edit/Write 后按配置跑一条跟命令,输出作为上下文回注。
Online Context Compact 不可忠实移植,见下。

为什么 O