Skip to Content
Latch Docs

Harness plugins

Install and manage Latch in your harness, and run checks from chat.

Plugins wire Latch into the agent’s lifecycle and expose tools in chat. Use the quickstart to install one, then open a new session in your project.

In chatAsk for
Confirm checks are configured and see recent hook activitylatch_status
Run turn-end checks immediatelyrun_turn_end
Search an existing log for a missing detailsearch_output

Project and offline setup · Find or remove a plugin · Preview integrations

Install from GitHub

Use the quickstart for the exact install steps for each harness. Start a new session in your project. The plugin downloads and verifies the Latch binary from GitHub on first use and reuses it from the user cache.

For a restricted network, see offline setup or hosted workspaces.

Pi

Use Pi 1.5.2 or later.

pi install git:github.com/BarakChamo/latch

To share the install with your project, add --local from the project directory and commit .pi/settings.json. Pi loads project packages after you trust the workspace. Pi package docs

OpenCode

Use OpenCode 2.3.2 or later for the global install.

opencode plugin add 'github:BarakChamo/latch'

For a project, add the Git package to the existing plugins array in opencode.json.

opencode.json
{
  "plugins": ["github:BarakChamo/latch"]
}

For new installs, use OpenCode v2. If you stay on v1, the installer in the Latch archive prepares the matching OpenCode dependencies before registering the plugin. This first-time setup needs npm and network access. OpenCode v1 startup issue

Restart OpenCode after installation. For a headless v2 run, use opencode --standalone --print-logs run "Make a change that fails my check" to see the turn-end report on stderr. Resume the same session to let the model see that report. OpenCode plugin discovery

Offline setup

The standalone archive includes the CLI and plugin sources. Extract it and keep the folder in place. For Pi, pass its plugins/pi directory to pi install.

Find or remove a plugin

HarnessFind the pluginUninstall Latch
Codexcodex plugin listcodex plugin remove latch@latch-tools
Claude Codeclaude plugin listclaude plugin uninstall latch@latch-tools
GitHub Copilot CLIcopilot plugin listcopilot plugin uninstall latch@latch-tools
OpenCode v2Look for github:BarakChamo/latch in the plugins array of the opencode.json shown by the installer.opencode plugin remove 'github:BarakChamo/latch' for the global package. Remove a project entry or checkout from its project.
OpenCode v1Check the OpenCode config directory's plugins/latch.js link.Remove that link.
Pipi listpi remove git:github.com/BarakChamo/latch. Add --local for a project install.
Grok Buildgrok plugin listgrok plugin uninstall latch
Kimi Code/plugins list/plugins remove latch, then /reload.
OpenHands Agent CanvasCustomize → PluginsUninstall Latch from its plugin details.
OpenHands CLICheck the project's .openhands/hooks.json.See OpenHands CLI cleanup.

Use one installation method per project to avoid duplicate hooks. If you added an older Latch marketplace or a branch-specific Pi or OpenCode package, remove that entry before switching to the quickstart commands.

Grok, Kimi, and OpenHands

Grok Build

grok plugin install BarakChamo/latch --trust

Start a new session. Use grok plugin list to confirm installation and grok mcp doctor latch to check the tool server.

Automatic hooks and MCP passed on Grok Build 1.0.92. In 1.0.34, only MCP loaded. See default report delivery and automatic continuation for how Grok receives failures. Grok Build plugin docs

Kimi Code

In Kimi Code, run:

/plugins install https://github.com/BarakChamo/latch/tree/main

Choose Trust and install, then run /reload or open a new session. Changed turns run checks. Failures reach the next prompt by default. Kimi Code 2.7.2 supports continue_once in the interactive CLI and in ACP sessions. Use report with kimi -p. Kimi Code plugin docs

OpenHands

Agent Canvas

Open Customize → Plugins → Add plugin, enter github:BarakChamo/latch as the source, and click Install. Enabled plugins load automatically in new conversations. Open a local Git workspace and configure your checks there.

Verified in the Canvas web app (1.43.0) against a local workspace. With continue_once, Canvas delivered the turn-end failure to the agent once and Latch ran the check once.

OpenHands SDK

Load the native GitHub plugin when you create an SDK conversation:

from pathlib import Path

from openhands.sdk import Conversation
from openhands.sdk.plugin import PluginSource

conversation = Conversation(
    agent=agent,
    workspace=Path.cwd(),
    plugins=[PluginSource(source="github:BarakChamo/latch")],
)

