Token导航 LogoToken导航

Agent Skill · 研究检索

context-management(上下文管理)

context-management 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

context-management 是研究检索类 Agent Skill,可用宿主为 OpenClaw,通过ClawHub获取,权限为执行命令;许可证为 MIT-0,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 4,583。

总安装 31,271周安装 1,265GitHub Stars 公开资料未说明下载 9,816核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT-0
版本
1.0.0

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:context-management(上下文管理)
来源仓库:https://github.com/marcus-daemon/context-management
安装命令:
openclaw skills install context-management
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install context-management

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

管理 AI 代理上下文窗口消耗防止信息过载崩溃风险。强制执行子代理生成策略维持长任务执行稳定性。context-management 属于研究检索类 Skill,可作为该场景下的辅助能力补充。有效缓解因连续对话导致的“压缩死亡螺旋”现象。集成至 clawhub 后作为 OpenClaw 的系统级守护进程运行。

配置不当可能导致重要信息被过早丢弃,需谨慎调整阈值参数。

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 OpenClaw;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 openclaw skills install context-management;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

context-management 怎么安装?

在终端执行 openclaw skills install context-management。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

context-management 支持哪些 AI 工具?

公开资料标注支持 OpenClaw。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

context-management 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 openclaw skills install context-management 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

context-management 是免费的吗?

来源标注的许可证是 MIT-0。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

context-management 用的人多吗?

公开数据是累计安装 31,271 次,近一周安装 1,265 次,下载 9,816 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

context-management 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 OpenClaw 一种宿主,触发方式和使用习惯不用来回切换。
  • 许可证明确为 MIT-0,商用和分发边界好判断。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 OpenClaw,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
context-management

上下文管理 · 本页

31,271—执行命令MIT-0有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
context-management
version
1.0.0
description
>

Context Management

Prevent context exhaustion, enforce spawn discipline, and make compaction survivable.

Core Concepts

  1. Fixed baseline: Typically 5-15% of context consumed before any conversation — system prompt, workspace files, skill descriptions, tool definitions. Varies by setup (more skills/files = higher baseline).
  2. 60/40 rule: ~60% of consumed context is tool outputs, ~40% conversation. Tool outputs are the primary target for savings.
  3. Compaction is lossy: Summaries stack cumulatively. Each cycle raises the floor. After 3+ compactions, summaries alone can consume 30%+ of context.
  4. Sub-agents are disposable context: A sub-agent can burn most of its context investigating something; only the summary (~500 tokens) enters main context.

All percentages are relative to the model's context window. Check session_status for actual window size and usage.

Procedures

When Context Pressure Rises

After every tool-heavy operation (>5 tool calls), assess:

  1. Run session_status to check usage
  2. If below 50%: continue normally
  3. If 50-70%: spawn sub-agents for remaining tool-heavy work (>3 tool calls)
  4. If 70-85%: spawn sub-agents for ANY tool work (>1 tool call). Warn user.
  5. If above 85%: write checkpoint (see below), suggest /compact or /new

"What's Eating My Context?" — Estimation Method

Cannot get exact per-component breakdown. Estimate:

Fixed baseline:         ~5-15% (system prompt + workspace files + skills + tools)
Per user message:       ~100-500 tokens each
Per assistant response: ~200-1000 tokens each
Per tool call result:   ~500-5000 tokens each (exec/read heavy, search light)
Compaction summaries:   ~2000-5000 tokens each (cumulative!)

Count messages and tool calls in recent history, multiply by midpoint estimates. Report as ranges, not false precision. For per-operation cost detail, read references/operation-costs.md.

Spawn Policy

If .context-policy.yml exists in workspace root, use it as guidance for spawn thresholds and task categories. Otherwise use these defaults:

Always spawn (regardless of context level):

  • Test suites (>3 tests)
  • Multi-file audits (>5 files)
  • Build/deploy pipelines
  • Research tasks (web search + analysis)
  • Bulk file operations

Never spawn (keep in main session):

  • Single commands
  • Conversations / discussions
  • Quick edits (1-3 files)
  • Status checks
  • Tasks requiring user input mid-execution

Context-dependent (spawn when context exceeds threshold):

  • Above 50%: spawn if task involves >5 tool calls
  • Above 70%: spawn if task involves >2 tool calls

When spawning, write detailed task descriptions. Sub-agents have no conversation context — they only know what the task field tells them.

Pre-Compaction Checkpoint

