AGENT SKILL
compact
Check context usage and compact the conversation from IPython. Use when context is filling up and substantial work remains, so the session is summarized and you keep working instead of stopping early.
- License 许可
- MIT
- 最近更新
- 2026-08-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- compact
- description
- Check context usage and compact the conversation from IPython. Use when context is filling up and substantial work remains, so the session is summarized and you keep working instead of stopping early.
02 资源文件 2
- 其他pyproject.toml585 B
- 脚本src/compact/__init__.py1.5 KB
03 SKILL.md 正文
Compact
Compaction replaces older conversation history with a dense summary, freeing
context so long-running work can continue. The implementation lives in the
host (the same one behind the user's /compact command); this skill is the
kernel-side interface to it. Call it directly from IPython:
await compact.status()
await compact.run()
await compact.run("keep the failing test names and the migration checklist")
API
await compact.status()— current context usage as a dict:tokens,context_window, andpercent(Noneright after a compaction until the next model response), plusscheduled(whether a requested compaction is already pending).await compact.run(instructions=None)— schedule compaction. Returns{"scheduled": True}, or{"scheduled": False, "reason": ...}when there is nothing to compact yet. Optionalinstructionsfocus the summary on what matters for the remaining work.
Rules
- Compaction never runs mid-cell. A scheduled compaction runs when the current turn ends; the harness then resumes you automatically with the summary plus recent messages, and you continue the task.
- The IPython kernel persists through compaction — variables, imports, and helpers you defined all remain available.
- Compact at a natural boundary when context usage is high and substantial
work remains, instead of becoming terse or returning to the user early.
Check
await compact.status()when unsure. - One request per turn is enough; calling
runagain before the turn ends only updates the instructions.
04 同仓库更多 Skills
valid-skill
A valid skill for testing purposes.
★ 0
unknown-field
A skill with an unknown frontmatter field.
★ 0
nested-child
Nested skill should be ignored.
★ 0
root-skill-preferred
Root skill should win.
★ 0
python-skill
A Python-backed skill for testing.
★ 0
python-package-missing
A Python skill missing its import package.
★ 0