Agent skill

Compact Plus

by u-ichi in u-ichi/compact-plus

Save the current Claude Code or Codex session state to a temporary state file before running /compact.

MITAuto-check: notesAgent Workflows

Install Compact Plus

skills CLI
$ npx skills add u-ichi/compact-plus --skill compact-plus -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install u-ichi/compact-plus compact-plus --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/u-ichi/compact-plus.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/compact-plus .claude/skills/compact-plus && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
compact-plus
GitHub stars
205
Token cost
~892 tokens
SKILL.md length
367 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Save the current Claude Code or Codex session state to a temporary state file before running /compact.

  • Works in 6 steps: Get the session id. → Set the destination. → Check TaskList, active plan file,… → …
  • Tasks that involve Session handoff
  • SKILL.md covers Strict procedure profile, Procedure, Content To Save and Completion receipt
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Compact Plus is an agent skill from u-ichi/compact-plus. Save the current Claude Code or Codex session state to a temporary state file before running /compact. MANDATORY TRIGGERS: /compact-plus, compact-plus, compact plus, compaction plus handoff, pre-compact state save. DO NOT TRIGGER: post-compact recovery, ordinary progress updates, plan creation, or casual context-usage discussion.

Its SKILL.md is about 890 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Session handoff. The repository describes itself as: Claude Code plugin: preserve and restore working state around /compact. The licence is MIT.

When your agent uses it

  • Tasks that involve Session handoff

Example prompts

  • “/compact-plus”

Requirements

  • Pre-approved tools (allowed-tools): Bash, Read, Write, Edit, Grep

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Get the session id.
  2. Set the destination.
  3. Check TaskList, active plan file, tmux-bridge state, and files currently being edited.
  4. Save the following headings to the state file in this exact order.
  5. Read the state file back after saving and verify that every heading above exists.
  6. Tell the user: Preparation complete. Please run /compact.

What it can do on your machine

Read from SKILL.md and the folder at commit acb5b80. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash
    • Read
    • Write
    • Edit
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Compact Plus loads about 892 tokens when it runs. Until then it costs about 86 tokens; SKILL.md has 367 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~86
When it runs · the whole SKILL.md, loaded when a task matches
~892

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash, Read, Write, Edit, Grep

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from u-ichi/compact-plus at commit acb5b80, republished under its MIT licence (© u-ichi). 367 words, ~892 tokens.

