s2005/skill_state/tree/main/plugin
skill-state
一个实现 SKILL.state 的 Claude Code function-hook 插件:提供显式且经过 JSON-schema 验证的执行状态,用它限制非豁免工具调用,并在每轮将只追加的对话历史替换为压缩后的帧,面向长时段技能。
关于这个 mod
这个插件在 Claude Code 内注册一个工具(skill_state_update)和一个命令(/skill-state)。模型不再依赖只追加的聊天历史,而是维护一个经过验证的状态对象;不在豁免列表中的每次工具调用,都必须由一次状态更新绑定,并指名那个确切的调用;每轮结束时,对话会被压缩成一个帧(objective、procedure、current state、step)以及最近几轮对话。命令涵盖 start(使用 software、ctf 等内置领域,或指定配置路径)、new(通过六个问题构建领域配置)、status、stop/resume 和 reset。hook 模块与无依赖的 lib 代码完全在进程内运行,不发起网络请求,也不安装软件包;读取来自内置或用户提供的领域配置,只有在 /skill-state new 中确认后才会写入 domains/<name>.json。运行时记录保存在会话插件状态和插件存储中,并以会话 id 为键。子代理不受影响。根据 MIT 授权。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add s2005/skill_state claude plugin install skill-state
原文 / README
skill-state
SKILL.state (arXiv:2608.26263) for Claude Code: an explicit, validated execution state that replaces append-only conversation history for long-horizon skills. It is a Claude Code function-hook plugin and needs a Claude Code build with function hooks.
While the runtime is active:
- the model keeps its state through the
skill_state_updatetool, validated against the domain's JSON schema; - every tool call outside the domain's exempt list must first be bound by a state update naming that exact call;
- at the end of each turn the conversation is replaced by a frame (objective, procedure, current state, step) followed by the last few turns.
Commands
| Command | What it does |
| ------- | ------------ |
| /skill-state start <domain\|path> | Starts a runtime from a bundled domain (software, ctf) or a domain config file. The next prompt becomes the objective. |
| /skill-state new <name> | Builds a domain config from six questions and writes it to domains/<name>.json in this plugin folder. |
| /skill-state status | Shows the domain, objective, step, pending action, state size and token usage. |
| /skill-state stop / resume | Turns gating and compaction off or back on, keeping the state. |
| /skill-state reset | Returns to the initial state at step 0. |
What the plugin runs, reads and writes
- Runs only the TypeScript hooks module
hooks/register.tsand the dependency-free code inlib/, inside Claude Code. It starts no processes and installs no packages. - Makes no network requests and sends no data anywhere.
- Reads domain config files: the bundled ones in
domains/, or a path you pass to/skill-state start. - Writes
domains/<name>.jsononly when you confirm it in/skill-state new. - Keeps the runtime record in the session's plugin state and in the plugin store, keyed by session id.
- Registers one tool,
skill_state_update, and one command,/skill-state; denies non-exempt tool calls that were not bound by a state update; and compacts the main conversation to the frame at each turn end in interactive sessions. Subagents are not affected.
Full documentation, domain config reference and development notes: https://github.com/s2005/skill_state.
License
MIT, see LICENSE.