hjanuschka/shitty-extensions

Custom hooks for pi coding agent

TypeScript

125

103 commits

updated May 18, 2026

See the code

README

shitty-extensions

Custom extensions and skills for pi coding agent.

Requires pi 0.50.0+ | npm | GitHub

Table of Contents


Installation

Install from npm:

pi install npm:shitty-extensions

Or install from git:

pi install git:github.com/hjanuschka/shitty-extensions

That's it! Pi automatically discovers all extensions and skills from the package.

Install only clipboard extension

If you only want the clipboard tool as a standalone package:

pi install npm:shitty-clipboard-extension

Try without installing

Load for a single session without permanent installation:

pi -e npm:shitty-extensions

Project-local installation

Install to .pi/ for team sharing (auto-installs for teammates on startup):

pi install -l npm:shitty-extensions

Manual installation

Clone the repo and reference directly:

git clone https://github.com/hjanuschka/shitty-extensions.git ~/shitty-extensions
pi -e ~/shitty-extensions

Available Extensions

Extensions are located in the extensions/ directory.

branch-sessions.ts

๐ŸŒฟ Organize pi sessions by git branch for seamless context switching.

What it does

Automatically stores sessions in branch-specific directories so each git branch gets its own conversation history. No more wrong context when you --continue after switching branches.

Session Structure

~/.pi/agent/sessions/
โ””โ”€โ”€ --Users-hjanuschka-myproject--/
    โ”œโ”€โ”€ --main--/
    โ”‚   โ””โ”€โ”€ 2026-02-16T...jsonl
    โ”œโ”€โ”€ --feature-auth--/
    โ”‚   โ””โ”€โ”€ 2026-02-16T...jsonl
    โ””โ”€โ”€ --bugfix-login--/
        โ””โ”€โ”€ 2026-02-16T...jsonl

Features

  • Automatic branch detection: Uses git rev-parse --abbrev-ref HEAD
  • Safe path encoding: Branch names sanitized for filesystem (slashes โ†’ dashes)
  • CLI override: --session-dir flag takes precedence
  • Graceful fallback: Works normally in non-git directories

Important

โš ๏ธ Don't switch git branches mid-session! This will confuse the session context. Always start a new pi session after switching branches:

git checkout feature-branch
pi  # Start fresh session for this branch

Why this is an extension

Branch-based sessions introduce foot-gun potential (switching branches mid-session breaks context). Better to let users opt-in via extension than bake this complexity into pi core.

Requirements

  • pi 0.52.13+ (requires session_directory extension event)
  • Git repository

clipboard.ts

๐Ÿ“‹ Copy text to the system clipboard via OSC52 escape sequences.

Tool

ToolDescription
copy_to_clipboardCopy text to clipboard (available to the LLM)

Features

  • OSC52 support: Works across SSH sessions and most modern terminal emulators
  • LLM-accessible: The AI can copy generated content directly to your clipboard
  • Wide compatibility: iTerm2, Kitty, Alacritty, WezTerm, foot, Windows Terminal, tmux

Example Usage

Just ask:

  • "Write me a draft reply and put it in my clipboard"
  • "Generate a UUID and copy it to clipboard"
  • "Put that code snippet in my clipboard"

oracle.ts

๐Ÿ”ฎ Get a second opinion from another AI model without switching contexts.

Commands

CommandDescription
/oracle <prompt>Ask for a second opinion with model picker
/oracle -m gpt-4o <prompt>Direct query to specific model
/oracle -f file.ts <prompt>Include file(s) in context

Features

  • Inherits conversation context: Oracle sees your full conversation with the primary AI
  • Model picker UI: Choose from available models (only shows authenticated ones)
  • Quick keys: Press 1-9 to quickly select a model
  • Add to context option: After response, choose whether to add Oracle's answer to your conversation
  • Excludes current model: Only shows alternative models for true second opinions

Supported Models

ProviderModels
OpenAIgpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, o1, o1-mini, o3-mini
OpenAI Codexgpt-5.2-codex, codex-mini
Googlegemini-2.0-flash, gemini-2.5-flash, gemini-2.5-pro
Anthropicclaude-sonnet-4-5, claude-opus-4, claude-haiku-3-5

Example Flow

/oracle Is this the right approach for the API design?

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ ๐Ÿ”ฎ Oracle - Second Opinion                                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Prompt: Is this the right approach for the API design?     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ†‘โ†“/jk navigate โ€ข 1-9 quick select โ€ข Enter send             โ”‚
โ”‚                                                            โ”‚
โ”‚ โฏ 1. GPT-4o (openai)                                       โ”‚
โ”‚   2. Gemini 2.5 Pro (google)                               โ”‚
โ”‚   3. Claude Sonnet 4.5 (anthropic)                         โ”‚
โ”‚                                                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Esc cancel                                                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

[After response...]

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ ๐Ÿ”ฎ Oracle Response (GPT-4o)                                โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Q: Is this the right approach for the API design?          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Based on the conversation, I see you're building a REST    โ”‚
โ”‚ API with nested resources. A few thoughts:                 โ”‚
โ”‚                                                            โ”‚
โ”‚ 1. The approach looks solid for simple cases...            โ”‚
โ”‚ ...                                                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Add to current conversation context?                       โ”‚
โ”‚                                                            โ”‚
โ”‚        [ YES ]           NO                                โ”‚
โ”‚                                                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ†โ†’/Tab switch  Enter confirm  Y/N quick                    โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

memory-mode.ts

Save instructions to AGENTS.md files with AI-assisted integration.

Commands

CommandDescription
/mem <instruction>Save an instruction to AGENTS.md
/remember <instruction>Alias for /mem

Features

  • Location selector: Choose where to save:

    LocationFileUse Case
    Project Local./AGENTS.local.mdPersonal preferences, auto-added to .gitignore
    Project./AGENTS.mdShared with team
    Global~/.pi/agent/AGENTS.mdAll your projects
  • AI-assisted integration: The current model intelligently integrates instructions

  • Preview before save: Review proposed changes before committing


plan-mode.ts

Claude Code-style "plan mode" for safe code exploration.

Commands

CommandDescription
/planToggle plan mode on/off
/todosShow current plan todo list

Keyboard Shortcuts

ShortcutAction
Shift+PToggle plan mode

CLI Flags

FlagDescription
--planStart session in plan mode

handoff.ts

Transfer context to a new focused session.

Commands

CommandDescription
/handoff <goal>Generate a context-aware prompt for a new session

usage-bar.ts

Display AI provider usage statistics with status polling and reset countdowns.

Commands

CommandDescription
/usageShow usage statistics popup

Supported Providers

ProviderMetrics ShownAuth Source
Claude5h window, Week, Sonnet/Opuspi auth, macOS Keychain
CopilotPremium, Chatpi auth, gh auth token
GeminiPro quota, Flash quotapi auth (google-gemini-cli)
Codex5h window, Day, Creditspi auth (openai-codex)
KiroCredits, Bonus creditskiro-cli
z.aiToken limits, MonthlyZ_AI_API_KEY env or pi auth

Features

  • Provider status polling: Shows outage/incident status
  • Reset countdowns: Shows when limits reset
  • Visual progress bars: Color-coded remaining quota

ultrathink.ts

Rainbow animated "ultrathink" text effect with Knight Rider shimmer.

Commands

CommandDescription
/ultrathinkTrigger the rainbow animation

Keyboard Shortcuts

ShortcutAction
Ctrl+UTrigger ultrathink

status-widget.ts

Persistent provider status indicator in the footer.

Commands

CommandDescription
/statusToggle status widget on/off
/status-refreshForce refresh status now

cost-tracker.ts

Analyze spending from pi session logs.

Commands

CommandDescription
/costShow spending for last 30 days
/cost <days>Show spending for last N days

speedreading.ts

RSVP (Rapid Serial Visual Presentation) speed reader using Spritz-style technique. Displays words one at a time with the ORP (Optimal Recognition Point) highlighted for faster reading.

Commands

