Skip to content
Agentmart
Submit a tool

context-manage

컨텍스트 윈도우 관리 스킬.

Skill by dmsdc-ai

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/dmsdc-ai-context-manage

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

컨텍스트 윈도우 관리 스킬. 모든 세션(오케스트레이터+하위)에서 컨텍스트 압박 시 자동 발동. "context high", "컨텍스트 높아", "compact 해야", "context pressure", "토큰 부족", "rate limit", "컨텍스트 관리", "스냅샷 저장" 요청 시 또는 컨텍스트 50%+ 감지 시 사용. Silent skill — 컨텍스트 압박 감지 시 자동 발동, 명시적 호출도 가능.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/context-manage

Tools it pre-approves 6

From allowed-tools in SKILL.md: the agent may use these without asking you each time.

  • Bash,
  • Read,
  • Write,
  • Edit,
  • Glob,
  • Grep

What's inside

Skill name
context-manage
Description
컨텍스트 윈도우 관리 스킬. 모든 세션(오케스트레이터+하위)에서 컨텍스트 압박 시 자동 발동. "context high", "컨텍스트 높아", "compact 해야", "context pressure", "토큰 부족", "rate limit", "컨텍스트 관리", "스냅샷 저장" 요청 시 또는 컨텍스트 50%+ 감지 시 사용. Silent skill — 컨텍스트 압박 감지 시 자동 발동, 명시적 호출도 가능.
License
MIT
Allowed tools
Bash,, Read,, Write,, Edit,, Glob,, Grep
Instructions
168 lines in SKILL.md · view on GitHub

Before installing

  • Pre-approves some shell commands

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Context Manage

컨텍스트 윈도우를 안전하게 관리하여 작업 연속성을 보장합니다.
오케스트레이터와 모든 하위 세션에서 동일하게 동작합니다.

## 핵심 원칙

1. **컨텍스트 보존 없이 compact 금지**
2. **compact 후 이전 작업 상태를 모르는 상태로 진행 금지**
3. **Rate limit은 예방이 최선**

## Phase 1: 예방 (상시 적용)

컨텍스트가 높아지기 전에 항상 적용하는 습관:

### 토큰 절약 패턴

| 패턴 | 설명 |
|------|------|
| **선택적 읽기** | 파일 전체 읽기 금지. `offset`+`limit`으로 필요 부분만 읽기 |
| **출력 제한** | `head -20`, `--limit`, `| head` 등으로 출력량 제한 |
| **분할 작성** | 100줄 이상 코드 작성 시 파일 분할 또는 subagent 위임 |
| **도구 우선** | grep/read/glob 전용 도구 사용 (bash grep 대신 Grep 도구) |
| **반복 금지** | 같은 파일 재읽기 방지. 필요 정보는 메모해두기 |
| **subagent 활용** | 탐색/리서치는 subagent에 위임하여 메인 컨텍스트 보호 |

### 대규모 작업 시

```
- 한 번에 수백 줄 작성하지 않는다
- 파일 전체를 읽지 않고 관련 부분만 읽는다
- 빌드 출력, 테스트 출력은 요약만 확인한다
- git diff는 --stat 먼저, 필요 시 특정 파일만 full diff
```

## Phase 2: 스냅샷 저장 (compact 전 필수)

컨텍스트가 높아져서 compact가 필요할 때, **반드시 스냅샷을 먼저 저장**합니다.

### 스냅샷 파일 위치

| 세션 유형 | 스냅샷 경로 |
|----------|-----------|
| 프로젝트 세션 | `{project-root}/.context-snapshot.md` |
| 오케스트레이터 | `$AIGENTRY_ORCH_DIR/.context-snapshot.md` |
| 벤치마크 세션 | `{cwd}/.context-snapshot.md` |

`$AIGENTRY_ORCH_DIR` = your aigentry orchestrator project root. 미설정 시 `install.sh`와 동일하게 `<projects-root>/aigentry-orchestrator`로 해석하고 (projects-root 기본값 `~/projects`), 그 디렉토리도 없으면 세션의 프로젝트 루트에 저장합니다.

