Who it is forA developer on macOS or Linux using Codex CLI for long sessions who wants a prompt to compact without giving up manual control.
The problemCodex CLI sessions grow over time, and there is no built-in signal for when compacting would be safe.
The outcomeAfter a completed checkpoint, Codex shows a hint line under the answer. Codex never compacts on its own, so the decision stays with you.
What you need first
- 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
Steps
- Confirm you are on macOS or Linux, Node is 22.18 or newer, and Codex CLI is 0.153.0 or newer.
- Run
codex plugin marketplace add kunchenguid/compact-adviser. - Run
codex plugin add compact-adviser@compact-adviser. - Restart Codex and review the hook in
/hooksonce so it is trusted. - Finish a turn and look for the
↳ Hook · Compact adviser:line under the answer. If the hook cannot find Node, set COMPACT_ADVISER_NODE to an absolute node path.
Prompt for your agent
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.
Caveat. Codex support is limited to macOS and Linux, and Windows is not supported in this release.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for kunchenguid/compact-adviser and "Get hint-only /compact advice in Codex CLI on macOS or Linux"
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 freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer