From a9b04e5cc0d920af2e3c468d0677ea09d10d984e Mon Sep 17 00:00:00 2001 From: openhands Date: Tue, 13 Jan 2026 18:33:21 +0000 Subject: [PATCH] docs: document .openhands/agent_finish.sh hook Co-authored-by: openhands --- openhands/usage/customization/repository.mdx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/openhands/usage/customization/repository.mdx b/openhands/usage/customization/repository.mdx index 26b863b2..16e39933 100644 --- a/openhands/usage/customization/repository.mdx +++ b/openhands/usage/customization/repository.mdx @@ -45,3 +45,23 @@ fi exit 0 ``` + + +## Agent Finish Script + +You can add a `.openhands/agent_finish.sh` file, which will run every time the agent finishes a task (i.e., when the agent emits an `AgentFinishAction` / transitions to the `FINISHED` state). + +- Runs inside the sandbox/runtime environment +- Runs from the repository root (best-effort via `git rev-parse --show-toplevel`) +- Times out after 10 minutes + +For example: + +```bash +#!/bin/bash + +# Example: write a simple summary marker for downstream automation + +echo "OpenHands finished at $(date -Iseconds)" >> .openhands/finish.log +``` +