Here agent is your configured OpenHands agent. The plugin includes hooks and MCP. The SDK path was tested with 1.63.1. OpenHands plugin docs

OpenHands CLI

With Latch on your path, run latch install openhands in the Git project you want to check. It installs project hooks and registers the tools for the current user. Start a new session in the same project. Native edits and changed turns run checks. Failures reach the next prompt by default. OpenHands hook docs

To uninstall, remove the hook entries whose command ends in # latch-installed from .openhands/hooks.json or the user hook file if the installer updated that file. Remove the latch MCP entry from your OpenHands user configuration once no project uses it.

Preview integrations

From your project, use the installed latch command to register workspace hooks.

HarnessSetupFeedback
Cursor CLI (preview)Run latch install cursor --preview.The post-tool hook returns edit diagnostics. Turn-end diagnostics go to hook stderr.
Devin CLI (preview)Run latch install devin --preview.The post-tool hook returns edit diagnostics. Failed turn reports go to the next prompt.
Kiro CLI V3 (preview)Run latch install kiro --preview.The post-tool hook returns edit diagnostics. Failed turn reports go to the next prompt.

The preview adapters have automated hook protocol tests. Treat their feedback as provisional until verified in a session. Workspace installers write absolute local paths into harness configuration. Keep those entries local. To uninstall them, remove the hook entries whose command ends in # latch-installed and remove the latch MCP server entry.

Confirm a first run

Ask your agent to call latch_status in the project after you send a prompt. It shows the resolved commands, when Latch last received a prompt hook, and the most recent automatic check outcome for each event. On a fresh project, last_check: null means Latch has yet to record a check for that event. The tool is read-only. The standalone equivalent is latch status.

HarnessWhat happened on the first prompt after a clean plugin install
Grok Build 1.0.92The agent found the tool through Grok’s MCP search, then called it with the absolute project directory.
Kimi Code 2.7.2The interactive CLI connected to the plugin, but requests to the OpenAI-compatible test provider omitted the tool, even after experimental tool selection reported it as loaded. Use latch status in the project if the agent cannot access it.
OpenHands Agent Canvas 1.43.0The tool was available in the first message of a new OpenHands conversation after enabling the plugin and opening a local Git workspace. The agent passed the absolute project directory.

These tests used Latch 0.1.5, local Git workspaces and a scripted model provider. Grok and Canvas returned the configured commands and empty check history without running a check. Grok’s MCP tool discovery · Kimi MCP tool visibility issue

Run checks from chat

Ask your agent to call the Latch tool.

Use Latch’s run_turn_end tool in this project and tell me which checks failed.

run_turn_end runs the configured turn_end commands immediately in the project's working directory, even when the worktree is unchanged. It uses the same command order and output settings as latch run turn_end. Failed checks return a tool error with diagnostics. A successful call is quiet unless on_success is set to "output". Your harness may ask for approval because configured commands can modify files.

In Codex, Copilot and the additional integrations above, the agent passes the absolute project directory to the tool. Other harnesses use the session working directory. Pi exposes it as mcp__latch__run_turn_end.

For a manual after_edit run or a preview of the resolved configuration, use the CLI commands in your terminal.

Look up details from a failure

When a report includes a Saved log path, the agent can pass it and a literal query such as a test name to search_output. Copilot also passes the absolute project directory. With filesystem access to the cache, the agent can search the same file directly using its normal file tools. Both paths use the existing log without rerunning the check. Use the CLI to replay both original streams.

Integration commands

The plugin runs these commands for you. Each hook command reads the harness's event JSON from standard input. latch mcp speaks MCP over standard input and output.

CommandUsed by
latch hook codexCodex lifecycle hooks
latch hook claude-codeClaude Code lifecycle hooks
latch hook copilot <event>Copilot CLI lifecycle hooks, such as postToolUse and agentStop
latch hook opencodeThe OpenCode plugin forwards prompt, edit, and idle events
latch hook piThe Pi extension forwards prompt, edit, and settlement events
latch mcpClaude Code, OpenCode, and Pi expose the Latch tools
latch install <openhands|cursor|devin|grok|kiro> [--preview]Writes local hook and MCP configuration for the selected harness
latch hook <openhands|kimi|cursor|devin|grok|kiro>Receives native lifecycle events for the selected harness
latch mcp --require-project-directoryCodex, Copilot, and the additional integrations expose the tools with an explicit project directory

See Hooks and feedback for what triggers automatically and where results appear.

On this page