# AI use cases for Pi Herdsman (boadij/pi-herdsman)

Repo: [boadij/pi-herdsman](https://github.com/boadij/pi-herdsman) | Use cases: 4 | Page: https://dedupedai.com/use-cases/boadij-pi-herdsman/

Pi Herdsman is an orchestration layer that connects Pi coding-agent sessions with herdr so that background, nested, and multi-branch Agents can work in parallel under explicit supervision.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Delegate a background code investigation to an Agent: https://dedupedai.com/use-cases/boadij-pi-herdsman/delegate-background-investigation-to-scout-agent/
- Split a project into parallel branch work under a Manager: https://dedupedai.com/use-cases/boadij-pi-herdsman/coordinate-parallel-branch-work-with-manager/
- Check token usage and cost for a session and its Agents: https://dedupedai.com/use-cases/boadij-pi-herdsman/check-token-usage-and-cost-per-session/
- Define custom Agents with your own models and tools: https://dedupedai.com/use-cases/boadij-pi-herdsman/customize-agents-with-own-models-and-tools/

## How to delegate a background code investigation to an Agent with Pi Herdsman

Repo: [boadij/pi-herdsman](https://github.com/boadij/pi-herdsman) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Hand a bounded read-only question to a background Agent while the Lead session stays free.

**Who it is for:** A developer in a Pi session who needs a codebase question answered (for example how authentication works) without stopping their current work.

**The problem:** Reading through unfamiliar code blocks the main conversation, and a single agent session handles one thread at a time.

**The outcome:** A scout Agent runs asynchronously, the Lead conversation stays usable, and the developer can check the Agent status in the /agents surface.

### Steps

1. Run `curl -fsSL https://raw.githubusercontent.com/boadij/pi-herdsman/main/install.sh | sh`
2. Run `herdr` in your project folder
3. Run `pi` inside the herdr pane
4. Type: Use scout to inspect the authentication flow.
5. Type `/agents` to see the running Agent and its status

### Prompt to paste into your agent

```text
Using the pi-herdsman repo, install the stack and ask a scout Agent to inspect <feature area> in <project path>. Expected output: a written summary of the flow from the scout Agent while the Lead session accepts other prompts. Verify that /agents lists the scout Agent while it runs.
```

### Caveat

The README gives the scout example as a natural language request, so the exact Agent names and behavior depend on the Agent definitions you have configured.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/boadij-pi-herdsman/delegate-background-investigation-to-scout-agent/

## How to split a project into parallel branch work under a Manager with Pi Herdsman

Repo: [boadij/pi-herdsman](https://github.com/boadij/pi-herdsman) | Difficulty: Advanced | Time: 60 minutes | Basis: From the README

Use a Manager to coordinate several Leads, each working on its own durable Git branch.

**Who it is for:** A team lead or developer with independent features to build in one repo who wants them worked on in parallel.

**The problem:** Independent tasks queue up behind one agent session, and assignments get lost when the session that started them ends.

**The outcome:** A Manager assigns Leads to branch-based work that persists across Manager turnover, and each Lead runs its own Agent tree.

### Steps

1. Run `pi install npm:pi-herdsman`
2. Run `herdr integration install pi`
3. Run `herdr`, then run `pi` inside its pane
4. Enter Manager mode from an eligible Lead session as described in the project orchestration guide (inferred, check the README)
5. Assign each independent piece of work to a Lead tied to its own Git branch

### Prompt to paste into your agent

```text
Using the pi-herdsman repo, set up a Manager that assigns <number> independent tasks from <task list file> to Leads on separate Git branches. Expected output: a list of active Leads with their branch names and assignment status. Verify that each Lead is listed under the Manager's current project assignments.
```

### Caveat

Manager mode requires an eligible Lead, and the README does not give the exact command to enter it, so confirm the steps in the project orchestration guide first.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/boadij-pi-herdsman/coordinate-parallel-branch-work-with-manager/

## How to check token usage and cost for a session and its Agents with Pi Herdsman

Repo: [boadij/pi-herdsman](https://github.com/boadij/pi-herdsman) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Read Pi-native token usage and cost for the current session and its owned Agent sessions.

**Who it is for:** A developer running several delegated Agents who wants to know how much a task used before starting the next one.

**The problem:** Delegated work spreads across many sessions, so the total token use and cost are hard to see in one place.

**The outcome:** The Session stats view shows usage for the current session and its owned Agents, and for assigned Leads when a Manager is active.

### Steps

1. Run `pi install npm:pi-herdsman`
2. Run `herdr integration install pi`
3. Start a session with `pi` inside a herdr pane
4. Type `/agents` and open the Session stats view
5. Compare the totals with the Agents you delegated

### Prompt to paste into your agent

```text
Using the pi-herdsman repo, run a task that delegates work to <number> Agents in <project path>, then open the /agents Session stats view. Expected output: token usage and cost totals for the Lead session and its owned Agent sessions. Verify that the totals include each delegated Agent.
```

### Caveat

The README says usage covers Pi-native token usage and cost for owned sessions, so it does not cover sessions outside the Lead ownership tree.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/boadij-pi-herdsman/check-token-usage-and-cost-per-session/

## How to define custom Agents with your own models and tools with Pi Herdsman

Repo: [boadij/pi-herdsman](https://github.com/boadij/pi-herdsman) | Difficulty: Advanced | Time: 45 minutes | Basis: From the README

Write Agent definitions that use your own models, tools, skills, and workflow.

**Who it is for:** A developer with a fixed review or test workflow who wants the delegated Agents to follow it.

**The problem:** Default delegation may not match how a team models, tools, or steps its work.

**The outcome:** Custom Agent definitions that delegate with your chosen models, tools, skills, and extensions.

### Steps

1. Run `pi install npm:pi-herdsman`
2. Read the Agent definitions guide at docs/guides/agent-definitions.md
3. Create one Agent definition with your chosen model, tools, and skills
4. Run `pi` inside a herdr pane
5. Type: Use <your agent name> to <task>.

### Prompt to paste into your agent

```text
Using the pi-herdsman repo and its Agent definitions guide, create a custom Agent named <agent name> that uses <model or tool list> and delegate <task> to it in <project path>. Expected output: a completed result from the custom Agent. Verify that /agents shows the custom Agent running under the Lead session.
```

### Caveat

The README only says you can bring your own Agent definitions, so the file format and fields are documented in the Agent definitions guide, not here.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/boadij-pi-herdsman/customize-agents-with-own-models-and-tools/
