Explain it like you'd tell grandma.
Project description
You know her. She loves you, she read the whole thing, and she is not sitting through six paragraphs of agent confetti to find out whether the test passed.
Grandma does not dumb it down. She keeps every fact that matters. She just refuses to waste your afternoon.
grandma takes verbose LLM output and distils it to three lines: what happened, the bottom line, and what to do next.
๐ธ Token savings
Every time you read a raw LLM response, you pay in attention โ or in tokens if you pipe it into another model.
| Words | Reading tokens | Cost to re-read | |
|---|---|---|---|
| Raw LLM response | ~400 | ~530 | 100% |
| grandma card | ~40 | ~55 | ~10% |
| Savings | ~90% fewer tokens |
Why this matters:
- In agent loops, every intermediate response fed back into context costs tokens. Grandma compresses the signal.
- In multi-step workflows (plan โ code โ review โ deploy), each step can save 400โ500 tokens of context bloat.
- Deep mode trades a bit more output for full structured data โ still 70โ80% smaller than the raw response.
- Across a 20-turn session, grandma typically saves 8,000โ12,000 context tokens.
Before / After
Raw LLM output (~90 words, ~120 tokens):
I inspected the repository and found that the authentication flow now routes through
the new async session adapter. I updated three files, added one regression test, and
confirmed that the login path still returns the expected token shape. There is one
compatibility consideration: the adapter relies on Python 3.9+ typing behavior, so
Python 3.8 users will need to upgrade or pin the old release. Overall, this should
reduce request latency, but the deployment notes should mention the runtime floor.
After grandma (default mode โ ~30 words, ~40 tokens):
๐ต grandma
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Second turn reviewing an auth refactor PR.
What happened: Auth moved to the async session adapter.
Bottom line: Faster login path, but Python 3.8 is out.
Do next: Document Python โฅ3.9 before shipping.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
After grandma (deep mode โ full impact table):
๐ต grandma
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ story arc โ Second turn reviewing an auth refactor PR. โ
โ ๐ happened โ Auth moved to async session adapter. โ
โ ๐งถ changed โ 3 files, 1 regression test added. โ
โ โ
positive โ Login latency reduced; token shape unchanged. โ
โ โ ๏ธ negative โ Breaks Python 3.8 (asyncio.TaskGroup). โ
โ โ neutral โ API surface unchanged. โ
โ ๐ก net gain โ Win โ ship it with a runtime floor note. โ
โ ๐ actions โ - Add Python โฅ3.9 to pyproject.toml โ
โ โ - Update deployment docs โ
โโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Install
pip install grandma
# or
pipx install grandma
# or from source
pip install git+https://github.com/ypollak2/grandma.git
Usage
Pipe any text through grandma:
echo "long agent output..." | grandma
cat response.txt | grandma --mode deep
cat response.txt | grandma --json # raw JSON verdict
cat response.txt | grandma --mode off # passthrough
Demo (no API key needed):
grandma --demo
grandma --demo --mode deep
Environment variable for default mode:
export GRANDMA_MODE=deep
The Modes
| Mode | What you get | Model used | Best for |
|---|---|---|---|
default |
3-line card: happened / bottom line / do next | Haiku | Most agent output |
deep |
Full impact table with positive/negative/neutral | Sonnet | PRs, arch decisions, refactors |
off |
Passthrough โ original text unchanged | โ | When you need the whole casserole |
Works without an API key
Grandma runs on your Claude Code subscription โ no ANTHROPIC_API_KEY needed:
grandma โ claude -p - (stdin pipe) โ your Claude Code OAuth session
Set ANTHROPIC_API_KEY only if you want to use your own API credits instead.
IDE & agent integrations
Grandma works anywhere LLMs produce text. One-liner install for all detected tools:
./install.sh
| Tool | Integration type | What happens |
|---|---|---|
| Claude Code | Stop hook (native) | Auto-card after every long response |
| Codex CLI | Stop hook (native) | Auto-card after every long response |
| Gemini CLI | AfterAgent hook (native) | Auto-card after every agent turn |
| Cursor | MCP + .cursor/rules |
Agent calls grandma_summarize after long replies |
| Cline | MCP + rules | Agent calls grandma_summarize after tasks |
| Continue | MCP + /grandma slash command |
On demand or automatic |
| Windsurf | MCP + .windsurfrules |
Agent calls grandma_summarize after long replies |
| Zed | MCP (context_servers) |
Tool available in Zed AI panel |
| Goose | MCP extension | Tool available in Goose sessions |
| Aider | grandma-aider wrapper |
Pipe aider output through grandma |
| OpenHands | grandma-openhands wrapper |
Pipe headless output through grandma |
MCP server (for any MCP-capable IDE):
grandma serve
Exposes two tools:
grandma_summarize(text, mode, story_context)โ plain-text cardgrandma_summarize_json(text, mode, story_context)โ structured dict
Add to any .mcp.json:
{
"mcpServers": {
"grandma": { "command": "grandma", "args": ["serve"] }
}
}
How the mascot rotates
Each grandma portrait in this repo (assets/grandmas/) was generated with Gemini Image.
A daily GitHub Action picks one at random and replaces assets/grandma.png.
The README always shows the current winner. No JS. No CDN. No infrastructure.
Want to add your own grandma? Drop a PNG into assets/grandmas/ and open a PR.
FAQ
Does grandma make it dumber?
No dear. She keeps the facts. She removes the fog machine.
Does default mode include everything?
It includes what you need first. Use --mode deep when you need the full table.
Why is there an off mode?
Because sometimes you want the original, and grandma knows when to leave a person alone.
What's the story_so_far line?
Grandma reads the last 3 turns of the conversation to understand where you are in the arc.
If you are on turn 8 of debugging the same auth bug, she will tell you. This is the dementia prevention feature.
Which models does it use?
Default mode: claude-haiku-4-5-20251001. Deep mode: claude-sonnet-4-6.
Both run on your Claude Code subscription โ no extra key needed.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grandma-0.1.0.tar.gz.
File metadata
- Download URL: grandma-0.1.0.tar.gz
- Upload date:
- Size: 42.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cb6e96987faf126f7be15e7f54fd16aa2d82e26ce66b8438ecaf15b61be06e4
|
|
| MD5 |
1564ad7a2aa25a4a9ad4c2bea7bd7b23
|
|
| BLAKE2b-256 |
07b39f9ab2ff32f58ba4af5f8ea60723b60885c2517b999dc518841ab5afa3f5
|
File details
Details for the file grandma-0.1.0-py3-none-any.whl.
File metadata
- Download URL: grandma-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9bcd1580cf83f3a0648b196df25a87065e0428fa0d6fdb7bacbec239a57415f
|
|
| MD5 |
3e70e9d568c7d373cd8b7cca04ff5a0e
|
|
| BLAKE2b-256 |
aa8831c8d42561d5a2f0b427c79ba65e59d9afe7199f30a9435d0bb218492dac
|