본문으로 건너뛰기
Skillpedia
에이전트48k · #4249

context-compression

하는 일

이 도구는 가장 중요한 부분을 요약해 AI가 긴 대화를 기억하도록 돕습니다. AI가 과제를 완료하는 데 필수적인 내용에 집중하도록 합니다.

사용하는 경우

  • ✓AI와의 대화가 너무 길어져 정보를 잊기 시작할 때.
  • ✓AI가 한 번에 모두 ‘볼’ 수 없는 큰 코드 프로젝트를 다룰 때.
  • ✓AI가 참고할 수 있는 대화 요약을 만들고 싶은 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/context-compression/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/context-compression/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“지금까지의 대화를 파일 변경과 내린 결정 중심으로 요약해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

AI는 의도, 수정된 파일, 다음 단계 같은 중요한 정보를 담은 구조화된 요약을 만듭니다. 대화가 너무 길어지면 새로운 부분을 요약하고 이전 요약과 병합합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Context Compression Strategies

When agent sessions generate millions of tokens of conversation history, compression becomes mandatory. The naive approach is aggressive compression to minimize tokens per request. The correct optimization target is tokens per task: total tokens consumed to complete a task, including re-fetching costs when compression loses critical information.

When to Use

Activate this skill when:

  • Agent sessions exceed context window limits
  • Codebases exceed context windows (5M+ token systems)
  • Designing conversation summarization strategies
  • Debugging cases where agents "forget" what files they modified
  • Building evaluation frameworks for compression quality

Core Concepts

Context compression trades token savings against information loss. Three production-ready approaches exist:

  1. Anchored Iterative Summarization: Maintain structured, persistent summaries with explicit sections for session intent, file modifications, decisions, and next steps. When compression triggers, summarize only the newly-truncated span and merge with the existing summary. Structure forces preservation by dedicating sections to specific information types.

  2. Opaque Compression: Produce compressed representations optimized for reconstruction fidelity. Achieves highest compression ratios (99%+) but sacrifices interpretability. Cannot verify what was preserved.

  3. Regenerative Full Summary: Generate detailed structured summaries on each compression. Produces readable output but may lose details across repeated compression cycles due to full regeneration rather than incremental merging.

The critical insight: structure forces preservation. Dedicated sections act as checklists that the summarizer must populate, preventing silent information drift.

Detailed Topics

Why Tokens-Per-Task Matters

Traditional compression metrics target tokens-per-request. This is the wrong optimization. When compression loses critical details like file paths or error messages, the agent must re-fetch information, re-explore approaches, and waste tokens recovering context.

The right metric is tokens-per-task: total tokens consumed from task start to completion. A compression strategy saving 0.5% more tokens but causing 20% more re-fetching costs more overall.

The Artifact Trail Problem

Artifact trail integrity is the weakest dimension across all compression methods, scoring 2.2-2.5 out of 5.0 in evaluations. Even structured summarization with explicit file sections struggles to maintain complete file tracking across long sessions.

Coding agents need to know:

  • Which files were created
  • Which files were modified and what changed
  • Which files were read but not changed
  • Function names, variable names, error messages

This problem likely requires specialized handling beyond general summarization: a separate artifact index or explicit file-state tracking in agent scaffolding.

Structured Summary Sections

Effective structured summaries include explicit sections:

## Session Intent
[What the user is trying to accomplish]

## Files Modified
- auth.controller.ts: Fixed JWT token generation
- config/redis.ts: Updated connection pooling
- tests/auth.test.ts: Added mock setup for new config

## Decisions Made
- Using Redis connection pool instead of per-request connections
- Retry logic with exponential backoff for transient failures

## Current State
- 14 tests passing, 2 failing
- Remaining: mock setup for session service tests

## Next Steps
1. Fix remaining test failures
2. Run full test suite
3. Update documentation

This structure prevents silent loss of file paths or decisions because each section must be explicitly addressed.

Compression Trigger Strategies

When to trigger compression matters as much as how to compress:

Strategy Trigger Point Trade-off
Fixed threshold 70-80% context utilization Simple but may compress too early
Sliding window Keep last N turns + summary Predictable context size
Importance-based Compress low-relevance sections first Complex but preserves signal
Task-boundary Compress at logical task completions Clean summaries but unpredictable timing

The sliding window approach with structured summaries provides the best balance of predictability and quality for most coding agent use cases.

Probe-Based Evaluation

…

자주 묻는 질문

‘토큰’이 왜 중요한가요?

토큰은 AI가 텍스트를 이해하고 생성하는 데 쓰는 단어나 단어의 일부입니다. 긴 대화는 많은 토큰을 사용하는데, 이 도구는 중요한 정보를 잃지 않으면서 그 수를 줄이도록 돕습니다.

AI가 어떤 파일을 건드렸는지 잊을 수 있나요?

네, 매우 긴 대화에서는 이런 일이 생길 수 있습니다. 이 도구는 AI가 길을 잃지 않도록 수정된 파일의 기록을 명확하게 유지하려고 합니다.

이 도구를 가장 잘 사용하는 방법은 무엇인가요?

대화가 길어지거나, 큰 프로젝트의 특정 세부 사항을 AI가 기억해야 할 때 사용하는 것이 좋습니다. 구조화된 요약은 AI가 핵심에 집중하도록 돕습니다.

상세 정보

작성자의 원본 설명

When agent sessions generate millions of tokens of conversation history, compression becomes mandatory. The naive approach is aggressive compression to minimize tokens per request.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4249
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