### 스냅샷 작성 템플릿

```markdown
# Context Snapshot ({YYYY-MM-DD HH:MM})

## 현재 작업
- 무엇을 하고 있었는가 (태스크 ID 포함)
- 어디까지 완료했는가

## 진행 상태
- [x] 완료된 항목
- [ ] 미완료 항목
- [ ] 다음에 할 작업

## 수정한 파일
- path/to/file1.rs — 변경 요약
- path/to/file2.swift — 변경 요약

## 핵심 결정 사항
- 결정 1: 이유
- 결정 2: 이유

## 대기 중인 보고/응답
- {session-id}: 무엇을 기다리는 중

## 디버깅 컨텍스트 (있는 경우)
- 에러 메시지 요약
- 시도한 접근법
- 유력한 원인
```

### 스냅샷 작성 절차

```
1. 현재 작업 상태를 위 템플릿으로 .context-snapshot.md에 저장
2. 저장 확인 (파일 존재 + 내용 비어있지 않음)
3. compact 실행 — 사용자에게 /compact를 요청하지 않는다:
   - 오케스트레이터: `bin/context-compact.sh` 실행. 스냅샷이 없거나 오래됐으면(기본 900초) 거부(exit 3)하고,
     아니면 자기 telepty 세션에 CLI별 compaction 명령(Phase 3 표)을 주입한다. 이 턴이 끝나면 compaction이 일어난다.
   - 하위 세션(telepty 자기 접근 없음): 오케스트레이터에 "CONTEXT: compact 예정" 보고 후 오케스트레이터의 compaction을 기다린다.
4. compaction 후 복원 경로는 CLI마다 다르다 — Phase 3 표. 복원 줄이 보이지 않으면 Phase 3를 직접 실행한다.
```

## Phase 3: 복원 (compact 후 필수)

| CLI | compaction 명령 | 복원이 오는 경로 |
|-----|----------------|-----------------|
| claude | `/compact` | SessionStart(compact) 훅 — 프로젝트 `.claude/hooks/session-start-compact.sh`, 없으면 devkit 사용자 훅 `hooks/post-compact-restore.sh`가 스냅샷을 새 컨텍스트에 출력 |
| codex | `/compact` | 오케스트레이터의 `bin/context-compact.sh`가 compaction 후 복원 줄을 주입 + role contract의 instruction backstop |
| gemini, agy | `/compress` | 동일 — `bin/context-compact.sh` 주입 + instruction backstop |
| grok | `/compact` | 동일 — `bin/context-compact.sh` 주입 + instruction backstop |

claude 외 CLI에는 devkit이 복원 훅을 설치하지 않는다: gemini/agy에는 compaction 후 훅이 없고, grok의 PostCompact 훅은
passive라 stdout이 모델에 전달되지 않는다. claude 훅 출력 첫 줄은 "CONTEXT SNAPSHOT restored after compact".
복원 줄이 없으면 수동으로:

```
1. .context-snapshot.md 읽기
2. 현재 git status 확인 (수정 파일 목록과 스냅샷 대조)
3. 미완료 항목 확인
4. 대기 중인 보고/응답 확인
5. 작업 재개
```

### 복원 체크리스트

- [ ] 스냅샷 읽었는가?
- [ ] 현재 git status와 스냅샷이 일치하는가?
- [ ] 미완료 항목을 파악했는가?
- [ ] 대기 중인 외부 응답이 있는가?

From dmsdc-ai/aigentry-devkit, MIT.

More from dmsdc-ai/aigentry-devkit

Signals

Stars
0
Forks
0
Open issues
5
Last commit (this folder)
Oct 9, 2026 (20 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from dmsdc-ai

Cite this page

context-manage skill. Agent Mart. https://agentmart.dev/skills/dmsdc-ai-context-manage (last updated 2026-10-24)