Skip to content

joeyism/opencode-context-warning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenCode Context Warning Plugin

OpenCode plugin that warns agents about context window consumption and nudges handoff

Installation

npm install opencode-context-warning

Features

  • Monitors the LLM context window token usage during the session.
  • Provides customizable warnings (e.g., at 70% capacity) to prompt the agent to summarize.
  • Forces sub-agent handoffs when context approaches maximum limits (e.g., 90%).
  • Prevents degradation of reasoning quality caused by bloated context windows.

Usage

This is a plugin for OpenCode.

You can easily enable this plugin globally by adding it to your opencode.json (or opencode.jsonc) configuration file under the plugins array.

{
  "plugins": [
    "opencode-context-warning"
  ]
}

Once added to your configuration, OpenCode will automatically load and activate the plugin whenever it starts.

Alternatively, if you are configuring OpenCode programmatically via the SDK, you can register it like this:

import { configureAgent } from '@opencode-ai/sdk';
import plugin from 'opencode-context-warning';

const agent = configureAgent({
  plugins: [
    plugin({
      // Provide configuration options here
    })
  ]
});

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors