# Sessions

> Sessions is an open-source agent skill for developer tools. Shows where Claude Code token spend went across recent local sessions. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/localixai/plugins/tree/main/plugins/tokendoctor/skills/sessions
- **Repository:** https://github.com/localixai/plugins
- **GitHub stars:** 186
- **License:** MIT
- **Skill name:** sessions
- **Collection:** https://github.com/localixai/plugins
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-04

## About

This skill reads the local Claude Code session transcripts on the machine and reports how tokens were spent over a chosen number of days, 30 by default. It runs two read-only helper commands, one summarizing cost and usage and one replaying context growth, and works from usage figures, timestamps, tool names and file paths rather than message text.

The report leads with shares of spend rather than raw dollars: how much a smaller compaction window would have saved, how the main thread compares with subagents, how much was spent with more than 400K tokens in context, and which subagent types cost the most. Dollar figures are stated at Claude API list prices, which matters on Pro or Max plans where the work does not draw down the same limits.

The skill then looks at tool output volume, Bash calls that only printed files or waited in loops, frequently read files and subagent growth, and turns these into concrete suggestions. Settings are offered as exact commands for the companion tokendoctor plugin, while behavioural guidance for Claude is drafted for the project's memory or CLAUDE.md. It needs the tokendoctor plugin installed, since it calls tokendoctor-sessions and tokendoctor-replay, and it works only on transcripts still present on this machine.

## When your agent uses it

> Measure where tokens actually went in recent Claude Code sessions, from the local transcripts.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/localixai/plugins/tree/HEAD/plugins/tokendoctor/skills/sessions)
- [Asks for: Bash(tokendoctor-sessions *), Bash(tokendoctor-replay *)](https://github.com/localixai/plugins/blob/HEAD/plugins/tokendoctor/skills/sessions/SKILL.md)
- [License: MIT](https://github.com/localixai/plugins/tree/HEAD/plugins/tokendoctor/skills/sessions)

## Features

- **Cost share breakdown:** Reports the share of spend by main thread, subagents and high-context requests, with dollar figures stated at API list prices.
- **Compaction window savings:** Estimates how much a smaller compaction window would have saved as an upper bound.
- **Tool output analysis:** Shows which tools fill the context through call counts and output size, separately for main thread and subagents.
- **Wasteful Bash detection:** Flags Bash calls that only printed a file or slept in a polling loop.
- **Setting recommendations:** Maps findings to exact tokendoctor commands and to drafted instructions for Claude.
- **Trend comparison:** Compares daily or weekly periods to see whether a change reduced spend.

## Good for

- Find out which sessions and subagents cost the most tokens this month
- Check whether a smaller auto-compaction window would reduce my Claude Code spend
- Spot Bash commands that dump large files into context
- Compare token usage before and after changing subagent models
- Draft memory instructions that keep subagent reports short

## Install

### Claude Code

This skill ships in the `tokendoctor` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add localixai/plugins
/plugin install tokendoctor@localix-lab
```

Or copy only this skill to `~/.claude/skills/sessions`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/localixai/plugins.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/sessions &&
cp -R "$tmp/plugins/tokendoctor/skills/sessions" ~/.claude/skills/sessions &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/sessions` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/sessions` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/localixai/plugins.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/sessions &&
cp -R "$tmp/plugins/tokendoctor/skills/sessions" ~/.agents/skills/sessions &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/sessions` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/sessions` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/localixai/plugins.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/sessions &&
cp -R "$tmp/plugins/tokendoctor/skills/sessions" ~/.cursor/skills/sessions &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/sessions` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/localixai/plugins.git --path plugins/tokendoctor/skills/sessions
```

Or copy the folder to `~/.gemini/skills/sessions` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/sessions`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/localixai/plugins.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/sessions &&
cp -R "$tmp/plugins/tokendoctor/skills/sessions" ~/.copilot/skills/sessions &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/sessions` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/localixai/plugins.git
```

Then copy `plugins/plugins/tokendoctor/skills/sessions` into your agent's skills folder as `sessions`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does Sessions need to run?

It needs the tokendoctor plugin, since the skill calls the tokendoctor-sessions and tokendoctor-replay commands, and it reads the Claude Code transcripts stored on the local machine.

### Does Sessions change my settings or files?

No. The skill is read-only and never edits files. Changes are offered as commands to run with /tokendoctor or via /tokendoctor:optimize, which applies only approved changes.

### Does Sessions read my message text?

According to its instructions, the helper commands read only usage figures, timestamps, tool names and file paths from the transcripts, never message text.

### Are dollar figures what I was billed?

No. Costs are shown at each model's Claude API list price. On Pro or Max plans they indicate what the same work would cost on the API rather than what it used from plan limits.

### Which sessions can it not see?

It cannot see sessions on other machines, per-model prices, or transcripts that Claude Code has already cleaned up.

### How do I install Sessions in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/sessions to use it in all your projects, or to .claude/skills/sessions in one project. Or install the tokendoctor plugin, which includes it: /plugin marketplace add localixai/plugins, then /plugin install tokendoctor@localix-lab.

### Does Sessions run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Sessions?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Sessions?

The closest alternatives to Sessions are Optimize, Session waste report, Dashboard, Cost tracking and Cachewise.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Optimize](https://ai-powered.com/skills/optimize-localixai): Optimize is an open-source agent skill for developer tools.
- [Session waste report](https://ai-powered.com/skills/session-waste-report): Session waste report is an open-source agent skill for developer tools.
- [Dashboard](https://ai-powered.com/skills/dashboard-localixai): Dashboard is an open-source agent skill for developer tools.
- [Cost tracking](https://ai-powered.com/skills/cost-tracking): Cost tracking is an open-source agent skill for analytics and data.
- [Cachewise](https://ai-powered.com/skills/cachewise): Cachewise is an open-source agent skill for developer tools.
- [Audit](https://ai-powered.com/skills/audit-localixai): Audit is an open-source agent skill for developer tools.
- [Scorecard](https://ai-powered.com/skills/scorecard-tansuasici): Scorecard is an open-source agent skill for developer tools.
- [Scan sessions and learn](https://ai-powered.com/skills/scan-sessions-and-learn): Scan sessions and learn is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/sessions