Before compaction or /new, write .context-checkpoint.md in the workspace root (the agent reads this post-compaction):

# Context Checkpoint — {date} {time}

## Active Task
{what you were doing}

## Key State
{bullet list of current state — what's done, what's in progress}

## Decisions Made This Session
{numbered list of decisions with rationale}

## Files Changed
{list of files modified this session}

## Next Steps
{what to do after resuming}

This file survives compaction. On session start or post-compaction, check for it and use it to restore context. Delete after consuming.

Coordination with OpenClaw memoryFlush: OpenClaw may fire its own pre-compaction flush (writing to daily log). The checkpoint is complementary — the flush saves to the daily log, the checkpoint saves structured resume state. Both should exist. If the memoryFlush fires first, compaction may already be in progress. For critical sessions, write checkpoints proactively at 75%, don't wait for 85%.

The scripts/context-checkpoint.sh script handles basic write/read/clear. For the full 5-section checkpoint, write the file directly — multiline content works better that way.

Post-Compaction Recovery

After compaction or /new:

  1. Read .context-checkpoint.md if it exists
  2. Read today's daily log if the workspace has one (e.g. memory/{today}.md)
  3. Resume from the checkpoint's "Next Steps"
  4. Delete the checkpoint file after restoring context

Proactive Warning Template

When context exceeds 65%, warn:

⚠️ Context: {pct}% ({used}k/{total}k). Estimated runway: ~{remaining_calls}
tool calls. {recommendation}

Recommendations by level:

  • 65%: "Spawning sub-agents for remaining tool-heavy work."
  • 75%: "Recommend compacting soon. Writing checkpoint."
  • 85%: "Context critical. Writing checkpoint now. Suggest /compact or /new."

Session Profiling & Config Advice

After significant work (or on request), profile the current session and recommend config changes.

Step 1: Classify the Session Pattern

Run session_status. Count approximate tool calls and message exchanges. Classify:

PatternSignatureExample
Tool-heavyMost context from tool results, many exec/read/web callsAudits, migrations, test suites, debugging
ConversationalMost context from messages, few tool callsPlanning, discussion, decisions
MixedRoughly even splitFeature builds (discuss → code → test → discuss)
BurstyLong quiet periods with intense tool burstsMonitoring + incident response

Step 2: Recommend Config

There are four settings that matter. When explaining them to the user, always describe what they do in practice, not just the setting name:

1. When to compress the conversation (reserveTokensFloor) How full the context gets before the agent summarises and compresses the history. A higher number means it compresses sooner — producing a shorter summary with more room left afterwards.

  • 30000 — waits until nearly full. Risk: huge summary, little room after.
  • 50000 — compresses at ~75% full. Good balance.
  • 60000 — compresses early at ~70%. Maximum breathing room.

2. How quickly old tool output is cleared (pruning TTL) After you stop talking for this long, the agent clears old command outputs, file reads, and search results from memory. Shorter = more aggressive cleanup.

  • 5m — only clears after 5 minutes of silence. Rarely fires during active work.
  • 2m — clears after 2 minutes. Good for most workflows.
  • 1m — aggressive. Clears fast, but you might need to re-read files.

3. How many recent exchanges are protected from cleanup (keepLastAssistants) When clearing old tool output, this many of your most recent back-and-forth exchanges are kept untouched.

  • 3 — keeps more history visible. Good for conversations.
  • 2 — moderate protection.
  • 1 — only the last exchange is safe. Most aggressive cleanup.

4. Minimum size before tool output gets trimmed (minPrunableToolChars) Only tool results larger than this (in characters) are eligible for trimming. Lower = more things get cleaned up.

  • 50000 (default) — only trims very large outputs (long file reads, huge command output).
  • 10000 — also trims medium outputs. Catches more.
  • 5000 — aggressive. Most tool results are eligible.

Recommended combinations by work style:

Work styleCompress atClear afterProtectTrim above
Tool-heavy (audits, tests, debugging)600001m110000
Conversational (planning, discussion)300005m350000
Mixed (code → test → discuss)500002m210000
Bursty (monitoring + incidents)500002m110000

Additional tips:

  • Sessions with browser/canvas work: Ensure those tools are protected from cleanup in the config
  • Long-running sessions (>2h): Use a higher compression trigger to survive multiple rounds

Step 3: Report

Use a compact list format — tables render poorly on mobile and narrow chat windows. For each setting, show current vs recommended only if they differ. Skip settings that are already correct.

