Skip to content
    ↑↓ select↵ openesc close
    English中文
    joeyism

    Context Warning

    v0.1.0Memory & Context
    opencode-context-warning

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

    GitHub stars

    1

    Monthly installs

    328

    3 in 7 days

    Composite scoreSCORE

    34.2

    Multi-signal model

    Last commit

    2 months ago

    2026-06-07

    Install and configure

    opencode.json

    Writes to this project's opencode.json — applies to this repository only.

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-context-warning@0.1.0"]
    }

    opencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.

    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