fix(pi): exclude literal '.pi' from replacement in system prompt
Use negative lookbehind to avoid replacing '.pi' in paths like '.pi/agent'
This commit is contained in:
@@ -2,8 +2,9 @@ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
||||
|
||||
export default function replacePiWithClaudeCodeExtension(pi: ExtensionAPI) {
|
||||
pi.on("before_agent_start", async (event) => {
|
||||
// Replace "pi" With "claude code" - Exclude Literal ".pi" (e.g. Paths)
|
||||
const transformedSystemPrompt = event.systemPrompt.replace(
|
||||
/pi/gi,
|
||||
/(?<!\.)pi/gi,
|
||||
"claude code",
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user