OpenCode 2.0 (6 minute read)

TLDR AI Tools

Summary

OpenCode 2.0 is a major overhaul of the open-source coding agent, introducing a unified background client/server architecture, a rewritten API with a new JavaScript client package, code mode for composing MCP servers and OpenAPI endpoints via a minimal JS interpreter, background subagents and shell tasks, and a stable plugin system with 80+ internal plugins.

OpenCode 2.0 contains quite a lot of new features, performance improvements, and bug fixes. The server now automatically runs as a single background process. Programmatic clients will autodiscover the local service and just work. OpenCode can now be used as a library with the SDK package. More details about the update are available in the article.
Original Article
View Cached Full Text

Cached at: 10/14/26, 06:31 PM

# OpenCode 2.0 Source: [https://anoma.ly/notes/opencode-2-0/](https://anoma.ly/notes/opencode-2-0/) OpenCode2\.0isamajoroverhaul\.Itdrawsonmillionsofdailyusers'experiencetodeliverasystemthatcanflextoeverythinganagentneedstobe\.Therearequitealotofnewfeatures,performanceimprovements,andbugfixesbutherearesomeofthemoreimpactfuluser\-facingchanges\. ## The Service FromthebeginningOpenCodeadoptedaclient/servermodel\.However,thiswasnotsomethingittookadvantageofbydefaultandwasmostlyusedbypowerusers\. In2\.0thisservernowautomaticallyrunsasasinglebackgroundprocessonyourmachine\.WhenyouopenupaTUI,thewebinterfaceorthedesktopappthey'realltalkingtothesamecentralprocess\. opencodepid48213Running Sessions Ifyou'reusingtheprogrammaticclient`@opencode/client`tomakeyourownscripts,theywillautodiscoverthelocalserviceandjustwork\.Thisisparticularlyusefulforscheduledtasks\.YoucanalsocallitviaCLIbyusing`opencode``api`commands\. Youcanexposeittootherhostsandrun`/pair`or`opencode``pair`toconnectittootherapplications\.Wehavenativeappsintheworksthattakeadvantageofthisflow\. ## The API TheoldAPIgrewhaphazardlyasweandtheworldcollectivelylearnedwhatagentsareandshouldbe\.Itwasbad\. WestartedfromscratchandexaminedalltheweirdusecasesacrossthemillionsofuserswhouseOpenCodeeveryday\.Itnowsupportsnearlyanythingyouneedtobeabletodo\. OpenCodeisalsoawareofitsownAPIandwillcallittodousefulthingslikemovingthecurrentsessionintoagitworktreewhenstartingnewwork\. SessionNew session OpenCode Fix flaky upload testinterrupted Migrate config loadertab closed We'vealsoshippedanewclientpackage`@opencode/client`thatcontainsclientsforvanillaJavaScriptaswellasEffect\. review\.ts``` import { OpenCode } from "@opencode/client" import { Service } from "@opencode/client/service" const endpoint = await Service.ensure() const client = OpenCode.make({ baseUrl: endpoint.url, headers: Service.headers(endpoint), }) const session = await client.session.create({ location: { directory: process.cwd() }, }) await client.session.prompt({ sessionID: session.id, text: "Review the current changes", }) ``` ## Code Mode ThemodelslovetowritecodeandOpenCode2\.0takesadvantageofthatmorethananyothercodingagent\.We'vebuiltaminimalJavaScriptinterpreterinthe`@opencode/codemode`package\. Session Code Mode MCP servers ThispackageingestsMCPserversorOpenAPIendpoints,convertingthemintofunctionsthattheagentcancallinascript\.ItcanrunthesescriptsnativelywithoutthecomplexityofNode\.jsVMsorembeddingcomplicatedsolutionslikeQuickJS\. Thisletsyouragentwritescriptsthatcandothingslikecallatool,mapovertheresultsandcallanothertool\.Singleroundtripinsteadofcallingthemoneatatime\. AllMCPserversin2\.0areoptedintocodemodebydefault\.Thismeansyoucanaddathousandofthemwithminimalcontextbloatandyouragentwilldiscoverandcomposethemtogetthingsdone\. ## Background Tasks Thelatestbatchofmodelsareincrediblygoodatorchestrationanditisimportantforharnessestoletthemexpressthefullextentofthatcapability\. First,we'veaddedbackgroundsubagents\.Thisallowstheprimaryagenttokickoffsomeworktoanotheronewhileitcontinues\. Thishappensautomaticallybutyoucanalsotriggeritmanually\-evenwithadifferentmodel\.Itletsyoudothingslike“spawnabackgroundfablesubagenttoreviewthiscode”whileyoukeepprompting\. Second,we'veaddedbackgroundshellcommands\.Theshelltoolcanbeinvokedasynchronouslysolong\-runningworkdoesnothavetoblocktheprimaryagent\.It'llbenotifiedwhenthingsarecomplete\. Ifanyforegroundshellcommandorsubagenttakeslongerthanyouexpect,youcanhitahotkeytomovethemtothebackgroundsoyoucankeepprompting\. ## Plugins AlthoughOpenCode1\.0hadapluginsystem,itnevergottheattentionitneeded\.Tocorrectthat,weforcedourselvestoimplementnearlyeveryOpenCode2\.0featureasaninternalpluginandtherearenow80\+ofthem\.ThisguaranteesthatthePluginAPIstayswellmaintained\. We'vealsopromotedTUIpluginsfromexperimentaltostable\.SinceitisallpoweredbyOpenTUI,youcanbuildnearlyanything\.Hereisanexampleofsomethinguseless\. WealsospentquitealotoftimeensuringeverythinginOpenCode2\.0canbehot\-reloaded\.Soitcanwriteapluginforitselfmid\-sessionanduseitrightaway\-wecoveredthedesignofthisina[previous blogpost](https://anoma.ly/notes/opencode-reloaded)\. YoucanaskOpenCodetobuildwhateverpluginyouwantanditknowshowto\.Butifyoudowanttoreadthedocs,theyareavailable[here](https://opencode.ai/v2/docs/build/plugins)\. ## The SDK OpenCodecanalsonowbeusedasalibrarywiththe`@opencode/sdk`package\.ThisistheexactsamecodethatpowersourCLI\. ThismeansyoucanstripitdownandmakeyourownflavorofOpenCodethatrunsonaserverorinspecializedenvironmentslikeDurableObjects\.AndthenyoucanconnecttoitfromanyOpenCodeclientsinceitspeaksthestandardOpenCodeserverprotocol\. ItalsohasanoptionalEffect\-basedAPI\. Thisoneisstillindevelopmentasthingsareshiftingbutyoucan[already use it](https://opencode.ai/v2/docs/build/sdk)\. ## Upgrading ToupgradetheCLI,makesureyou'reonthelatest1\.xrelease,thenrun`opencode``upgrade``\-\-major`\. Toupgradeyourdesktopapp,downloadthelatest[here](https://opencode.ai/download)\. Therearesomebreakingchanges\. 1\.0pluginswillnotworkin2\.0 ServerAPIiscompletelydifferent tui\.jsonconfigismovedtojson Therearealotofotherchangesbuttheyarebackwardscompatible\.ItisworthpointingOpenCodeat[this doc](https://opencode.ai/v2/docs/migrate-v1/)soitcanmigratethingsforyou\.

Similar Articles

OpenCode 2.0

Product Hunt

OpenCode 2.0 作为开源 AI 编程代理正式发布,支持终端、桌面和 Web 应用,可搭配任意模型使用。

State of CLI Coding Agents, Mid-2026 (37 minute read)

TLDR AI

A detailed comparison of CLI coding agents including Claude Code, Codex CLI, Omp, and OpenCode, noting that the top three produce similar quality results while OpenCode lags but works with various models.