compact-adviser plugin

compact-adviser tells you when it is time to run /compact in a Claude Code, Codex or Pi session and can optionally run it for you

  • 236 ★ on the repository
  • Last commit
  • MIT
Plugin

Extended access

Why this level

  • The plugin sends session context to the external TypeSafe service and in automatic mode can run `/compact` itself.
All reasons and checks

kunchenguid/compact-adviser

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add plugins/compact-adviser

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The plugin sends session context to the external TypeSafe service and in automatic mode can run `/compact` itself.

This is third-party code. Review the repository files before installing.

What it does

The plugin answers one question: is it time to compact the context. After a finished step it asks the Jev model from TypeSafe two questions in one request: is the unit of work finished and is it hands-on work or coordination. Code combines the answers into one score. The hint threshold depends on how full the context is. While it is nearly empty the floor is 0.90 and hints are rare. Near 90 percent full the floor drops to 0.50 because a wrong hint costs less there. You can set a context budget so the floor starts relaxing sooner. Below the answer a line appears such as "Compact adviser: work appears completed or recorded. Run /compact to save tokens." In Claude Code and Pi you can opt in to an automatic mode with the same gate and a first-use confirmation. In Codex CLI and Grok Build the mode is hint-only because other processes cannot trigger `/compact` inside their sessions.

Who it is for. People who run long Claude Code, Codex or Pi sessions and want to compact context on time without watching the token counter.

Good fit when

  • The session keeps growing, every turn costs more and the boundary between tasks is not marked anywhere.
  • You want a hint at a safe boundary, when work is recorded and compaction loses nothing.
  • In Claude Code you want `/compact` to run automatically at the right moment.
  • You want to set your own context budget smaller than the model window.

Not a fit when

  • Session context cannot go to an external service: the plugin sends checkpoint context to TypeSafe.
  • You have no TypeSafe key: scoring is impossible without it.
  • You work on Windows in Codex: only macOS and Linux are supported.

Example request

Run `/compact-adviser` and show the current key status and hint mode.

Limitations

A TypeSafe key in `TYPESAFE_API_KEY` or in a `.env` file is required, plus Node 22 or newer (22.18 or newer for Codex and Grok). Installing the package counts as consent to send eligible checkpoint context to TypeSafe, and with `TYPESAFE_BASE` set the context and key go to that address instead. In Claude Code the plugin uses an experimental feature and needs `CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1`. Codex support is macOS and Linux only. In Grok Build the plugin hooks are not loaded, so the `/compact-adviser-install` command and a status line settings block are required.

How to disable. In Claude Code run `claude plugin uninstall compact-adviser@compact-adviser`, in Pi remove the `npm:compact-adviser` package with Pi tools. In Grok delete the `compact-adviser.json` hook file from `~/.grok/hooks`.

FAQ

How do I install compact-adviser in Claude Code?

Run `claude plugin marketplace add kunchenguid/compact-adviser` and `claude plugin install compact-adviser@compact-adviser`, then start `CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 claude` and the `/compact-adviser` command.

How do I install it in Codex CLI?

Run `codex plugin marketplace add kunchenguid/compact-adviser` and `codex plugin add compact-adviser@compact-adviser`, restart Codex and trust the hook in `/hooks`.

What data leaves the machine?

Checkpoint context goes to TypeSafe for two classification questions. The plugin never asks it to write a summary.

Can the plugin compact by itself?

In Claude Code and Pi yes, if you enabled the automatic mode. In Codex CLI and Grok it only hints.

How do I install it in Pi?

Run `pi install npm:compact-adviser`, then restart Pi or use `/reload` and `/compact-adviser`.

Discussion

No questions or reviews yet.

Plugins

A Claude Code plugin that picks the model's effort level for every prompt and shows the prompt cache countdown

PluginExtended access346Repository stars

The claude-crusts CLI splits a Claude Code context into six categories, finds waste and writes a /compact command for the session.

CLIExtended access82Repository stars

A Claude Code plugin that replaces auto-compact: it writes a handoff brief, clears the session and continues from it

PluginExtended access125Repository stars

hush quiets running narration in Claude Code and puts the result first: what changed and what comes next.

PluginMinimal access54Repository stars
Needs a VPN

A Claude Code plugin that catches your corrections in chat and, after review, writes them into CLAUDE.md and AGENTS.md

PluginExtended access1.9KRepository stars

A local CLI that shows where tokens go in Claude Code, Codex and opencode and holds back expensive messages

CLIExtended access237Repository stars

README in short

The README lists installs for Pi, Claude Code, Codex CLI and Grok Build and explains the hint threshold. macOS and Linux platforms, MIT license.

README badge

Report a problem