1
0
Fork
You've already forked pi-caveman
0
No description
  • TypeScript 74.4%
  • JavaScript 25.6%
2026年06月06日 17:45:51 -03:00
.github/workflows fix(ci): remove redundant npm version step, version is set before tagging 2026年05月12日 10:09:02 -04:00
extensions chore(caveman): document commands and add typecheck 2026年06月06日 15:24:12 -03:00
tests feat(caveman): add safe file compression and robust config writes 2026年06月06日 15:16:32 -03:00
.gitignore feat: init pi-caveman extension 2026年04月10日 12:50:18 -04:00
LICENSE feat: init pi-caveman extension 2026年04月10日 12:50:18 -04:00
package-lock.json chore(caveman): migrate to CalVer 26.06.06 2026年06月06日 17:45:51 -03:00
package.json chore(caveman): migrate to CalVer 26.06.06 2026年06月06日 17:45:51 -03:00
pi-caveman.gif docs: add demo gif to README and gallery preview 2026年04月10日 13:33:17 -04:00
README.md chore(caveman): document commands and add typecheck 2026年06月06日 15:24:12 -03:00
shoutout.jpg ty mario 2026年05月12日 10:01:28 -04:00
tsconfig.json chore(caveman): document commands and add typecheck 2026年06月06日 15:24:12 -03:00

🪨 pi-caveman

Why use many token when few do trick.

A pi extension that cuts ~75% of output tokens while keeping full technical accuracy. Based on caveman by Julius Brussee.

🗣️ Normal (69 tokens)

"The reason your React component is re-rendering is likely because you're creating a new object reference on each render cycle. When you pass an inline object as a prop, React's shallow comparison sees it as a different object every time, which triggers a re-render. I'd recommend using useMemo to memoize the object."

🪨 Caveman (19 tokens)

"New object ref each render. Inline object prop = new ref = re-render. Wrap in useMemo."

pi-caveman demo

Install

pi install git:github.com/jonjonrankin/pi-caveman

Usage

Toggle Mode

/caveman Toggle current level on/off
/caveman lite Professional, no fluff
/caveman full Classic caveman
/caveman ultra Maximum compression
/caveman micro Experimental prompt-minimized mode
/caveman off Disable
/caveman stop Disable (alias)
/caveman quit Disable (alias)
/caveman stop caveman Disable (alias)
/caveman normal mode Disable (alias)
/caveman modo normal Disable (alias)
/caveman sem caveman Disable (alias)

Toggling on restores the last active level. If no previous level exists, the configured default (lite) is used.

Undo

/caveman undo Restore previous level

Reverts to the level that was active before the last change.

Help

/caveman help Show command reference
/caveman ? Show command reference

Settings

/caveman config Open active scope settings
/caveman config global Edit ~/.pi/agent/caveman.json
/caveman config project Edit .pi/caveman.json in repo

The config dialog lets you:

  • Default level — Set a level that activates automatically on every new session (e.g. lite to always start in caveman mode)
  • Show status bar — Toggle the animated campfire indicator in the footer

Global vs Project Config

Scope File Applies to
Global ~/.pi/agent/caveman.json All projects
Project .pi/caveman.json in repo Current project only

Project config overrides global config when present. Use /caveman config global or /caveman config project to edit a specific scope directly.

Status Bar

When active, a status bar displays caveman level and an animated campfire flickers in the footer using colored braille characters. This can be disabled in the /caveman config menu.

Compress

/caveman compress <file> Queue agent file compression

Compresses a text file by rewriting it in place. A backup is created alongside the original file (e.g. readme.original.md) before any changes are made, so you can always restore.

Levels

Level Style Example
Lite No filler. Full sentences. Professional but tight. "Your component re-renders because you create a new object reference each render."
Full Drop articles, fragments OK. Classic caveman. "New object ref each render. Wrap in useMemo."
Ultra Abbreviations, arrows, maximum compression. "Inline obj prop → new ref → re-render. useMemo."
Micro (experimental) Minimal prompt that reduces size of caveman prompt itself. Drops filler, pleasantries, hedging, keeps technical substance. "Bug in auth middleware. Token expiry check use < not <=. Fix:"

How It Works

The extension hooks before_agent_start to append caveman communication rules to the system prompt at the selected intensity. Within a session, the active level is stored as a custom session entry and restored on resume. Across sessions, persistent config (~/.pi/agent/caveman.json) provides the default level and status bar preference. Auto-clarity rules tell the model to drop caveman mode for security warnings or irreversible actions.

Warning

Caveman mode only affects output tokens, not chain-of-thought tokens, input tokens, file read/write tool calls, etc. If your agent is in a huge codebase and you've given it a complex task, don't expect much token reduction.

pi-caveman glowing review

But for the cost-conscious, every token counts ;)

Credits

Based on caveman by Julius Brussee.

micro mode prompt based on caveman-micro by Kuba Guzik.

License

MIT