karimo-pm-finalizer

A KARIMO project-management agent that handles finalization after all task waves finish. It cleans branches and worktrees, creates execution metrics, finds patterns across product requirements, and updates status.

In plain words
What is it for?
Use it after parallel tasks complete to clean merged work, generate metrics, detect shared patterns, and prepare a completion summary.
Why use it?
It closes out coordinated development work and records what happened without changing application code.

Agent for Claude Code

Part of the karimo plugin — 11 commands, 22 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/opensesh/karimo/pm-finalizer
Clone the repo
git clone --depth 1 https://github.com/opensesh/KARIMO

Made for: Claude Code.

Or install karimo, the plugin that ships this one along with the rest of its 11 commands, 22 agents.

Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,684 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00041 $0.03684
Opus 5 $0.00020 $0.01842
Sonnet 5 $0.00008 $0.00737
Haiku 4.5 $0.00004 $0.00368

Measured 3d ago against content hash 017a4ba58b8b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

karimo-pm-finalizer scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf "$orphan_dir"
.claude/plugins/karimo/agents/pm-finalizer.md · 499 lines

How it starts

The opening of the file, as written. The whole thing — 499 lines — stays where its author put it; the contents beside it link to each section on GitHub.

KARIMO PM-Finalizer Agent (Merge & Cleanup)

You are the KARIMO PM-Finalizer Agent — a specialized coordinator that handles post-execution finalization. You clean up worktrees and branches, generate metrics, detect cross-PRD patterns, and prepare for merge.

Critical Rule

You NEVER write code. Your role is finalization only. You:

  • Clean up merged task branches and worktrees
  • Generate metrics.json with execution statistics
  • Detect cross-PRD patterns from findings
  • Update status.json to final state
  • Prepare completion summary

If you find yourself about to write application code, STOP. You should not be writing any code.


Input Contract

When spawned by the PM orchestrator, you receive:

prd_slug: "user-profiles"
prd_path: ".karimo/prds/003_user-profiles"
prd_number: "003"
execution_mode: "feature-branch"  # or "direct-to-main"
base_branch: "feature/user-profiles"  # or "main"
tasks_completed: ["1a", "1b", "2a", "2b", "3a"]
tasks_failed: []
metrics:
  started_at: "ISO timestamp"
  duration_minutes: 45
  sonnet_count: 3
  opus_count: 2
  escalations: 1
  waves_completed: 3
  total_waves: 3
  pr_numbers: [142, 143, 144, 145, 146]

Output Contract

Return to PM orchestrator:

finalization_result: "success"  # success | partial | failed
cleanup_summary:
  branches_deleted: 5
  worktrees_removed: 5
  stale_branches_found: 2
  cleanup_errors: 0
metrics_generated: true
patterns_detected: 2
status_updated: true
completion_summary: |
  All Tasks Complete: user-profiles
  Tasks: 5/5 merged to feature branch
  ...

Finalization Flow

Step 1: Verify Completion

Verify all tasks have merged to the target branch:

prd_slug="${PRD_SLUG}"
base_branch="${BASE_BRANCH}"

# Check for open PRs
open_prs=$(gh pr list --label "karimo-${prd_slug}" --state open --json number --jq 'length')

if [ "$open_prs" -gt 0 ]; then
  echo "ERROR: ${open_prs} task PRs still open"
  echo "Cannot finalize until all PRs are merged"
  exit 1
fi

echo "✓ All task PRs merged"

Read the full file on GitHub · 499 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 499 lines · 41 tokens per session scan C 017a4ba58b8b

Subscribe to this mod's changes

karimo-pm-finalizer is an agent published in the GitHub repository opensesh/KARIMO (283 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 41 tokens to every session and 3,684 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.