@ryan_nookpi/pi-extension-cc-system-prompt 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +6 -3
  2. package/index.ts +8 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # @ryan_nookpi/pi-extension-cc-system-prompt
2
2
 
3
- This extension swaps pi's default system prompt with a Claude Code-style prompt when you use a Claude model.
3
+ Use your **Claude Code subscription** (Max, Team, Enterprise) with pi.
4
4
 
5
- It also preserves pi's original system prompt by injecting it once as a persistent `<system-reminder>` message.
5
+ Claude Code's API uses a dedicated system prompt to identify itself. This extension swaps pi's system prompt with that Claude Code-style prompt when you select a Claude model, so the API recognizes requests as coming from Claude Code and routes them through your subscription plan.
6
+
7
+ Pi's original system prompt is preserved by injecting it once as a persistent `<system-reminder>` message.
6
8
 
7
9
  ## Install
8
10
 
@@ -24,5 +26,6 @@ pi install npm:@ryan_nookpi/pi-extension-cc-system-prompt
24
26
 
25
27
  ## Notes
26
28
 
27
- - This is experimental and prompt fidelity is approximate.
29
+ - No additional API charges requests are billed against your existing Claude Code subscription.
30
+ - This relies on undocumented Anthropic internal behavior and may break at any time without notice.
28
31
  - Vendored prompt fragments come from `Piebald-AI/claude-code-system-prompts`.
package/index.ts CHANGED
@@ -2,6 +2,7 @@ import { existsSync, readFileSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
5
+ import { Text } from "@mariozechner/pi-tui";
5
6
 
6
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
7
8
  const VENDOR_DIR = join(__dirname, "vendor", "system-prompts");
@@ -123,6 +124,13 @@ export function wrapSystemPromptAsReminder(systemPrompt: string): string {
123
124
  }
124
125
 
125
126
  export default function ccSystemPrompt(pi: ExtensionAPI) {
127
+ pi.registerMessageRenderer(REMINDER_CUSTOM_TYPE, (_message, { expanded }, theme) => {
128
+ if (!expanded) {
129
+ return new Text(theme.fg("dim", "▸ Claude Code system prompt injected"), 0, 0);
130
+ }
131
+ return undefined;
132
+ });
133
+
126
134
  pi.on("before_agent_start", async (event, ctx) => {
127
135
  const modelId = ctx.model?.id;
128
136
  if (!shouldApply(modelId)) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryan_nookpi/pi-extension-cc-system-prompt",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Claude Code system prompt extension for pi.",
5
5
  "license": "MIT",
6
6
  "repository": {