SkillsLLM
CategoriesBlogAI NewsAbout
HomeAI Agentsopencode-background-agents

opencode-background-agents

by kdcokenny

Pending

Claude Code-style background agents for OpenCode – async delegation with context persistence

114stars
7forks
TypeScript
Added 3/9/2026
View on GitHubDownload ZIP
AI Agentsai-agentsasyncbackground-agentsclaude-codedelegationocxopencodeopencode-plugintypescript
Installation
# Add to your Claude Code skills
git clone https://github.com/kdcokenny/opencode-background-agents
README.md

opencode-background-agents

Keep working while research runs in the background. Your work survives context compaction.

A plugin for OpenCode that enables async background delegation. Fire off research tasks, continue brainstorming or coding, and retrieve results when you need them.

Why This Exists

Context windows fill up. When that happens, compaction kicks in and your AI loses track of research it just did. You end up re-explaining, re-researching, starting over.

Background agents solve this:

  • Keep working - Delegate research and continue your conversation. Brainstorm, code review, discuss architecture - you're not blocked waiting.
  • Survive compaction - Results are saved to disk as markdown. When context gets tight, the AI knows exactly where to retrieve past research.
  • Fire and forget - Use the "waiter model": you don't follow the waiter to the kitchen. A notification arrives when your order is ready.

Installation

ocx add kdco/background-agents --from https://registry.kdco.dev

If you don't have OCX installed, install it from the OCX repository.

Optional: Install kdco-workspace for the full experience—it bundles background agents with specialist agents, planning tools, and research protocols:

ocx add kdco/workspace --from https://registry.kdco.dev

How It Works

1. Delegate    →  "Research OAuth2 PKCE best practices"
2. Continue    →  Keep coding, brainstorming, reviewing
3. Notified    →  <system-reminder> tells you it's done
4. Retrieve    →  AI calls delegation_read() to get the result

Results are persisted to ~/.local/share/opencode/delegations/ as markdown files. Each delegation is automatically tagged with a title and summary, so the AI can scan past research and find what's relevant.

Usage

The plugin adds three tools:

| Tool | Purpose | |------|---------| | delegate(prompt, agent) | Launch a background task | | delegation_read(id) | Retrieve a specific result | | delegation_list() | List all delegations with titles and summaries |

Limitations

Read-Only Agents Only

Only read-only agents (researcher, explore) can use delegate. Write-capable agents (coder, scribe) must use the native task tool.

Why? Background delegations run in isolated sessions outside OpenCode's session tree. The undo/branching system cannot track changes made in background sessions—reverting would not affect these changes, risking unexpected data loss.

A workaround is being explored.

Timeout

Delegations timeout after 15 minutes.

Real-Time Monitoring

View active and completed sub-agents using OpenCode's navigation shortcuts:

| Shortcut | Action | |----------|--------| | Ctrl+X Up | Jump to parent session | | Ctrl+X Left | Previous sub-agent | | Ctrl+X Right | Next sub-agent |

FAQ

How does the AI know what each delegation contains?

Each delegation is a...

Comments (0)
to leave a comment.

No comments yet. Be the first to share your thoughts!

Related Skills

n8n

by n8n-io

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
178,903
55,726
TypeScript
MCP Serversaiapis
View details
gemini-cli

by google-gemini

An open-source AI agent that brings the power of Gemini directly into your terminal.
97,469
12,195
TypeScript
AI Agentsaiai-agents
View details
everything-claude-code

by affaan-m

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
73,757
9,228
JavaScript
AI Agentsai-agentsanthropic
View details
awesome-claude-skills

by ComposioHQ

A curated list of awesome Claude Skills, resources, and tools for customizing Claude AI workflows
43,513
4,373
Python
AI Agentsagent-skillsai-agents
View details
chatgpt-on-wechat

by zhayujie

CowAgent是基于大模型的超级AI助理,能主动思考和任务规划、访问操作系统和外部资源、创造和执行Skills、拥有长期记忆并不断成长。同时支持飞书、钉钉、企业微信应用、微信公众号、网页等接入,可选择OpenAI/Claude/Gemini/DeepSeek/ Qwen/GLM/Kimi/LinkAI,能处理文本、语音、图片和文件,可快速搭建个人AI助手和企业数字员工。
42,164
9,820
Python
AI Agentsaiai-agent
View details
cherry-studio

by CherryHQ

AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs
41,349
3,818
TypeScript
AI Agentsai-agentclaude-code
View details