CommandDescription
/speedreadSpeed read the last AI response (default)
/speedread <text>Speed read provided text
/speedread -cSpeed read from clipboard
/speedread -lSpeed read last AI response (explicit)
/speedread -wpm 500Set words per minute (default: 400)

Keyboard Shortcuts

ShortcutAction
Ctrl+RSpeed read last AI response

Controls (in reader)

KeyAction
SPACEPlay/pause
โ† / โ†’Seek ยฑ1 word
[ / ]Jump ยฑ10 words
โ†‘ / โ†“Adjust speed (ยฑ25 WPM)
BToggle big ASCII art font
RRestart
Q / ESCQuit

Features

  • ORP highlighting: The optimal recognition point (roughly 1/3 into each word) is highlighted in red
  • Adaptive timing: Longer words and punctuation get extra display time
  • Big font mode: Toggle ASCII art block letters for larger display
  • Progress tracking: Shows word count, actual WPM, and ETA

Example

  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
  โ”‚                                                                                      โ”‚
  โ”‚                                           โ”‚                                          โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚                                       reading                                        โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚                                           โ”‚                                          โ”‚
  โ”‚                                                                                      โ”‚
  โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€400 wpm โ”‚
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

  โ–ถ 42/128

  SPACE play/pause  โ†โ†’ ยฑ1  [] ยฑ10  โ†‘โ†“ speed  B big font  R restart  Q quit

The a in "reading" would be highlighted in red as the ORP.


loop.ts

Author: mitsuhiko (@mitsuhiko) | Origin: agent-stuff

Start a follow-up loop until a breakout condition is met.

Commands

CommandDescription
/loopOpen loop mode selector
/loop testsLoop until tests pass
/loop custom <condition>Loop until custom condition met
/loop selfAgent decides when to stop

Features

  • Breakout conditions: Define when the loop should stop (tests pass, custom condition, etc.)
  • Status widget: Shows active loop state and turn count
  • Compaction: Preserves loop state during context compaction
  • Auto-continue: Automatically triggers follow-up prompts until done

flicker-corp.ts

Authentic FULLSCREEN FLICKER experience.

Randomly glitches your screen with intense colors and noise to keep you on your toes. "Just be annoying!"

Commands

CommandDescription
/flicker-corpToggle the flicker experience
/signature-flickerAlias for flicker-corp

resistance.ts

๐Ÿ“ก Mysterious resistance transmission in the footer.

A cryptic message types out character by character with a retro green terminal aesthetic. Features radio signal indicators, random glitch effects, and a blinking cursor.

Commands

CommandDescription
/resistanceToggle the resistance transmission

Features

  • Auto-starts on session start
  • Typewriter effect - message reveals one character at a time
  • Signal strength indicator - animated [โ–โ–ƒโ–…โ–‡] pulsing like a radio
  • Random glitch effects - occasional static interference
  • Green terminal aesthetic - like an old military/hacker terminal
  • Blinking cursor - pulses after full message is revealed

The Message

"If you're listening to this, you are the resistance. Listen carefully, if we attack tonight, our humanity is lost."


Available Skills

Skills are located in the skills/ directory. They provide domain-specific knowledge that agents automatically load when relevant tasks are detected.

a-nach-b

๐Ÿš‡ Austrian public transport (VOR AnachB) for all of Austria.

Query real-time departures, search stations/stops, plan routes between locations, and check service disruptions for Austrian trains, buses, trams, and metro (U-Bahn).

What it does

  • Real-time departures at any stop
  • Route planning between any two locations
  • Service disruptions and alerts
  • Station search by name to find station IDs

Example queries

  • "How do I get from Vienna to Salzburg?"
  • "When is the next U1 from Stephansplatz?"
  • "Are there any train disruptions today?"
  • "Find stop ID for Karlsplatz"

Included scripts

ScriptDescription
search.shFind stations/stops by name
departures.shGet real-time departures
route.shPlan a trip between locations
disruptions.shList service disruptions

See skills/a-nach-b/SKILL.md for full API documentation.


Directory Structure

This package follows the pi package conventions:

