ClaudeMods
☰
KO
● 0 명 접속 중 · 조회 0 회
후원프로젝트 제출
GitHub 저장소 · 작성자 pablontiv

a4s-context-expert

Jev가 이끄는 Claude Code 결정론적 압축입니다. TypeSafe Jev가 점수화한 보존/잘라내기/삭제 전사를 기본 요약 대신 사용하고, Jev가 적절하다고 판단하는 순간 자동으로 압축합니다.

pablontiv@pablontiv

pablontiv/a4s/tree/main/packages/context-expert/adapters/claude

번역 완료

이 mod 소개

a4s-context-expert (Claude Code plugin)

Jev가 이끄는 Claude Code 결정론적 압축입니다. Claude의 기본 /compact 요약을 TypeSafe Jev가 점수화한 보존 / 잘라내기 / 삭제 전사로 바꾸고, 컨텍스트 창이 임계값을 넘으면 자동으로 압축합니다. trigger.mode: "auto"를 사용하는 Pi의 pi-context-expert에 대응하는 Claude 버전입니다.

이 디렉터리는 자체 완결형 마켓플레이스 플러그인입니다. 호스트와 무관한 코어 사본(core/)을 포함하며, scripts/sync-core.mjs가 정식 packages/context-expert/core/와 바이트 단위로 동일하게 유지하고 claude-bundle-parity 테스트가 이를 고정합니다. 마켓플레이스는 이 디렉터리만 설치하기 때문입니다.

하는 일

  • session.compact — 실시간 전사에 공유 코어를 실행합니다. Jev는 각 도구 호출/결과에 점수를 매깁니다. 보존 임계값보다 낮은 항목은 삭제(호출)하거나 잘라내고(결과), 첫 메시지와 가장 최근 N개는 고정합니다. 재구성된 메시지 배열이 기본 요약을 대신합니다. 예상 감소율이 minReductionRatio보다 낮거나 무엇이든 실패하면 next(event)를 통해 기본 요약으로 돌아갑니다. 실패 때문에 세션이 나빠지는 일은 없습니다.
  • turn.complete — Jev가 결정하는 자동 압축 트리거입니다. 고정 비율에서 압축하지 않습니다. 로컬 하한(minimumContextRatio)을 넘고 쿨다운과 사용 가능한 자격 증명을 만족하면, 텍스트가 없는 상태를 Jev에 보내 지금이 압축할 이상적인 순간인지 묻습니다. Jev가 compact를 선택할 때만 실행합니다. triggerMode가 이후 동작을 정합니다. auto는 압축하고, hint는 /compact만 제안하며, off는 비활성화합니다. pi-context-expert의 trigger.mode에 대응하는 Claude 버전입니다.

자격 증명

TypeSafe Jev 키는 플러그인 apiKey userConfig, TYPESAFE_API_KEY, 플러그인 설정의 env, 마지막으로 Pi 기본 자격 증명 제공자(~/.pi/agent/auth.json → typesafe.key) 순서로 확인합니다. 이는 A4S 작업 방식이 허용하는(do_work.credentials) 출처입니다. 키는 프로세스 안에서만 읽고 로그에 남기거나 디스크에 쓰거나 다른 곳에 복사하지 않습니다.

설치 (A4S 마켓플레이스에서)

claude plugin marketplace add pablontiv/a4s
claude plugin install a4s-context-expert@a4s

체크아웃에서 직접 불러올 수도 있습니다.

claude --plugin-dir packages/context-expert/adapters/claude

설정 (userConfig)

