[FEATURE] Add compactInstructions setting for default /compact arguments

Resolved 💬 3 comments Opened May 4, 2026 by Mharbulous Closed May 7, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When running /compact without arguments, the default summarization is too generic — it loses task-specific context, relevant file paths, and filters nothing. The workaround is typing /compact <long custom prompt> every time, which creates friction.

Previous requests (#3349, #13043, #14160) asked for broader customization (pre/post hooks, full compact replacement). This is a much narrower ask.

Proposed Solution

Add a single compactInstructions string to settings.json:

{
  "compactInstructions": "Create a summary that is detailed with respect to describing the task at hand, provide an overview of relevant context information from this session with a few specific filepaths mentioned for reference if needed, and filter out all information that is irrelevant to the task at hand."
}

When /compact is invoked without arguments (manually or via auto-compact), use this string as the default instructions. When /compact <explicit args> is used, the explicit args take precedence.

No new hooks, no pre/post pipeline, no API changes — just one settings field that provides a default argument.

Investigation

I tested every available mechanism to achieve this:

| Mechanism | Result |
|---|---|
| Custom command expanding to /compact ... | Commands expand as prompts to Claude, not re-parsed as CLI commands |
| Custom skill invoking /compact | Skills load as context; cannot invoke CLI built-ins |
| PreCompact hook | Can only block, not inject instructions |
| UserPromptSubmit hook | Cannot rewrite prompt text |
| CLAUDE.md instructions | Not reliably respected during compaction |

None work. This is a gap that only a settings-level change can fill.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