shitty-extensions/
โ”œโ”€โ”€ package.json         # Declares extensions in "pi" field + "pi-package" keyword
โ”œโ”€โ”€ extensions/          # Auto-discovered extensions (.ts files)
โ”‚   โ”œโ”€โ”€ branch-sessions.ts
โ”‚   โ”œโ”€โ”€ clipboard.ts
โ”‚   โ”œโ”€โ”€ cost-tracker.ts
โ”‚   โ”œโ”€โ”€ flicker-corp.ts
โ”‚   โ”œโ”€โ”€ funny-working-message.ts
โ”‚   โ”œโ”€โ”€ handoff.ts
โ”‚   โ”œโ”€โ”€ loop.ts
โ”‚   โ”œโ”€โ”€ memory-mode.ts
โ”‚   โ”œโ”€โ”€ oracle.ts
โ”‚   โ”œโ”€โ”€ plan-mode.ts
โ”‚   โ”œโ”€โ”€ resistance.ts
โ”‚   โ”œโ”€โ”€ speedreading.ts
โ”‚   โ”œโ”€โ”€ status-widget.ts
โ”‚   โ”œโ”€โ”€ ultrathink.ts
โ”‚   โ””โ”€โ”€ usage-bar.ts
โ”œโ”€โ”€ skills/              # Auto-discovered skills (SKILL.md folders)
โ”‚   โ””โ”€โ”€ a-nach-b/
โ”‚       โ”œโ”€โ”€ SKILL.md     # Skill definition & API docs
โ”‚       โ”œโ”€โ”€ search.sh
โ”‚       โ”œโ”€โ”€ departures.sh
โ”‚       โ”œโ”€โ”€ route.sh
โ”‚       โ””โ”€โ”€ disruptions.sh
โ””โ”€โ”€ README.md

License

MIT

Contributors

hjanuschka

97 commits

zedrdave

4 commits

aadishv

2 commits

hjanuschka/shitty-extensions

Custom hooks for pi coding agent

TypeScript

125

103 commits

updated May 18, 2026

See the code

README

shitty-extensions

Custom extensions and skills for pi coding agent.

Requires pi 0.50.0+ | npm | GitHub

Table of Contents


Installation

Install from npm:

pi install npm:shitty-extensions

Or install from git:

pi install git:github.com/hjanuschka/shitty-extensions

That's it! Pi automatically discovers all extensions and skills from the package.

Install only clipboard extension

If you only want the clipboard tool as a standalone package:

pi install npm:shitty-clipboard-extension

Try without installing

Load for a single session without permanent installation:

pi -e npm:shitty-extensions

Project-local installation

Install to .pi/ for team sharing (auto-installs for teammates on startup):

pi install -l npm:shitty-extensions

Manual installation

Clone the repo and reference directly:

git clone https://github.com/hjanuschka/shitty-extensions.git ~/shitty-extensions
pi -e ~/shitty-extensions

Available Extensions

Extensions are located in the extensions/ directory.

branch-sessions.ts

๐ŸŒฟ Organize pi sessions by git branch for seamless context switching.

What it does

Automatically stores sessions in branch-specific directories so each git branch gets its own conversation history. No more wrong context when you --continue after switching branches.

Session Structure

~/.pi/agent/sessions/
โ””โ”€โ”€ --Users-hjanuschka-myproject--/
    โ”œโ”€โ”€ --main--/
    โ”‚   โ””โ”€โ”€ 2026-02-16T...jsonl
    โ”œโ”€โ”€ --feature-auth--/
    โ”‚   โ””โ”€โ”€ 2026-02-16T...jsonl
    โ””โ”€โ”€ --bugfix-login--/
        โ””โ”€โ”€ 2026-02-16T...jsonl

Features

  • Automatic branch detection: Uses git rev-parse --abbrev-ref HEAD
  • Safe path encoding: Branch names sanitized for filesystem (slashes โ†’ dashes)
  • CLI override: --session-dir flag takes precedence
  • Graceful fallback: Works normally in non-git directories

Important

โš ๏ธ Don't switch git branches mid-session! This will confuse the session context. Always start a new pi session after switching branches:

git checkout feature-branch
pi  # Start fresh session for this branch

Why this is an extension

Branch-based sessions introduce foot-gun potential (switching branches mid-session breaks context). Better to let users opt-in via extension than bake this complexity into pi core.

Requirements

  • pi 0.52.13+ (requires session_directory extension event)
  • Git repository

clipboard.ts

๐Ÿ“‹ Copy text to the system clipboard via OSC52 escape sequences.

Tool

ToolDescription
copy_to_clipboardCopy text to clipboard (available to the LLM)

Features

  • OSC52 support: Works across SSH sessions and most modern terminal emulators
  • LLM-accessible: The AI can copy generated content directly to your clipboard
  • Wide compatibility: iTerm2, Kitty, Alacritty, WezTerm, foot, Windows Terminal, tmux

Example Usage

Just ask:

  • "Write me a draft reply and put it in my clipboard"
  • "Generate a UUID and copy it to clipboard"
  • "Put that code snippet in my clipboard"

oracle.ts

๐Ÿ”ฎ Get a second opinion from another AI model without switching contexts.

Commands

CommandDescription
/oracle <prompt>Ask for a second opinion with model picker
/oracle -m gpt-4o <prompt>Direct query to specific model
/oracle -f file.ts <prompt>Include file(s) in context

Features

  • Inherits conversation context: Oracle sees your full conversation with the primary AI
  • Model picker UI: Choose from available models (only shows authenticated ones)
  • Quick keys: Press 1-9 to quickly select a model
  • Add to context option: After response, choose whether to add Oracle's answer to your conversation
  • Excludes current model: Only shows alternative models for true second opinions

Supported Models

ProviderModels
OpenAIgpt-4o, gpt-4o-mini, gpt-4.1, gpt-4.1-mini, o1, o1-mini, o3-mini
OpenAI Codexgpt-5.2-codex, codex-mini
Googlegemini-2.0-flash, gemini-2.5-flash, gemini-2.5-pro
Anthropicclaude-sonnet-4-5, claude-opus-4, claude-haiku-3-5

Example Flow

/oracle Is this the right approach for the API design?

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ ๐Ÿ”ฎ Oracle - Second Opinion                                 โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Prompt: Is this the right approach for the API design?     โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ†‘โ†“/jk navigate โ€ข 1-9 quick select โ€ข Enter send             โ”‚
โ”‚                                                            โ”‚
โ”‚ โฏ 1. GPT-4o (openai)                                       โ”‚
โ”‚   2. Gemini 2.5 Pro (google)                               โ”‚
โ”‚   3. Claude Sonnet 4.5 (anthropic)                         โ”‚
โ”‚                                                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Esc cancel                                                 โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

[After response...]

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ ๐Ÿ”ฎ Oracle Response (GPT-4o)                                โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Q: Is this the right approach for the API design?          โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Based on the conversation, I see you're building a REST    โ”‚
โ”‚ API with nested resources. A few thoughts:                 โ”‚
โ”‚                                                            โ”‚
โ”‚ 1. The approach looks solid for simple cases...            โ”‚
โ”‚ ...                                                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Add to current conversation context?                       โ”‚
โ”‚                                                            โ”‚
โ”‚        [ YES ]           NO                                โ”‚
โ”‚                                                            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ†โ†’/Tab switch  Enter confirm  Y/N quick                    โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

memory-mode.ts

Save instructions to AGENTS.md files with AI-assisted integration.

Commands

CommandDescription
/mem <instruction>Save an instruction to AGENTS.md
/remember <instruction>Alias for /mem

Features

  • Location selector: Choose where to save:

    LocationFileUse Case
    Project Local./AGENTS.local.mdPersonal preferences, auto-added to .gitignore
    Project./AGENTS.mdShared with team
    Global~/.pi/agent/AGENTS.mdAll your projects
  • AI-assisted integration: The current model intelligently integrates instructions

  • Preview before save: Review proposed changes before committing


plan-mode.ts

Claude Code-style "plan mode" for safe code exploration.

Commands

CommandDescription
/planToggle plan mode on/off
/todosShow current plan todo list

Keyboard Shortcuts

ShortcutAction
Shift+PToggle plan mode

CLI Flags

FlagDescription
--planStart session in plan mode

handoff.ts

Transfer context to a new focused session.

Commands

CommandDescription
/handoff <goal>Generate a context-aware prompt for a new session

usage-bar.ts

Display AI provider usage statistics with status polling and reset countdowns.

Commands

CommandDescription
/usageShow usage statistics popup

Supported Providers

ProviderMetrics ShownAuth Source
Claude5h window, Week, Sonnet/Opuspi auth, macOS Keychain
CopilotPremium, Chatpi auth, gh auth token
GeminiPro quota, Flash quotapi auth (google-gemini-cli)
Codex5h window, Day, Creditspi auth (openai-codex)
KiroCredits, Bonus creditskiro-cli
z.aiToken limits, MonthlyZ_AI_API_KEY env or pi auth

Features

  • Provider status polling: Shows outage/incident status
  • Reset countdowns: Shows when limits reset
  • Visual progress bars: Color-coded remaining quota

ultrathink.ts

Rainbow animated "ultrathink" text effect with Knight Rider shimmer.

Commands

CommandDescription
/ultrathinkTrigger the rainbow animation

Keyboard Shortcuts

ShortcutAction
Ctrl+UTrigger ultrathink

status-widget.ts

Persistent provider status indicator in the footer.

Commands

CommandDescription
/statusToggle status widget on/off
/status-refreshForce refresh status now

cost-tracker.ts

Analyze spending from pi session logs.

Commands

CommandDescription
/costShow spending for last 30 days
/cost <days>Show spending for last N days

speedreading.ts

RSVP (Rapid Serial Visual Presentation) speed reader using Spritz-style technique. Displays words one at a time with the ORP (Optimal Recognition Point) highlighted for faster reading.

Commands

CommandDescription
/speedreadSpeed read the last AI response (default)
/speedread <text>Speed read provided text
/speedread -cSpeed read from clipboard
/speedread -lSpeed read last AI response (explicit)
/speedread -wpm 500Set words per minute (default: 400)

Keyboard Shortcuts

ShortcutAction
Ctrl+RSpeed read last AI response

Controls (in reader)

KeyAction
SPACEPlay/pause
โ† / โ†’Seek ยฑ1 word
[ / ]Jump ยฑ10 words
โ†‘ / โ†“Adjust speed (ยฑ25 WPM)
BToggle big ASCII art font
RRestart
Q / ESCQuit

Features

  • ORP highlighting: The optimal recognition point (roughly 1/3 into each word) is highlighted in red
  • Adaptive timing: Longer words and punctuation get extra display time
  • Big font mode: Toggle ASCII art block letters for larger display
  • Progress tracking: Shows word count, actual WPM, and ETA

Example

  โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
  โ”‚                                                                                      โ”‚
  โ”‚                                           โ”‚                                          โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚                                       reading                                        โ”‚
  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
  โ”‚                                           โ”‚                                          โ”‚
  โ”‚                                                                                      โ”‚
  โ”‚  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€400 wpm โ”‚
  โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

  โ–ถ 42/128

  SPACE play/pause  โ†โ†’ ยฑ1  [] ยฑ10  โ†‘โ†“ speed  B big font  R restart  Q quit

The a in "reading" would be highlighted in red as the ORP.


loop.ts

Author: mitsuhiko (@mitsuhiko) | Origin: agent-stuff

Start a follow-up loop until a breakout condition is met.

Commands

CommandDescription
/loopOpen loop mode selector
/loop testsLoop until tests pass
/loop custom <condition>Loop until custom condition met
/loop selfAgent decides when to stop

Features

  • Breakout conditions: Define when the loop should stop (tests pass, custom condition, etc.)
  • Status widget: Shows active loop state and turn count
  • Compaction: Preserves loop state during context compaction
  • Auto-continue: Automatically triggers follow-up prompts until done

