Claude Code session

Pith

Pith is the hook that makes Claude Code sessions last 3x longer.

97 stars 11 forksSessions & history Plugin marketplace Source

Install

Inside Claude Code
/plugin marketplace add abhisekjha/pith

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/abhisekjha/pith.git

From the README

Pith
Status: stable — not actively adding features. Bug fixes welcome via issues.

Token compression hooks for Claude Code. Install once, works in every session, zero config.

How it works

Four hooks attach to Claude Code's lifecycle. Every session, every project, automatically.

- PostToolUse — compresses file reads, bash output, and grep results before they hit context
- UserPromptSubmit — runs /pith commands, enforces token ceiling if set
- SessionStart — restores compression mode, injects cache-locked rules
- Stop — records token usage for status and report

The PostToolUse hook is where most savings happen — file reads alone account for 30–50% of context in a typical coding session.

Core features

1 — Auto compression (zero config)

Runs automatically. No commands needed. Every file read, bash run, and grep gets compressed on the way back to Claude.

Real session numbers:

2 — Output modes

Control how Claude writes back to you.

Auto-escalation kicks in as context fills — no manual switching needed:

3 — Token status

4 — Smart file focus

Load only the sections of a file relevant to your current question. Saves re-reading large files.

Returns the 5 most relevant sections with a structure overview. Works on any file type.

5 — Symbol extraction

Pull exact function or class definitions without reading the whole file.

Install

Hooks install globally into ~/.claude/hooks/. Active in every session from that point on.

Update:

Uninstall:

Advanced features

All present and functional. Not the daily workflow, but there when you need them.

Honest numbers

Estimates against real usage — not against "no system prompt."

Session from real use:
- 19.9k input tokens (237.9k baseline without Pith)
- 218k tokens saved — 92% compression ratio
- $0.07 actual vs $3.33…
Read the full README on GitHub

Details

Language
Python
License
MIT
Last updated
6 May 2026
Topics
anthropicclaude-codeclaude-code-pluginllm-toolstoken-optimization

FAQ

What is Pith?

Pith is the hook that makes Claude Code sessions last 3x longer. It is a session for Claude Code, from abhisekjha/pith on GitHub.

How do I install Pith?

Run /plugin marketplace add abhisekjha/pith inside Claude Code, then follow the setup in the README.

Is Pith popular?

abhisekjha/pith has 97 GitHub stars and 11 forks. It was last updated on 6 May 2026.

More sessions & history

Browse the most popular Claude Code mods, all sessions & history, or the skills and MCP server directories.