From 61bbbcb577511f051169af34fa0de501c2e6ce75 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Wed, 10 Dec 2025 16:48:17 +0900 Subject: [PATCH] feat(hooks): integrate anthropic-auto-compact hook for automatic context summarization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enables automatic session summarization when Anthropic token limits are exceeded. The hook detects token limit errors and triggers compact operation on session idle. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) --- src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/index.ts b/src/index.ts index 13a89dd..d7204de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,6 +10,7 @@ import { createEmptyTaskResponseDetectorHook, createThinkModeHook, createClaudeCodeHooksHook, + createAnthropicAutoCompactHook, } from "./hooks"; import { loadUserCommands, @@ -80,6 +81,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { const emptyTaskResponseDetector = createEmptyTaskResponseDetectorHook(ctx); const thinkMode = createThinkModeHook(); const claudeCodeHooks = createClaudeCodeHooksHook(ctx, {}); + const anthropicAutoCompact = createAnthropicAutoCompactHook(ctx); updateTerminalTitle({ sessionId: "main" }); @@ -140,6 +142,7 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => { await contextWindowMonitor.event(input); await directoryAgentsInjector.event(input); await thinkMode.event(input); + await anthropicAutoCompact.event(input); const { event } = input; const props = event.properties as Record | undefined;