What do you want to do?
4 use cases
-
Get safe /compact hints or automatic compaction in Pi
Install Compact Adviser in Pi so it suggests or runs /compact at good stopping points.
- REPO
kunchenguid/compact-adviser - Software and DevOps
- Intermediate
View prompt
Install the compact-adviser package in Pi on <target machine>: run `pi install npm:compact-adviser`, set TYPESAFE_API_KEY, then run `/compact-adviser status`. Expected output: a status line reporting a key source of env, saved, or .env. Verify that the key source is not missing before reporting success.
- REPO
-
Add /compact advice and optional auto-compact to Claude Code
Install the Compact Adviser plugin in Claude Code with function hooks enabled.
View prompt
In Claude Code on <target machine>, add the kunchenguid/compact-adviser marketplace, install compact-adviser@compact-adviser, and start claude with CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1. Expected output: the /compact-adviser command appears and /compact-adviser status reports a key source. Verify that the environment variable is exactly 1 before reporting success.
-
Get hint-only /compact advice in Codex CLI on macOS or Linux
Install the Compact Adviser hook in Codex CLI to see a compact hint after each finished turn.
- REPO
kunchenguid/compact-adviser - Codex
- Software and DevOps
- Intermediate
View prompt
Install compact-adviser in Codex CLI on <target macOS or Linux machine>: add the kunchenguid/compact-adviser marketplace, add compact-adviser@compact-adviser, then restart and trust the hook in /hooks. Expected output: a Compact adviser hint line appears after a completed turn. Verify the hook is trusted before reporting success.
- REPO
-
Turn off Compact Adviser for unattended agent runs
Set COMPACT_ADVISER_DISABLE so scripted or background sessions skip all advice and compaction.
View prompt
For the unattended agent job on <target host>, export COMPACT_ADVISER_DISABLE=1 in the job environment before launching the session. Expected output: the echoed variable value is 1 and the session produces no compact-adviser hints. Verify the value is 1 before the session starts.
Quick start with Compact Adviser
- Check you have what it needs: Node 22 or newer (22.18 or newer for Codex and Grok); One supported host: Pi 0.82.0 or newer, Claude Code 2.1.274 or newer, Codex CLI 0.153.0 or newer, or Grok Build 1.0.34 or newer; A TypeSafe API key, supplied as TYPESAFE_API_KEY in the launch environment, a cwd .env file, or saved through the host settings where supported.
- Open kunchenguid/compact-adviser on GitHub and read the README and license.
- Confirm Node 22 or newer is installed and that Pi is version 0.82.0 or newer.
- Run
pi install npm:compact-adviser. - Provide your TypeSafe key with TYPESAFE_API_KEY in the launch environment, or save it through the /compact-adviser settings.
- Restart Pi or run
/reload, then run/compact-adviser statusand confirm it showsKey: env,Key: saved, orKey: .env.
These steps come from our top use case, Get safe /compact hints or automatic compaction in Pi, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for kunchenguid/compact-adviser
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forDevelopers who run long coding-agent sessions in Pi, Claude Code, Codex CLI, or Grok Build and want to know when compacting context is safe.
- Why it is hot234 stars, launched 53 days ago
- LanguageTypeScript
- Sourcegithub.com/kunchenguid/compact-adviser · Back to Hot repos
Requirements
- Node 22 or newer (22.18 or newer for Codex and Grok)
- One supported host: Pi 0.82.0 or newer, Claude Code 2.1.274 or newer, Codex CLI 0.153.0 or newer, or Grok Build 1.0.34 or newer
- A TypeSafe API key, supplied as TYPESAFE_API_KEY in the launch environment, a cwd .env file, or saved through the host settings where supported
Add this badge to your README
Maintain Compact Adviser? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/kunchenguid-compact-adviser/?utm_source=github&utm_medium=badge&utm_campaign=kunchenguid-compact-adviser)
HTML
<a href="https://dedupedai.com/use-cases/kunchenguid-compact-adviser/?utm_source=github&utm_medium=badge&utm_campaign=kunchenguid-compact-adviser"><img src="https://dedupedai.com/badge/kunchenguid/compact-adviser.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Compact Adviser
What is Compact Adviser?
compact-adviser is an agent plugin for Pi, Claude Code, Codex CLI, and Grok Build that uses the TypeSafe Jev model to judge whether a session is at a safe point to run /compact. It is an open-source project on GitHub: https://github.com/kunchenguid/compact-adviser.
How do I use Compact Adviser?
Confirm Node 22 or newer is installed and that Pi is version 0.82.0 or newer; then run pi install npm:compact-adviser; Provide your TypeSafe key with TYPESAFE_API_KEY in the launch environment, or save it through the /compact-adviser settings. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Compact Adviser for?
Developers who run long coding-agent sessions in Pi, Claude Code, Codex CLI, or Grok Build and want to know when compacting context is safe.
What can I do with Compact Adviser?
4 use cases so far, for example: Get safe /compact hints or automatic compaction in Pi; Add /compact advice and optional auto-compact to Claude Code; Get hint-only /compact advice in Codex CLI on macOS or Linux. Each has steps and a copy-paste agent prompt.
What do I need to run Compact Adviser?
Node 22 or newer (22.18 or newer for Codex and Grok); One supported host: Pi 0.82.0 or newer, Claude Code 2.1.274 or newer, Codex CLI 0.153.0 or newer, or Grok Build 1.0.34 or newer; A TypeSafe API key, supplied as TYPESAFE_API_KEY in the launch environment, a cwd .env file, or saved through the host settings where supported.
What are alternatives to Compact Adviser?
Other hot AI repos in Software and DevOps: Skills, Claude Mem, Freellmapi, Andrej Karpathy Skills, Agent Desktop.
Is Compact Adviser safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.