Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
"version": "2.1.0",
"category": "productivity",
"tags": ["notifications", "terminal", "warp"]
},
{
"name": "oz-harness-support",
"description": "Warp integration for Claude Code in Oz cloud agent environments, including parent-message delivery hooks",
"source": "./plugins/oz-harness-support",
"version": "1.1.2",
"category": "productivity",
"tags": ["terminal", "warp", "oz"]
}
]
}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ Notifications work out of the box. To customize Warp's notification behavior (so
The plugin version in `plugins/warp/.claude-plugin/plugin.json` is checked by the Warp client to detect outdated installations.
When bumping the version here, also update `MINIMUM_PLUGIN_VERSION` in the Warp client.

## Oz Cloud Agent Support

Running Claude Code inside Warp's Oz cloud agents? See the [`oz-harness-support` plugin](plugins/oz-harness-support/README.md), installed automatically in those environments.

## License

MIT License — see [LICENSE](LICENSE) for details.
10 changes: 10 additions & 0 deletions plugins/oz-harness-support/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "oz-harness-support",
"description": "Warp terminal integration for Claude Code in Oz cloud agent environments, including parent-message delivery hooks",
"version": "1.1.2",
"author": {
"name": "Warp",
"url": "https://warp.dev"
},
"homepage": "https://github.com/warpdotdev/claude-code-warp"
}
28 changes: 28 additions & 0 deletions plugins/oz-harness-support/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# oz-harness-support

Warp integration for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) running inside Warp's **Oz cloud agent** environments.

This plugin is installed automatically in Oz cloud agent environments — there is no manual setup for end users.

## Hooks

The plugin registers an Oz parent-message delivery bridge:
- **SessionStart** — starts the parent-message listener for the run
- **UserPromptSubmit** / **PostToolUse** — drain the mailbox, surfacing queued parent messages into the session as additional context
- **Stop** — keeps the session active when parent messages are still pending delivery
- **SessionEnd** — tears down the listener and cleans up hook state

## Skills

The plugin ships skills the agent uses to talk to the Oz platform:
- **oz-child-agent-orchestration** — coordinate with a lead run via the Oz CLI (`OZ_CLI`, `OZ_RUN_ID`, `OZ_PARENT_RUN_ID`)
- **oz-finish-task** — report task completion or failure
- **oz-notify-user** — send a progress notification to the triggering user
- **oz-report-pr** — report a created pull request back to Oz
- **oz-upload-file** — upload a local file as a conversation artifact

## Requirements

- Warp's Oz cloud agent environment (provides the `oz` CLI and `OZ_*` environment variables)
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI
- `jq` for JSON parsing
56 changes: 56 additions & 0 deletions plugins/oz-harness-support/hooks/hooks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"description": "Oz parent-message delivery bridge for Claude Code child runs",
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/on-session-start.sh"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/drain-mailbox.sh UserPromptSubmit"
}
]
}
],
"PostToolUse": [
{
"matcher": "*",
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/drain-mailbox.sh PostToolUse"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/on-stop.sh"
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/on-session-end.sh"
}
]
}
]
}
}
21 changes: 21 additions & 0 deletions plugins/oz-harness-support/scripts/drain-mailbox.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

set -euo pipefail

HOOK_EVENT="${1:?hook event name is required}"

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/oz-parent-common.sh"
load_hook_state || exit 0
STATE_DIR="$(hook_state_dir)"

if listener_lifecycle_managed_externally; then
emit_driver_hook_additional_context "$HOOK_EVENT" "$STATE_DIR" || exit 0
acknowledge_driver_hook_output "$STATE_DIR"
exit 0
fi

MAX_CONTEXT_CHARS="${OZ_PARENT_MAX_CONTEXT_CHARS:-6000}"
build_parent_context_from_staged_messages "$STATE_DIR" "$MAX_CONTEXT_CHARS" || exit 0
deliver_and_remove_staged_messages "$STATE_DIR" "${OZ_PARENT_SURFACED_IDS[@]}"
emit_hook_additional_context "$HOOK_EVENT" "$OZ_PARENT_RENDERED_CONTEXT"
10 changes: 10 additions & 0 deletions plugins/oz-harness-support/scripts/on-session-end.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/oz-parent-common.sh"
resolve_hook_state || exit 0
listener_lifecycle_managed_externally && exit 0

cleanup_hook_state
11 changes: 11 additions & 0 deletions plugins/oz-harness-support/scripts/on-session-start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/oz-parent-common.sh"
resolve_hook_state || exit 0
listener_lifecycle_managed_externally && exit 0
ensure_state_dir "$OZ_PARENT_STATE_DIR"

start_listener_if_needed "$SCRIPT_DIR/oz-parent-listener.sh"
8 changes: 8 additions & 0 deletions plugins/oz-harness-support/scripts/on-stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/oz-parent-common.sh"
load_hook_state || exit 0
emit_stop_block_if_pending || exit 0
Loading
Loading