| 키 | 기본값 | 의미 | | --- | --- | --- | | triggerMode | auto | auto(Jev가 결정한 뒤 압축), hint(/compact 제안), off 중 하나입니다. | | minimumContextRatio | 0.5 | 컨텍스트 창 채움 비율(0..1)입니다. 이 값보다 낮으면 트리거가 Jev에 묻지 않습니다. | | minReductionRatio | 0.25 | 기록을 바꿀 때 필요한 최소 예상 감소율입니다. 이보다 낮으면 기본 요약을 사용합니다. | | keepThreshold | 0.5 | 도구 호출/결과를 보존하기 위한 최소 Jev 확률입니다. | | preserveRecentMessages | 6 | 압축에서 고정해 둘 최신 메시지 수입니다. | | maxStateTokens / maxRequestTokens | 25000 / 30000 | Jev 요청 토큰 예산입니다. | | truncateHeadChars | 300 | 잘라낸 도구 결과에서 보존할 문자 수입니다. | | model | jev-latest | TypeSafe Jev 모델입니다. | | apiKey | — | TypeSafe 키 재정의(민감 정보)입니다. 그렇지 않으면 위 순서로 확인합니다. |

자동 압축 트리거를 끄려면 triggerMode를 off로 설정하세요.

fast-jev-compaction(MIT)에서 파생되었습니다. NOTICE를 참조하세요.

설치

먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.

claude plugin marketplace add pablontiv/a4s
claude plugin install a4s-context-expert
원문 / README

a4s-context-expert (Claude Code plugin)

Jev-guided deterministic compaction for Claude Code. It replaces Claude's native /compact summary with a keep / truncate / drop transcript scored by TypeSafe Jev, and auto-compacts once the context window crosses a threshold — the Claude analog of Pi's pi-context-expert with trigger.mode: "auto".

This directory is the self-contained marketplace plugin. It bundles its own copy of the host-neutral core (core/), kept byte-identical to the canonical packages/context-expert/core/ by scripts/sync-core.mjs and anchored by the claude-bundle-parity test, because the marketplace installs only this directory.

What it does

  • session.compact — runs the shared core over the live transcript. Jev scores each tool call/result; items below the keep threshold are dropped (calls) or truncated (results), the first message and the most recent N are pinned, and the rebuilt message array replaces the native summary. If the estimated reduction is below minReductionRatio, or anything fails, it falls back to the native summary via next(event) — a failure never degrades the session.
  • turn.complete — the Jev-decided auto-compact trigger. It does not compact at a fixed percentage. Past a local floor (minimumContextRatio), and subject to a cooldown and an available credential, it asks Jev — with a text-free state — whether now is the ideal moment to compact, and acts only when Jev chooses compact. triggerMode controls what then happens: auto compacts, hint only suggests /compact, off disables it. This is the Claude analog of pi-context-expert's trigger.mode.

Credentials

The TypeSafe Jev key resolves, in order, from the plugin apiKey userConfig, then TYPESAFE_API_KEY, then the plugin settings env, and finally Pi's native credential provider (~/.pi/agent/auth.json → typesafe.key) — the source the A4S way-of-working sanctions (do_work.credentials). The key is read in-process only; it is never logged, written to disk, or copied elsewhere.

Install (from the A4S marketplace)

claude plugin marketplace add pablontiv/a4s
claude plugin install a4s-context-expert@a4s

Or load it directly from a checkout:

claude --plugin-dir packages/context-expert/adapters/claude

Configuration (userConfig)

| Key | Default | Meaning | | --- | --- | --- | | triggerMode | auto | auto (Jev decides, then compacts), hint (suggest /compact), or off. | | minimumContextRatio | 0.5 | Context-window fill (0..1) below which the trigger never asks Jev. | | minReductionRatio | 0.25 | Minimum estimated reduction to replace history; below it, native summary. | | keepThreshold | 0.5 | Minimum Jev probability to keep a tool call/result. | | preserveRecentMessages | 6 | Newest messages pinned from compaction. | | maxStateTokens / maxRequestTokens | 25000 / 30000 | Jev request token budgets. | | truncateHeadChars | 300 | Characters of a truncated tool result kept. | | model | jev-latest | TypeSafe Jev model. | | apiKey | — | TypeSafe key override (sensitive); otherwise resolved as above. |

To turn the auto-compact trigger off, set triggerMode to off.

Derived from fast-jev-compaction (MIT) — see NOTICE.

비슷한 프로젝트