Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
{
"schemaVersion": 1,
"featureId": "feat_custom_approval_gate",
"title": "Project-command approval gate and command execution",
"summary": "Worktrunk runs arbitrary project-defined hook commands, alias steps, and --execute bodies. These must only run after the approval gate (`Approvals` + `approve_command_batch` / `approve_or_skip`) clears them. Bypassing the gate = remote code execution on `wt switch`. Also handles signal-derived child exits (Ctrl-C must abort, not get swallowed by `FailureStrategy::Warn`). See AGENTS.md > Project Commands Run Only After Approval and Signal Handling.",
"kind": "library",
"source": "manual",
"confidence": "high",
"entrypoints": [
{
"path": "src/commands/command_executor.rs",
"symbol": "handle_command_error",
"route": null,
"command": null
}
],
"ownedFiles": [
{
"path": "src/commands/command_approval.rs",
"reason": "approval gate logic"
},
{
"path": "src/commands/command_executor.rs",
"reason": "hook/alias/pipeline execution and signal forwarding"
},
{
"path": "src/commands/for_each.rs",
"reason": "per-worktree loop signal handling"
},
{
"path": "src/commands/hooks.rs",
"reason": "hook dispatch"
},
{
"path": "src/commands/hook_commands.rs",
"reason": "hook command resolution"
},
{
"path": "src/commands/hook_filter.rs",
"reason": "hook filtering"
}
],
"contextFiles": [
{
"path": "src/config/approvals.rs",
"reason": "approvals storage"
},
{
"path": "src/git/error.rs",
"reason": "ChildProcessExited signal channel"
},
{
"path": "src/shell_exec.rs",
"reason": "child process spawning"
},
{
"path": "AGENTS.md",
"reason": "approval gate and signal handling invariants"
}
],
"tests": [
{
"path": "tests/integration_tests/user_hooks.rs",
"command": "cargo test --test integration user_hooks"
},
{
"path": "tests/integration_tests/custom.rs",
"command": "cargo test --test integration custom"
}
],
"tags": [
"rust",
"security",
"approval-gate",
"rce",
"signal-handling"
],
"trustBoundaries": [
"user-input",
"process-exec",
"filesystem"
],
"status": "needs-fix",
"lock": null,
"findingIds": [
"fnd_sig-feat-custom-approval-gate-20_4591965160",
"fnd_sig-feat-custom-approval-gate-45_1b36e46567",
"fnd_sig-feat-custom-approval-gate-74_863f528652"
],
"patchAttemptIds": [],
"analysisHistory": [
{
"runId": "20260516T210804-353f93",
"kind": "review",
"summary": "2 finding(s)",
"provider": "codex",
"model": null,
"createdAt": "2026-05-16T21:14:12.355Z"
},
{
"runId": "20260517T050139-b247d5",
"kind": "review",
"summary": "1 finding(s)",
"provider": "codex",
"model": null,
"createdAt": "2026-05-17T05:09:05.683Z"
}
],
"createdAt": "2026-05-16T21:00:00.000Z",
"updatedAt": "2026-05-17T05:09:05.683Z"
}