Compaction UI Enhancements

ReviewAudited by ClawScan on May 10, 2026.

Overview

The skill matches its compaction purpose, but it can automatically rewrite persistent session context using existing model credentials, so it warrants review before installation.

Install only if you want automatic session compaction. Review the settings immediately, disable auto-compaction if you want manual control, keep result storage off unless needed, confirm which model/provider credentials will be used, and back up important sessions before enabling automatic rewriting.

Findings (6)

Artifact-based informational review of SKILL.md, metadata, install specs, static scan signals, and capability signals. ClawScan does not execute the skill or run runtime probes.

What this means

A conversation may be summarized and compacted in the background, which can remove detail from the active session context and affect future responses.

Why it was flagged

This shows the UI can invoke the session-compaction RPC automatically after chat responses when token use crosses a threshold, rather than only after a direct user click.

Skill content
Called after every chat "final" event... if (pct < settings.settings.autoThresholdPercent) return; ... app.client?.request("sessions.compact", { key: app.sessionKey });
Recommendation

Make automatic compaction clearly opt-in, show an explicit first-run warning, and provide backup or rollback guidance for compacted sessions.

What this means

Compaction could interrupt an active agent run or leave future work depending on the compacted summary instead of the original full transcript.

Why it was flagged

The compact RPC can abort an active run and update persistent session metadata, so one compaction action can affect in-flight work and later session behavior.

Skill content
if (isEmbeddedPiRunActive(sessionId)) { abortRun(sessionId); await waitEnd(sessionId, 15_000); } ... entryToUpdate.totalTokens = result.result.tokensAfter; ... entryToUpdate.compactionCount = ...
Recommendation

Avoid aborting active runs automatically, require confirmation when a run is active, and keep recoverable backups of session transcripts.

What this means

Background compaction may use the same provider account, OAuth profile, API key, billing, and data-sharing path as normal chat.

Why it was flagged

The skill reuses existing chat credentials for compaction model calls, which is expected for this feature but should be understood by the user.

Skill content
Compaction uses `resolveApiKeyForProvider` via `getApiKeyForModel` — the same auth chain as chat: OAuth → API Key → Fallback ... compaction uses it automatically.
Recommendation

Confirm which provider/model will be used for compaction and disable auto-compaction if you do not want background model calls.

What this means

Compaction summaries or metadata may remain on disk and may influence what context is preserved for future work.

Why it was flagged

The skill persists last-result metadata, and optionally the compacted summary text, under the agent directory.

Skill content
if (config.settings.storeLastResult) { config.lastResult = result; } else { config.lastResult = { ...result, summary: undefined }; } await saveCompactionConfig(config, agentDir);
Recommendation

Keep result storage disabled unless needed, clear stored results when done, and treat compacted summaries as sensitive conversation data.

What this means

Some internal assistant/control messages may not be visible in the chat transcript view.

Why it was flagged

The UI intentionally hides assistant messages with these exact control-message texts from chat display.

Skill content
if (fullText === "NO_REPLY" || fullText === "HEARTBEAT_OK") { continue; }
Recommendation

Document this filtering clearly and keep it limited to exact, non-user-facing control messages.

What this means

Users have less external provenance to rely on when deciding whether to integrate these UI/gateway changes.

Why it was flagged

The artifact provenance is limited, even though no external install script or dependency is shown.

Skill content
Source: unknown; Homepage: none
Recommendation

Review the provided diffs before applying them and prefer a repository or signed release for production use.