DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to get safe /compact hints or automatic compaction in Pi with Compact Adviser

Install Compact Adviser in Pi so it suggests or runs /compact at good stopping points.

Short answer: 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. All steps.

Credentials. The TypeSafe API key is kept in the launch environment, saved settings, or a .env file, and eligible checkpoint context is sent to TypeSafe once a key is available.

Who it is forA developer working in a long Pi coding session whose context keeps growing and who wants to know when compacting is safe.

The problemLong sessions carry more context every turn, and compacting at the wrong moment can lose useful working state.

The outcomePi shows a hint to run /compact when a turn looks finished and the context is large enough, or compacts on its own in auto mode after first-use confirmation.

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

  1. Confirm Node 22 or newer is installed and that Pi is version 0.82.0 or newer.
  2. Run pi install npm:compact-adviser.
  3. Provide your TypeSafe key with TYPESAFE_API_KEY in the launch environment, or save it through the /compact-adviser settings.
  4. Restart Pi or run /reload, then run /compact-adviser status and confirm it shows Key: env, Key: saved, or Key: .env.
  5. Run /compact-adviser hint for suggestions only, or /compact-adviser auto to allow automatic compaction after the first-use confirmation. (inferred, check the README)

Prompt for your agent

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.

Caveat. Pi is only one of four hosts, and the README says the install counts as consent to send eligible checkpoint context to TypeSafe.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for kunchenguid/compact-adviser and "Get safe /compact hints or automatic compaction in Pi"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer