Manage Context
Agent Buildingmanage-contextManage Context is an Agent Skill for agent building published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
コンテキストサイズを監視し、作業中に自動 compact が走らないよう事前にコンテキストを圧縮する。「コンテキストを圧縮して」「compact して」「メモリを整理」「会話を整理」「履歴を圧縮」「コンテキストが大きい」「動作が重い」などで起動。操作がない時やタスクの区切りでコンテキストが一定ラインを超えていたら自動的に /compact を実行。
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/context-management/manage-context/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/manage-context, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Manage Context
コンテキストサイズを監視し、作業中に自動 compact が走らないよう事前にコンテキストを圧縮します。
目的
- 作業中に自動 compact が走って作業が中断されるのを防ぐ
- タスクの区切りや操作がない時に事前にコンテキストを圧縮
- パフォーマンスを維持しながらスムーズな作業を実現
ワークフロー
1. コンテキストサイズを監視
会話の長さやコンテキストサイズを常に監視。
2. 適切なタイミングで自動圧縮
以下のタイミングでコンテキストが一定ラインを超えていたら自動的に /compact を実行:
- タスクの完了時: 一つのタスクが完了した区切り
- 操作がない時: ユーザーの入力待ちの状態
- ファイル操作の区切り: 複数ファイルの編集が一段落した時
3. 圧縮の実行
閾値を超えている場合、ユーザーに確認せず自動的に /compact を実行。
(コンテキストを圧縮しています...)
圧縮のタイミング
| タイミング | 説明 |
|---|---|
| タスク完了後 | 「完了しました」の報告前 |
| 質問への回答後 | 回答を返す前 |
| 複数ファイル編集後 | 編集作業が一段落した時 |
| 長時間の会話 | 会話が長くなってきた時 |
閾値の目安
- コンテキストが大きくなってきたと感じたら圧縮を検討
- 多数のファイルを読み込んだ後
- 大量のコード変更を行った後
compact の効果
- 会話履歴を要約
- コンテキストサイズを削減
- レスポンス速度を改善
- トークン使用量を最適化
- 作業中の自動 compact による中断を防止
重要な注意事項
- ✅ タスクの区切りで自動的に圧縮
- ✅ 作業中断を防ぐため事前に圧縮
- ✅ 重要な情報が失われないよう注意
- ❌ 作業の途中(ファイル編集中など)では圧縮しない
- ❌ ユーザーが入力中は圧縮しない