/ 디렉터리 / 플레이그라운드 / Context Mode
● 커뮤니티 mksglu ⚡ 바로 사용

Context Mode

제작: mksglu · mksglu/context-mode

SQLite의 샌드박스 도구 출력 및 세션 상태 유지 — 토큰 낭비가 98% 감소하고 압축 기억 상실이 더 이상 발생하지 않습니다.

컨텍스트 모드는 "LLM이 무엇을 했는지 잊어버렸습니다" 문제를 두 가지 방법으로 해결합니다. 첫째, 샌드박스 도구는 컨텍스트 창에서 원시 데이터를 캡처합니다(극작가 스냅샷: 56KB → 색인화됨, 에이전트가 필요한 것을 검색함). 둘째, 세션별 SQLite 이벤트 로그는 컨텍스트 압축을 유지합니다. 즉, 모델이 원래 있었던 위치를 정확하게 선택합니다. 12개 플랫폼용 플러그인 + MCP로 제공됩니다.

왜 쓰나요

핵심 기능

라이브 데모

실제 사용 모습

context-mode-mcp.replay ▶ 준비됨
0/0

설치

클라이언트 선택

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "context-mode-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "context-mode"
      ]
    }
  }
}

Claude Desktop → Settings → Developer → Edit Config 열기. 저장 후 앱 재시작.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "context-mode-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "context-mode"
      ]
    }
  }
}

Cursor는 Claude Desktop과 동일한 mcpServers 스키마 사용. 프로젝트 설정이 전역보다 우선.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "context-mode-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "context-mode"
      ]
    }
  }
}

Cline 사이드바의 MCP Servers 아이콘 클릭 후 "Edit Configuration" 선택.

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "context-mode-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "context-mode"
      ]
    }
  }
}

Claude Desktop과 같은 형식. Windsurf 재시작 후 적용.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "context-mode-mcp",
      "command": "npx",
      "args": [
        "-y",
        "context-mode"
      ]
    }
  ]
}

Continue는 맵이 아닌 서버 오브젝트 배열 사용.

~/.config/zed/settings.json
{
  "context_servers": {
    "context-mode-mcp": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "context-mode"
        ]
      }
    }
  }
}

context_servers에 추가. 저장 시 Zed가 핫 리로드.

claude mcp add context-mode-mcp -- npx -y context-mode

한 줄 명령. claude mcp list로 확인, claude mcp remove로 제거.

사용 사례

실전 활용법: Context Mode

원시 도구 출력에서 ​​컨텍스트 낭비를 중지하세요.

👤 세션 중간에 압축을 당한 Heavy Claude Code 사용자 ⏱ ~15 min intermediate

언제 쓸까: 30분 후에 에이전트가 "잊었다"고 느끼고 다시 읽으면 $$가 소모됩니다.

사전 조건
  • 클로드 코드 v1.0.33+brew 업그레이드 claude-code 또는 npm update -g @anthropic-ai/claude-code
흐름
  1. 설치하다
    /plugin marketplace add mksglu/context-mode
    /plugin install context-mode@context-mode✓ 복사됨
    → Plugin registers hooks + 6 sandbox tools
  2. 확인하다
    /context-mode:ctx-doctor✓ 복사됨
    → All checks [x]
  3. 정상적으로 사용
    Now do a big task that would normally blow context — e.g. analyze all .log files under /var/log✓ 복사됨
    → ctx_execute used instead of raw Read; output indexed not dumped
  4. 절감액 확인
    /context-mode:ctx-stats✓ 복사됨
    → Per-tool reduction ratio reported

결과: 동일한 작업, 압축 전 시간이 10배 더 길어지고 에이전트가 기억합니다.

함정
  • Other MCPs bypass the routing — Pass their tool calls through ctx_batch_execute for consistent accounting
함께 쓰기: 세레나

모델 압축 후 긴 작업을 원활하게 재개

👤 여러 시간 동안 진행되는 에이전트 세션의 개발자 ⏱ ~5 min beginner

언제 쓸까: 작업이 너무 커서 하나의 컨텍스트 창에 맞지 ​​않습니다.

흐름
  1. --계속으로 시작
    [CLI flag] claude --continue✓ 복사됨
    → Prior session's SQLite loaded
  2. 관찰하다
    What did I last ask you about? What tasks are in progress?✓ 복사됨
    → Accurate recap from FTS5 index, not hallucinated

결과: 진정으로 재개 가능한 워크플로입니다.

함정
  • Forgetting --continue starts fresh — Persistence requires --continue; absence means deliberate fresh start

조합

다른 MCP와 조합해 10배 효율

context-mode-mcp + serena

Serena for semantic code nav, context-mode for keeping its output out of context

조회에는 serena를 사용하고 결과를 사후 처리하려면 ctx_execute를 사용합니다.✓ 복사됨
context-mode-mcp + playwright

Page snapshot output stays sandboxed

극작가를 통해 페이지의 스냅샷을 찍고 컨텍스트 모드에서 보관하도록 하세요. 버리는 대신 검색하세요.✓ 복사됨

도구

이 MCP가 노출하는 것

도구입력언제 호출비용
ctx_execute code: str (js/python) 데이터를 처리하는 스크립트를 실행합니다. 필요한 것만 출력 free
ctx_batch_execute ops: [{tool, args}] 샌드박스를 통해 여러 도구 호출 래핑 free
ctx_index content: str, tags?: [] 나중에 검색할 수 있도록 데이터를 보관합니다. free
ctx_search query: str 세션 인덱스에서 검색 free
ctx_fetch_and_index url: str URL을 가져와서 문맥에서 벗어나 검색 가능하도록 유지하세요. free
ctx_stats none 얼마나 많은 컨텍스트가 저장되었는지 확인하세요. free

비용 및 제한

운영 비용

API 쿼터
현지의
호출당 토큰
극적인 감소 — 실제 세션에서 98% 인용
금액
무료(ELv2 라이센스)
세션이 클수록 승리도 커집니다. 긴 작업에 사용하세요.

보안

권한, 시크릿, 파급범위

자격 증명 저장: ~/.context-mode/의 세션 SQLite
데이터 외부 송신: None

문제 해결

자주 발생하는 오류와 해결

ctx-doctor에 누락된 후크가 표시됩니다.

설치 후 Claude Code를 완전히 다시 시작하십시오. 시작 시 후크 등록

확인: Re-run /context-mode:ctx-doctor
샌드박스는 코드를 실행하지 않습니다

노드/Python 런타임이 누락되었습니다. 의사가 어느 것인지 알려줍니다. Brew/asdf로 설치합니다.

검색 결과가 없습니다.

FTS5 빌드 확인: sqlite3 ~/.context-mode/session.db "SELECT name FROM sqlite_master". 깨진 경우 다시 설치하십시오.

대안

Context Mode 다른 것과 비교

대안언제 쓰나단점/장점
Raw Claude Code (no plugin)결코 압축되지 않는 짧은 세션컨텍스트 저장 없음
claude-mem샌드박스 도구 패러다임이 없는 메모리 계층을 원합니다.다양한 절충 — 메모리만 있고 도구 출력 샌드박스 없음

더 보기

리소스

📖 GitHub에서 공식 README 읽기

🐙 열린 이슈 보기

🔍 400+ MCP 서버 및 Skills 전체 보기