
context-management
Install
/plugin install context-management@claude-integrationRun it inside Claude Code after adding the marketplace with /plugin marketplace add m16khb/claude-integration.
Contents
Discovered from sourceCommands 2
Context-Aware Task Continuation
MISSION
로드된 컨텍스트를 분석하고 끊긴 작업을 자동 재개합니다.
Focus Area (optional): $ARGUMENTS
CORE PRINCIPLES
├─ 로드된 모든 컨텍스트 완전 파악
├─ 마지막 작업 지점 식별
├─ 중단된 작업 자동 재개
└─ Sequential Thinking으로 논리적 분석
PHASE 1: Deep Context Analysis
Sequential Thinking으로 분석:
- 로드된 파일 목록 파악
- 각 파일 핵심 내용 이해
- 파일 간 관계/의존성
- 수행된 작업 추적
- 마지막 작업 지점 식별
- 미완료 작업 탐지
SCAN:
├─ LOADED FILES: 경로, 크기, 역할
├─ FILE RELATIONSHIPS: import/export, 호출 관계
├─ WORK HISTORY: 완료/진행중/중단
└─ LAST WORK POINT: 마지막 요청, 마지막 수정
PHASE 2: Context Summary
## 📊 컨텍스트 분석 결과
### 📁 로드된 파일 ({count}개)
| 파일 | 라인 | 역할 |
|------|------|------|
### ✅ 완료된 작업
- {task1}
### 🔄 중단된 작업
- ⏸️ {interrupted_task}
- 중단 지점: {break_point}
PHASE 3: Continuation Strategy
DECISION LOGIC:
IF interrupted_task EXISTS:
→ 자동 재개
ELIF explicit_next_step EXISTS:
→ 다음 단계 진행
ELIF $ARGUMENTS (focus-area) PROVIDED:
→ 해당 영역 작업
ELIF logical_next_step INFERRED:
→ 추론된 단계 진행
ELSE:
→ TUI로 선택 제공
Continuation Patterns
| 마지막 작업 | 다음 단계 |
|---|---|
| 코드 작성 완료 | 테스트 → 커밋 |
| 분석 완료 | 구현 시작 |
| 테스트 실패 | 버그 수정 |
| 커밋 완료 | 푸시 또는 다음 작업 |
PHASE 4: Execute or Recommend
4.1 자동 재개
PRINT "🔄 마지막 작업을 이어서 진행합니다..."
EXECUTE interrupted_task from break_point
4.2 추천 TUI
AskUserQuestion:
question: "어떤 작업을 진행하시겠습니까?"
options:
- {recommendation_1}
- {recommendation_2}
- 직접 지시
Dynamic Recommendations
IF uncommitted_changes → "변경사항 커밋"
IF code_written AND no_tests → "테스트 작성"
IF tests_failed → "테스트 수정"
IF todo_items_pending → "할 일 처리"
ERROR HANDLING
| Error | Response |
|---|---|
| No context | "/inject-context로 파일 로드" |
| Empty conversation | "무엇을 도와드릴까요?" |
| Ambiguous state | Sequential Thinking 분석 후 TUI |
Documentation
상세 내용은 agent-docs/ 참조:
- @../agent-docs/context-analysis.md - 컨텍스트 분석, 작업 추천
- @../agent-docs/recovery-patterns.md - 세션 복구, MCP Memory 연동
- @../agent-docs/chunking-algorithm.md - 청킹 알고리즘
Intelligent File Context Loader
MISSION
대용량 파일을 원문 그대로 컨텍스트에 주입합니다.
Input: $ARGUMENTS
CORE PRINCIPLES
├─ 원문 그대로 컨텍스트에 주입 (요약 아님)
├─ 구조적 경계 존중 청킹
├─ MCP Memory 연동 (선택적)
└─ 사용자 자유 작업 지원
PHASE 1: Parse Arguments
PARSE $ARGUMENTS:
├─ FILE_PATH = 파일 경로
├─ TASK = 작업 지시 (선택)
└─ VALIDATE: 파일 존재 + 텍스트 파일 확인
PHASE 2: File Analysis
ls -lh "{FILE_PATH}"
wc -l < "{FILE_PATH}"
file "{FILE_PATH}"
PHASE 2.5: MCP Memory (Optional)
MCP memory-service 설치 시 관련 메모리 자동 로드:
- 파일 경로로 검색
- 모듈명으로 검색
- 없으면 조용히 스킵
PHASE 3: Structure Detection
언어별 AST 경계 탐지:
case "$EXT" in
py) grep -n "^class \|^def " "{FILE_PATH}" ;;
ts|js) grep -n "^export \|^class \|^function " "{FILE_PATH}" ;;
go) grep -n "^func \|^type " "{FILE_PATH}" ;;
md) grep -n "^# \|^## " "{FILE_PATH}" ;;
*) grep -n "^$" "{FILE_PATH}" ;;
esac | head -50
PHASE 4: Chunking Strategy
| 설정 | 값 | 설명 |
|---|---|---|
| Chunk size | 800줄 | 원문 보존 최대화 |
| Overlap | 20줄 | 컨텍스트 연속성 |
| Max chunks | 15 | 대용량 지원 |
ALGORITHM:
├─ 800줄 이하: 단일 청크
└─ 800줄 초과: 경계점 기준 분할 + 오버랩
PHASE 5: Content Loading
FOR each chunk:
PRINT "===== 📄 청크 {i}/{total} [라인 {start}-{end}] ====="
Read(file_path, offset=start, limit=end-start+1)
END FOR
PHASE 6: Completion Report
╔═══════════════════════════════════════════╗
║ 📁 파일 컨텍스트 로딩 완료 ║
╠═══════════════════════════════════════════╣
║ 파일: {FILE_PATH} ║
║ 크기: {TOTAL_LINES}줄 ║
║ 청크: {chunk_count}개 ║
╠═══════════════════════════════════════════╣
║ 📌 원문 그대로 로드 완료 ║
║ 자유롭게 작업을 진행하세요. ║
╚═══════════════════════════════════════════╝
PHASE 7: Optional Follow-up
IF TASK provided:
AskUserQuestion:
- 작업 진행
- 추가 파일 로드
- 다른 작업
- 완료
ELSE:
EXIT (사용자 자유 작업)
ERROR HANDLING
| Error | Response |
|---|---|
| File not found | Glob으로 유사 파일 제안 |
| Binary file | "바이너리 지원 안 함" |
| Token overflow | 청크 크기 50% 감소 재시도 |
| Empty file | "빈 파일" 알림 |
Documentation
상세 알고리즘은 agent-docs/ 참조:
- @../agent-docs/chunking-algorithm.md - 구조 인식 청킹, 언어별 AST 파싱
- @../agent-docs/context-analysis.md - 컨텍스트 분석, 작업 추천
- @../agent-docs/recovery-patterns.md - MCP Memory 연동, 세션 복구
Sponsors
Details
- Marketplace
- m16khb/claude-integration
- Source
- plugins/context-management
- Category
- Productivity