Download SKILL.mdSave it as .claude/skills/compact-plus/SKILL.md (or your agent's skills folder).
name
compact-plus
description
Save the current Claude Code or Codex session state to a temporary state file before running /compact. MANDATORY TRIGGERS: /compact-plus, compact-plus, compact plus, compaction plus handoff, pre-compact state save. DO NOT TRIGGER: post-compact recovery, ordinary progress updates, plan creation, or casual context-usage discussion.
allowed-tools
Bash, Read, Write, Edit, Grep
codex_description
Save compact-plus working state for the current Codex thread. Use before /compact only; do not use for normal progress updates or post-compact recovery.
strict_procedure
true
argument-hint
[recovery notes]

compact-plus

In Claude Code and Codex, the PreCompact hook automatically saves a pre-compaction state file when /compact runs. This skill is a manual fallback for richer recovery notes.

Before /compact, save working state that is not reliably preserved by the compaction summary to the runtime-specific state directory.

Strict procedure profile

  • Strictness: strict-procedure. The state file content and completion receipt are the deliverable.
  • Hard gates: if the session id cannot be detected, do not create a guessed state file name. Stop and report that session id detection failed.
  • Forcing function: fix the destination path, then read the saved file back and verify that the required headings exist.
  • Completion receipt: report the state file path, main saved items, unverified items, and the instruction to run /compact.

Procedure

  1. Get the session id.
    • Use $CLAUDE_CODE_SESSION_ID in Claude Code.
    • Otherwise use $CODEX_THREAD_ID in Codex.
    • $CODEX_COMPANION_SESSION_ID is the final compatibility fallback.
    • If it cannot be detected, do not create a state file. Report that preparation is incomplete because the session id is unavailable.
  2. Set the destination.
    • Claude Code: ${TMPDIR:-/tmp}/claude-compact-state/${SESSION_ID}.md.
    • Codex: ${TMPDIR:-/tmp}/codex-compact-state/${SESSION_ID}.md.
  3. Check TaskList, active plan file, tmux-bridge state, and files currently being edited.
    • Read the relevant active plan file under ~/.claude/plans/ when one is present.
    • If tmux-bridge is not used, record Not used.
  4. Save the following headings to the state file in this exact order.
markdown
# Compact Prep State
## Active Plan
## Current Phase
## TaskList Summary
## Session Decisions
## Constraints and Blockers
## Worker Topology
## Skills Invoked
## Editing Files
## Failed Attempts
## Recovery Notes
  1. Read the state file back after saving and verify that every heading above exists.
  2. Tell the user: Preparation complete. Please run /compact.
Show full SKILL.md (120 more words)Show less

Content To Save

  • Active plan file path and current phase or step.
  • In-progress task list and relevant notes.
  • Decisions made during the session, user choices, and rejected alternatives with rationale.
  • Constraints, blockers, and incomplete verification.
  • Worker topology. When tmux-bridge is used, record pane, role, and responsibility.
  • Skills and slash commands invoked earlier in the session. This is an invocation record, not proof that the skill or command is currently active.
  • Files being edited and notes about unsaved or unverified work.
  • Failed attempts, tool errors, and rejected approaches that should not be repeated.
  • Recovery notes for the post-compaction agent.

Completion receipt

Include the following when complete:

  • State file path.
  • Main saved items.
  • Unverified items and reasons.
  • Preparation complete. Please run /compact.

© u-ichi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/compact-plus of u-ichi/compact-plus.

Open the folder on GitHubat commit acb5b80

Compare with similar skills

Compact Plus next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Compact Plus compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Compact Plus this skillu-ichi/compact-plus205—~892Automated safety check: NotesMIT
Orca CLIstablyai/orca87k2 repos~593Automated safety check: PassMIT
Coding Agent Session Findercode-yeongyu/oh-my-openagent70k1 repos~2.8kAutomated safety check: PassCustom licence
Beads Task Memorygastownhall/beads28k—~1.2kAutomated safety check: PassMIT
Session History Searchslopus/happy24k—~3.1kAutomated safety check: PassMIT
Paseo Agent Handoffgetpaseo/paseo20k1 repos~606Automated safety check: PassCustom licence

Similar skills

  • Orca CLI

    stablyai/orca

    Operate Orca-managed worktrees, folder contexts, terminals, repos, automations, artifacts, skill sharing, worktree comments, and Orca's embedded browser…

    87k GitHub starsUsed in 2 repos~593 tokens
    Agent WorkflowsAuto-check passed
  • Coding Agent Session Finder

    code-yeongyu/oh-my-openagent

    Finds, reads and reconstructs past coding-agent sessions across Codex, Claude, OpenCode, Senpi and many other local agent logs.

    70k GitHub starsUsed in 1 repo~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Beads Task Memory

    gastownhall/beads

    Tracks multi-session work with dependencies in the bd issue tracker so the agent can find ready tasks and recover its context after conversation compaction.

    28k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated yesterday
    Agent WorkflowsAuto-check passed
  • Paseo Agent Handoff

    getpaseo/paseo

    Hands off the current task, including context, decisions and failed attempts, to a fresh agent through Paseo by writing a self-contained briefing prompt and launching that agent.

    20k GitHub starsUsed in 1 repo~606 tokens
    Agent WorkflowsAuto-check passed
  • Memori Long-Term Memory

    MemoriLabs/Memori

    Connects Claude Code to Memori Cloud for long-term memory, recalling stored context before substantive replies and saving new context afterward.

    17k GitHub stars~2k tokensUpdated 5 days ago
    Agent WorkflowsAuto-check: notes

Categories

Questions about Compact Plus

What does Compact Plus do?

Save the current Claude Code or Codex session state to a temporary state file before running /compact. Compact Plus is an agent skill from u-ichi/compact-plus. Save the current Claude Code or Codex session state to a temporary state file before running /compact.

When should I use Compact Plus?

Compact Plus fits situations like: tasks that involve Session handoff.

How do I install Compact Plus in Claude Code?

Run `npx skills add u-ichi/compact-plus --skill compact-plus -a claude-code`. Or copy the skill folder (skills/compact-plus in u-ichi/compact-plus) into .claude/skills/compact-plus in your project. Claude Code loads it when a task matches its description.

How do I install Compact Plus in Codex?

Run `npx skills add u-ichi/compact-plus --skill compact-plus -a codex`. Or copy the skill folder (skills/compact-plus in u-ichi/compact-plus) into .agents/skills/compact-plus in your project. Codex loads it when a task matches its description.

Can I use Compact Plus in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add u-ichi/compact-plus --skill compact-plus -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/compact-plus, .gemini/skills/compact-plus, .github/skills/compact-plus and .opencode/skills/compact-plus in your project.

What does Compact Plus need to run?

SKILL.md names no scripts, command-line tools or credentials: Compact Plus is instructions for the agent only. Its frontmatter pre-approves these tools: Bash, Read, Write, Edit, Grep.

Does Compact Plus access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Compact Plus safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Compact Plus use?

Compact Plus is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Compact Plus use?

About 892 tokens (SKILL.md is roughly 3.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Compact Plus?

Skills that share tags, products or a category with Compact Plus: Orca CLI (stablyai/orca, 87k stars), Coding Agent Session Finder (code-yeongyu/oh-my-openagent, 70k stars), Beads Task Memory (gastownhall/beads, 28k stars) and Session History Search (slopus/happy, 24k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Compact Plus?

u-ichi (a GitHub user) maintains it in u-ichi/compact-plus, which has 205 GitHub stars. The repository was last updated on July 27, 2026.

Source: u-ichi/compact-plus on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.