원클릭으로
lazy-enable-pi-tool
Lazy-enable a pi extension tool from branch history or confirmed command conditions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Lazy-enable a pi extension tool from branch history or confirmed command conditions.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Adapt Bash scripts for just-bash compatibility. Use when a script must run inside just-bash, behaves differently from native Bash, or needs a just-bash shell-semantics regression test.
Transcribe local audio/video and Apple Voice Memos quickly with cached MLX Whisper models, including bad/low-quality audio.
Prepare a cold-start handoff package for a training deck, then optionally hand off to ppt-master.
Cache and refresh remote git repositories under ~/.cache/checkouts/<host>/<org>/<repo> so future references can reuse a local copy. Use this skill when the user points you to a remote git repository as reference or you encountered a remote git repo through other means.
Remote control tmux sessions for interactive CLIs (python, gdb, etc.) by sending keystrokes and scraping pane output.
Convert a chezmoi-managed plain config file into a chezmoi symlink.
| name | lazy-enable-pi-tool |
| description | Lazy-enable a pi extension tool from branch history or confirmed command conditions. |
| disable-model-invocation | true |
Convert a pi extension tool from always-active to lazy-enabled: the tool is
registered, but it only enters pi.getActiveTools() when a branch signal or a
confirmed command condition proves the session needs it.
One-way means the extension may disable the tool only before it has enabled it in the current run. Once enabled, the extension must not remove it again: a restored branch can show the agent that it previously used this tool, and hiding that tool afterward makes the visible history contradict the current tool list.
Negotiate the enabling policy. Before editing code, discuss with the user which signals should enable the tool. Treat these as design choices, not defaults:
ctx.sessionManager.getBranch() custom entries, as in
extensions/goal.ts.block.type === "toolCall" && block.name === "<tool>", as in
extensions/todos.ts./todos or /goal, and the exact condition within
each command that should enable the tool for the current run. The condition
may be command entry, a branch in the command, an explicit user choice
inside the command, a state transition, or no command condition at all.Recommend the smallest policy that proves the session needs the tool, then ask one question at a time until every enabling path and rejected signal is settled. If branch history contains this tool's tool call, apply one-way.
Completion criterion: the user has confirmed the restore signals, any command conditions that enable the tool, and every rejected signal; every restore path with this tool in branch history applies one-way; a short policy summary has been written before code edits begin.
Add a one-way active-tool helper. Inside the extension factory, keep a boolean owned by the extension and mutate active tools through one helper:
let exampleToolEnabled = false;
function setExampleToolEnabled(enabled: boolean): void {
if (!enabled && exampleToolEnabled) return;
const activeTools = new Set(pi.getActiveTools());
const activeToolCountBefore = activeTools.size;
if (enabled) {
exampleToolEnabled = true;
activeTools.add("example");
} else {
activeTools.delete("example");
}
if (activeTools.size !== activeToolCountBefore) {
pi.setActiveTools(Array.from(activeTools));
}
}
The guard implements one-way.
Completion criterion: all setActiveTools writes for this tool go through
this helper, and enabling preserves every other active tool.
Restore from branch navigation. On session_start and session_tree,
evaluate the branch signal and pass it to the helper:
function restoreExampleTool(ctx: ExtensionContext): void {
setExampleToolEnabled(branchHasExampleSignal(ctx));
}
pi.on("session_start", async (_event, ctx) => restoreExampleTool(ctx));
pi.on("session_tree", async (_event, ctx) => restoreExampleTool(ctx));
Completion criterion: restoring a branch with the signal enables the tool and applies one-way; restoring a branch without the signal disables it only if this extension has not already enabled it during the current run.
Implement the confirmed command conditions. For each command or UI path, enable the tool only under the condition the user confirmed. Some commands enable immediately, some enable only under a later branch, and some never enable tools themselves:
pi.registerCommand("example", {
handler: async (args, ctx) => {
// existing command behavior
if (shouldEnableExampleTool) setExampleToolEnabled(true);
},
});
Do not add command-triggered enabling for paths or states the user did not approve.
Completion criterion: every confirmed command condition enables the tool for subsequent agent turns in the same run, and no unconfirmed command path or state does.
Document the policy. Add a short top-level comment explaining what enables the tool and why restored branches that already used the tool keep it enabled.
Completion criterion: the docs state the enabling signals, and the tool's execution behavior is unchanged; only when it appears in active tools changes.
../../../private_dot_pi/private_agent/extensions/goal.ts — custom session
state signal plus one-way lazy enable.../../../private_dot_pi/private_agent/extensions/todos.ts — historical
tool-call signal plus command-triggered enable.