explaingit

ranxianglei/opencode-acp

Analysis updated 2026-06-24

28TypeScriptAudience · developerComplexity · 3/5Setup · easy

TLDR

An OpenCode plugin that lets the AI model itself decide when to compress old chat messages into summaries so coding sessions can run past 10,000 messages without losing the early context.

Mindmap

mindmap
  root((opencode-acp))
    Inputs
      OpenCode conversation history
      acp.jsonc config
      Slash commands
    Outputs
      Compressed summaries
      Token usage stats
      Pruned tool calls
    Use Cases
      Extend long coding sessions
      Survive OpenCode restarts
      Manually compress chunks
      Trim errored tool inputs
    Tech Stack
      TypeScript
      OpenCode
      npm
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Keep an OpenCode session going past 10,000 messages without manual reset

USE CASE 2

Trigger one-off compression of a finished task with /acp compress

USE CASE 3

Inspect token usage by category with /acp context

USE CASE 4

Restore an earlier summary back to raw history with /acp decompress

What is it built with?

TypeScriptOpenCodenpm

How does it compare?

ranxianglei/opencode-acpaudemodo/audemodo-responsive-keepalivecahn91/gpt-repo-mcp
Stars282828
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasyeasymoderate
Complexity3/52/53/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

OpenCode's built-in auto-compaction must be turned off in opencode.json or with OPENCODE_DISABLE_AUTOCOMPACT=1 or the two systems conflict.

In plain English

This package is a plugin for OpenCode, an AI coding tool. The plugin's job is to keep the conversation between you and the AI from growing too long. As you chat back and forth with an AI assistant, every message and every file you share gets added to what is called the context window. Once that window fills up, the assistant either forgets the start of the conversation or has to be reset. ACP, which stands for Active Context Pruning, lets the model itself decide when older parts of the conversation are safe to summarize and which parts to summarize, so the chat can keep going much longer. ACP is a hardened fork of an earlier project called DCP, with 35 bug fixes applied. The README claims this turns sessions from roughly 200 messages before instability into 10,000 plus messages, drops the per-turn overhead from 20 to 50 seconds down to about 90 milliseconds, and lets the compression state survive a restart instead of being lost. The model is given a tool called compress that it can call whenever a chunk of the conversation is done with, and the tool replaces that chunk with a high-fidelity summary while the raw history is kept behind the scenes. The plugin offers two ways of compressing. Range mode shrinks a contiguous block of messages into one summary. Message mode is experimental and lets the model compress individual messages one at a time for finer control. On top of compression, ACP removes duplicate tool calls and trims the input from errored tool calls after a few turns, keeping the error message itself intact. Users interact with ACP through slash commands such as /acp context for a token breakdown, /acp stats for cumulative numbers, /acp sweep to prune recent tools, /acp compress to trigger one compression manually, and /acp decompress to restore a past summary. Configuration lives in an acp.jsonc file at a global, custom, or project level, with project settings winning. The README is clear that OpenCode's own built-in auto-compaction must be turned off when ACP is enabled, since the two systems conflict. Installation is a single command, or an entry in the OpenCode config file. The package is published on npm with English and Chinese READMEs.

Copy-paste prompts

Prompt 1
Install opencode-acp globally and disable OpenCode auto-compaction in my opencode.json
Prompt 2
Show me an acp.jsonc that uses message mode with protectUserMessages enabled
Prompt 3
Walk me through what happens in opencode-acp when the model calls the compress tool in range mode
Prompt 4
Explain how /acp sweep prunes tools and which protectedTools are respected
Prompt 5
Compare opencode-acp range mode vs message mode for a long refactoring session

Frequently asked questions

What is opencode-acp?

An OpenCode plugin that lets the AI model itself decide when to compress old chat messages into summaries so coding sessions can run past 10,000 messages without losing the early context.

What language is opencode-acp written in?

Mainly TypeScript. The stack also includes TypeScript, OpenCode, npm.

How hard is opencode-acp to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is opencode-acp for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.