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.
npx agentmods add agents/cubeplexai/cubepi/forkinggit clone --depth 1 https://github.com/cubeplexai/cubepiWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/cubeplexai/cubepi/forking)<a href="https://agentmods.dev/agents/cubeplexai/cubepi/forking"><img src="https://agentmods.dev/badge/agents/cubeplexai/cubepi/forking.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00031 | $0.02395 |
| Opus 5 | $0.00015 | $0.01197 |
| Sonnet 5 | $0.00006 | $0.00479 |
| Haiku 4.5 | $0.00003 | $0.00239 |
Grade A, and why
forking scanned grade A with 0 findings 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 6d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 251 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Conversation Forking
A fork branches a conversation at a completed-run boundary. CubePi gives you two variants:
Agent.fork(...)— a persistent fork. Copies messages from the source thread up to and including a chosenrun_idinto a brand-new thread you can continue to converse with.Agent.fork_once(...)— an ephemeral one-shot probe. Loads a snapshot in memory, runs one prompt, and returns the result without writing anything back to the source thread.
Both APIs key off run_id — a stable identifier for one
prompt() → final assistant message cycle. Every message produced
during a prompt carries the same run_id, so "the boundary after
run R" is an unambiguous, reproducible cut.
The cubebox copy-button UX
The driving use case is the cubebox "branch this reply" button: under every assistant message in the UI there is a small affordance that forks the conversation into a fresh thread starting from the message above it. Users use it to explore "what if the assistant had answered this differently?" without polluting the original thread.
In that flow:
- the host generates the new thread's id (cubebox uses uuid7),
- calls
Agent.fork(src, new, after_run_id=...)to materialise the branch, and - opens a fresh agent against the new thread.
The features below — explicit run_id, active_run_id, fork APIs,
and the HITL binding rules — are exactly what that UX needs.
Agent.prompt(run_id=...) — accept-or-generate
Agent.prompt() now returns the run_id it used for the call:
run_id = await agent.prompt("hello")
print(run_id) # → "8c0b…" — server-generated
Hosts that want to control the id (cubebox, multi-machine relays, anything that needs the id before the call completes) can supply it:
import uuid_extensions # or whatever uuid7 source you prefer
my_run_id = uuid_extensions.uuid7str()
run_id = await agent.prompt("hello", run_id=my_run_id)
assert run_id == my_run_id
While the run is in flight, the id is available on
Agent.state.active_run_id:
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.
- 6d ago First seen · 251 lines · 31 tokens per session scan A e7f152ca69ed
forking is an agent published in the GitHub repository cubeplexai/cubepi (46 stars, last pushed 4d ago), licensed MIT. It adds 31 tokens to every session and 2,395 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
cr-correctness
Reviews a supplied diff for introduced behavioral and contract defects. Use only when dispatched by the code-review skill.
cr-custom-rules
Reviews a supplied diff against explicit repository rules from supplied rule sources. Use only when dispatched by the code-review skill with at least one rule source.
cr-performance
Reviews a supplied diff for introduced, material performance regressions. Use only when dispatched by the code-review skill.
cr-security
Reviews a supplied diff for introduced, practically exploitable security vulnerabilities. Use only when dispatched by the code-review skill.
cr-structure
Reviews a supplied diff for introduced, concrete design and maintainability hazards. Use only when dispatched by the code-review skill.
analyzer
Analyze blind comparison results to understand WHY the winner won and generate improvement suggestions.