📊 Current Session Profile: {pattern}
Context: {pct}% ({used}k/{total}k) · Compressions: {c}

✅ When to compress — {current_description}. Good for this work style.
✅ Clear old output after — {current_description}. No change needed.
⚠️ Protect last exchanges — currently {current}, recommend {recommended}. {why}
✅ Trim output above — {current_description}. No change needed.

Estimated runway: ~{time_or_calls} before next compression.

Lead with what's already right (builds confidence), then highlight what needs changing and why. Keep it short — the user wants a verdict, not a lecture.

If changes are recommended, tell the user everything up front before asking for approval:

  1. Exact file being modified (full path — get from gateway config.get)
  2. Exact changes — setting name, current value, new value
  3. What happens — gateway restart (~2-3 second pause, auto-reconnects)
  4. Safety net — backup taken first, rollback doc written to temp directory

Example closing:

One change recommended:
  File: {config_path}
  Change: {setting_name}: {old_value} → {new_value}
  
Applying means: I'll back up the config file first, write a rollback 
doc to {temp_path}, then restart the OpenClaw gateway (~2-3 second 
pause while it reloads). Want me to go ahead?

For multiple changes, list each one. Never summarise as "4 changes" — spell them out.

Never ask "want me to apply?" without the user seeing the exact file, exact values, and exact consequences. The user decides with full information, not blind trust.

If the user agrees, follow the full procedure below.

Step 4: Learn Over Time

After giving advice, note the session pattern and outcome in the daily log (if the workspace keeps one). Over multiple sessions, patterns emerge — the user's typical work style becomes clear and default config can be permanently tuned.

Applying Config Changes — Mandatory Procedure

When recommending config changes, follow this exact sequence. No shortcuts.

1. Find the Config File

Run gateway config.get to get the config file path and current values. Do not assume the path — it varies by installation.

2. Backup First

cp <config_path> <config_path>.backup-$(date +%Y%m%d-%H%M%S)

3. Write a Rollback Document

Write a rollback doc to a location the user can access (not the agent workspace — the user may not have access to it). Use a temp directory (/tmp/ on Linux/macOS, or the system temp dir). Include:

# Context Config Rollback — {date}

## What Changed
| Setting | Before | After | File |
|---------|--------|-------|------|
| {setting} | {old} | {new} | {config_path} |

## Backup Location
{config_path}.backup-{timestamp}

## How to Rollback
cp {backup_path} {config_path}

## How to Restart the Gateway
Depends on local setup — check which applies:
- CLI (most common): openclaw gateway restart
- systemd service: sudo systemctl restart <service-name>
- Manual process: kill the gateway process, then: openclaw gateway start

## How to Check Health
- Process running: check for openclaw in process list
- Gateway responding: curl http://localhost:<port>/health
- Logs: check system logs or terminal output depending on setup

## What to Do If Gateway Won't Start
1. Restore backup (cp command above)
2. Restart gateway
3. Check logs for config parse errors

Tell the user where this file is.

4. Explain to the User BEFORE Applying

Tell them:

  • Which file is being modified (full path — get it from gateway config.get)
  • What values change (before → after table)
  • What "restart" means — the OpenClaw gateway process restarts (not the machine, not any other service). Brief 2-3 second pause, then the session reconnects automatically.
  • Where the backup is (full path)
  • Where the rollback doc is (full path)
  • How to check if something goes wrong

5. Apply with gateway config.patch

Use the gateway tool with action: config.patch. Include a clear note parameter — this message is delivered to the user after the gateway restarts.

6. Post-Restart Confirmation (MANDATORY)

After the gateway restarts and the session reconnects, immediately confirm to the user:

✅ Gateway is back. Config changes applied successfully.

What changed:
- {setting}: {old} → {new} ({plain English explanation})
- [etc.]

Rollback doc: {path}
Backup: {path}

Everything is working normally. Ready to continue.

Never stay silent after a restart. The user needs to know:

  1. We're back
  2. The changes landed
  3. Where to find the rollback doc
  4. That we're ready to continue

Reference Docs

For detailed config options and profiles: references/config-guide.md For per-operation cost estimates: references/operation-costs.md

平台分布

OpenClaw

79.87%
按下载量换算7,840

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

未展示

权限和风险

执行命令

安装流程涉及命令执行,可能通过 openclaw skills install context-management 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills