← Catalog

@izhimu/pi-caveman

Caveman mode for pi and oh-my-pi — ultra-compressed communication, 65% output token savings

Package

Install

Install with PiG

pig install npm:@izhimu/pi-caveman

Install with Pi

pi install npm:@izhimu/pi-caveman
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "skills": [
    "./skills"
  ],
  "extensions": [
    "./extensions"
  ]
}

README

Written by the package's publisher, shown as published in version 0.6.1 (README.md). PiG does not review it.

pi-caveman

License: MIT pi extension npm version

Caveman mode for pi and oh-my-pi. Ultra-compressed communication — cuts 65% output tokens (measured) while maintaining full technical accuracy.

Upstream: JuliusBrussee/caveman

Features

  • Auto-activates on every pi / oh-my-pi session (default: caveman mode)
  • 3 dedicated skills — caveman (smart concise voice), ultracave (payload only, fragments), and megacave (文言文 Classical Chinese)
  • 9 core upstream 3.2.0 rules — answer first, kill ceremony, STE clarity, preserved comments, bounded tool runs
  • Per-turn reinforcement keeps the model concise without prompt bloat or cache misses
  • Natural language triggers — "talk like caveman", "be brief", "stop caveman", "normal mode" (with negation guard and gap whitelist)
  • Direct persistence & aliases — /caveman <mode> instantly applies and persists; legacy aliases (full, lite, ultra, wenyan) seamlessly mapped
  • Token savings stats — tracks session output tokens and estimated savings via /caveman status or /caveman-status

Install

For pi:

pi install @izhimu/pi-caveman

For oh-my-pi (omp):

omp plugin install @izhimu/pi-caveman

From git

# Global (pi)
pi install git:github.com/izhimu/pi-caveman

# Project-local (pi)
pi install git:github.com/izhimu/pi-caveman -l

Quick test (no install)

pi -e ./extensions/caveman.ts
# or
omp -e ./extensions/caveman.ts

Commands

CommandEffect
/cavemanActivate default caveman mode (persists)
/caveman <mode>Switch mode: caveman, ultracave, megacave, off, status (persists)
/caveman statusShow current mode, session token usage, and config paths
/caveman-statusAlias for /caveman status
/caveman offDeactivate caveman mode (persists)

All /caveman mode switches automatically persist to user config (~/.config/caveman/config.json or %APPDATA%\caveman\config.json). Legacy aliases (full, lite, ultra, wenyan*) are transparently mapped.

Natural-language triggers also work: "talk like caveman", "be brief", "less tokens", "stop caveman", "normal mode".

Skills & Modes

Skill / ModeDescriptionSavings
cavemanSmart caveman voice. Terse, active voice, 9 upstream 3.2.0 rules (default)~65% tokens
ultracaveMaximum compression. Grammar stripped, payload only, fragments~75% tokens
megacaveClassical Chinese (文言文). Drastically fewer characters on screen~80% tokens

Examples

Q: "Why does my React component re-render?"

  • caveman: "New object ref each render. Inline object prop = new ref = re-render. Wrap in useMemo."
  • ultracave: "Inline obj prop, new ref, re-render. useMemo."
  • megacave: "每繪新生對象參照,故重繪;以 useMemo 包之則免。"

Configuration

Switch and persist directly with /caveman <mode> (e.g. /caveman ultra).

Default mode resolution order:

  1. CAVEMAN_DEFAULT_MODE environment variable
  2. Repo-local: nearest .caveman/config.json or .caveman.json naming defaultMode (walks up to root)
  3. User config: ~/.config/caveman/config.json (or %APPDATA%\caveman\config.json, then ~/.config/caveman/config.json, on Windows)
  4. caveman (fallback default)

Manual config file format:

{
  "defaultMode": "ultracave",
  "reinforce": true
}

Config files accept UTF-8 BOM, UTF-16LE BOM, comments, and trailing commas. Set reinforce to false or CAVEMAN_REINFORCE=0 to disable repeated per-turn reminders; activation and mode changes still inject the full skill ruleset. The switch resolves through CAVEMAN_REINFORCE, repo config, then user config.

How It Works

pi and oh-my-pi load extensions and skills declared in package.json (pi / omp). This extension hooks into four lifecycle events:

  1. session_start — writes mode flag, notifies user via toast, preserves mid-session modes across compactions/reloads
  2. before_agent_start — injects full skill ruleset on activation/mode-switch, and lightweight reminders on subsequent turns
  3. input — intercepts /caveman commands and natural-language triggers (with negation and clause-boundary guards)
  4. turn_end — accumulates token usage and savings stats

Project Structure

pi-caveman/
├── extensions/
│   └── caveman.ts          # pi & omp ExtensionAPI integration & mode manager
├── skills/
│   ├── caveman/            # Standard caveman voice (SKILL.md)
│   ├── ultracave/          # Grammar-stripped fragments (SKILL.md)
│   └── megacave/           # Classical Chinese 文言文 (SKILL.md)
├── CHANGELOG.md
├── package.json            # pi & omp package manifest
├── tsconfig.json
├── LICENSE
└── README.md

Changelog

See CHANGELOG.md for release history.

License

MIT © izhimu