Agent Skills
› PrimeIntellect-ai/prime-agent
› compact
compact
GitHub用于在对话上下文即将耗尽时压缩历史,释放空间以支持长任务持续进行。通过Python REPL调用compact.run()触发摘要生成,确保工作不中断且变量状态保留。
Trigger Scenarios
上下文使用量高且剩余工作量较大
需要继续长时间运行的开发任务
Install
npx skills add PrimeIntellect-ai/prime-agent --skill compact -g -y
SKILL.md
Frontmatter
{
"name": "compact",
"description": "Check context usage and compact the conversation from the Python REPL. Use when context is filling up and substantial work remains, so the session is summarized and you keep working instead of stopping early."
}
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 the Python REPL:
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 Python 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.
Version History
- bc0fa76 Current 2026-08-27 09:01