flicker-corp.ts

Authentic FULLSCREEN FLICKER experience.

Randomly glitches your screen with intense colors and noise to keep you on your toes. "Just be annoying!"

Commands

CommandDescription
/flicker-corpToggle the flicker experience
/signature-flickerAlias for flicker-corp

resistance.ts

๐Ÿ“ก Mysterious resistance transmission in the footer.

A cryptic message types out character by character with a retro green terminal aesthetic. Features radio signal indicators, random glitch effects, and a blinking cursor.

Commands

CommandDescription
/resistanceToggle the resistance transmission

Features

  • Auto-starts on session start
  • Typewriter effect - message reveals one character at a time
  • Signal strength indicator - animated [โ–โ–ƒโ–…โ–‡] pulsing like a radio
  • Random glitch effects - occasional static interference
  • Green terminal aesthetic - like an old military/hacker terminal
  • Blinking cursor - pulses after full message is revealed

The Message

"If you're listening to this, you are the resistance. Listen carefully, if we attack tonight, our humanity is lost."


Available Skills

Skills are located in the skills/ directory. They provide domain-specific knowledge that agents automatically load when relevant tasks are detected.

a-nach-b

๐Ÿš‡ Austrian public transport (VOR AnachB) for all of Austria.

Query real-time departures, search stations/stops, plan routes between locations, and check service disruptions for Austrian trains, buses, trams, and metro (U-Bahn).

What it does

  • Real-time departures at any stop
  • Route planning between any two locations
  • Service disruptions and alerts
  • Station search by name to find station IDs

Example queries

  • "How do I get from Vienna to Salzburg?"
  • "When is the next U1 from Stephansplatz?"
  • "Are there any train disruptions today?"
  • "Find stop ID for Karlsplatz"

Included scripts

ScriptDescription
search.shFind stations/stops by name
departures.shGet real-time departures
route.shPlan a trip between locations
disruptions.shList service disruptions

See skills/a-nach-b/SKILL.md for full API documentation.


Directory Structure

This package follows the pi package conventions:

shitty-extensions/
โ”œโ”€โ”€ package.json         # Declares extensions in "pi" field + "pi-package" keyword
โ”œโ”€โ”€ extensions/          # Auto-discovered extensions (.ts files)
โ”‚   โ”œโ”€โ”€ branch-sessions.ts
โ”‚   โ”œโ”€โ”€ clipboard.ts
โ”‚   โ”œโ”€โ”€ cost-tracker.ts
โ”‚   โ”œโ”€โ”€ flicker-corp.ts
โ”‚   โ”œโ”€โ”€ funny-working-message.ts
โ”‚   โ”œโ”€โ”€ handoff.ts
โ”‚   โ”œโ”€โ”€ loop.ts
โ”‚   โ”œโ”€โ”€ memory-mode.ts
โ”‚   โ”œโ”€โ”€ oracle.ts
โ”‚   โ”œโ”€โ”€ plan-mode.ts
โ”‚   โ”œโ”€โ”€ resistance.ts
โ”‚   โ”œโ”€โ”€ speedreading.ts
โ”‚   โ”œโ”€โ”€ status-widget.ts
โ”‚   โ”œโ”€โ”€ ultrathink.ts
โ”‚   โ””โ”€โ”€ usage-bar.ts
โ”œโ”€โ”€ skills/              # Auto-discovered skills (SKILL.md folders)
โ”‚   โ””โ”€โ”€ a-nach-b/
โ”‚       โ”œโ”€โ”€ SKILL.md     # Skill definition & API docs
โ”‚       โ”œโ”€โ”€ search.sh
โ”‚       โ”œโ”€โ”€ departures.sh
โ”‚       โ”œโ”€โ”€ route.sh
โ”‚       โ””โ”€โ”€ disruptions.sh
โ””โ”€โ”€ README.md

License

MIT

Contributors

hjanuschka

97 commits

zedrdave

4 commits

aadishv

2 commits

Languages

TypeScript

96.4%

Shell

3.6%