open-index/open-npm huggingface dataset:
npm package: @septum-jdr/claude-context-session
Description: Automatic context session manager for Claude Code interactive mode with token optimization.
Author: Juan David Reina
Latest version: 1.3.0


# 🧠 @septum-jdr/claude-context-session
### Context manager for Claude Code that optimizes token usage by keeping only the latest conversation window.

![npm version](https://img.shields.io/npm/v/%40septum-jdr%2Fclaude-context-session)
![downloads](https://img.shields.io/npm/dw/%40septum-jdr%2Fclaude-context-session)
![license](https://img.shields.io/github/license/septum-jdr/claude-context-session)
![node](https://img.shields.io/badge/node-%3E%3D20.0.0-green)
![package size](https://img.shields.io/bundlephobia/minzip/%40septum-jdr%2Fclaude-context-session)
![PRs](https://img.shields.io/badge/PRs-welcome-brightgreen)

---

## ✨ Features
- Global SQLite storage (`~/.claude-context-session`)
- Keeps the **latest 10 prompts**
- Automatic generation of `.claude/context.md`
- Per-session token reduction
- Compact status output:
```
◉ 7/10  ↓82%   1.4k tokens
```
- Works with Claude Interactive Mode
- No wrappers / no proxies
- Safe for updates
- Compatible with WSL / Linux / macOS

---

## 📦 Requirements
- **Node.js ≥ 20**

Check version:
```sh
node -v
```

---

## 🚀 Local Installation (WSL / Linux / macOS)
```sh
npm install
npm run build
npm install -g .
```

Verify installation:
```sh
which claude-context-session
```

---

## 🤖 Enable in Claude
Edit:
```sh
~/.claude/settings.json
```

Add:
```json
{
  "promptCommand": "claude-context-session"
}
```

Restart Claude.

---

## 📟 Statusline Integration
In your `statusline.sh`:
```sh
PLUGIN_STATUS=$(claude-context-session status 2>/dev/null)
OUT+=" ${SEP} ${PLUGIN_STATUS}"
```

---

## ⚙️ How it Works
Each prompt:
1. Stored in SQLite
2. Only the last 10 prompts are kept (auto-prune)
3. `.claude/context.md` is updated
4. Claude loads the reduced context automatically
5. Token savings calculated per session

---

## 🗑️ Uninstall
```sh
npm uninstall -g @septum-jdr/claude-context-session
```

---

## 📄 License
MIT