/ramtoshiya:self-compactfrom ramtoshiya
Compact this conversation at a boundary you choose and resume without the user. Use when a "Context budget" notice says to compact, or when the user asks you to compact yourself and keep working. Covers Claude Code in BB and Paseo.
Ships in ramtoshiya. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Claude Code compacts on its own when the context nears its window, often in the middle of a step. This skill compacts earlier, at a point you choose, and carries the task across the compaction in a handoff note.
Write the note to the path the budget warning names. Without a
warning, create a file with mktemp -t handoff. Never put it inside a repository. Overwrite an
older note rather than append.
The note is the only reliable state after compaction, so write it for a reader who saw nothing:
When BB_THREAD_ID is set, use the BB section. Otherwise, when
PASEO_AGENT_ID is set, read references/paseo.md and follow it. Otherwise,
use the Other hosts section.
When BB_THREAD_ID is set, use the bundled helper. It requires node and the installed bb
CLI, and supports BB's claude-code provider. It does not install dependencies or change BB
settings. Other providers use the fallback below.
Give this helper exclusive control of the thread until it finishes. Do not launch another helper or send more prompts to this thread during that time. Other threads can keep working. BB checks whether a thread is idle before accepting compaction, but its CLI has no atomic send-if-unchanged operation. A prompt arriving after the final check can still race the resume.
First, prepare in a standalone foreground Bash call. Use this skill's actual directory and the absolute handoff note path:
node "<skill-directory>/scripts/bb-compact.mjs" prepare "<handoff-note>"
Preparation checks the thread and note and returns launchSeq and turnId. It allows earlier
requests only if BB recorded their acceptance into this turn before the preparation command
started. Do not wrap the command in a way that hides it from the BB log.
Pass launchSeq and turnId to the background command so it can recognize this turn even if it
starts after you stop:
node "<skill-directory>/scripts/bb-compact.mjs" run "<handoff-note>" --launch-seq <launchSeq> --turn-id <turnId>
Launch the second command with Bash's run_in_background: true, timeout: 600000, and
completion notifications. The Bash timeout must exceed the helper's five-minute deadline.
End the turn immediately after launch with one line saying compaction is scheduled and work will
resume. Do not wait for the helper in the foreground. It is waiting for this turn to end.
If the next step needs the user's answer, add --no-resume and end with the question.
Use the automatic-compaction fallback if the shell cannot report background failures.
The helper targets only BB_THREAD_ID. It waits for the invoking turn to finish successfully,
then requests compaction with bb thread compact. It links the new structured compact request
to its accepted turn and requires both thread/compacted and a successful turn/completed
for that turn. A command receipt, a closed contextCompaction item, or an assistant summary
does not prove compaction. It sends the handoff instruction through tell --mode queue only
after proof and a final idle check.
Pending interactions, queued work before the request (messages that the mail plugin holds in the
inbox do not count), another request, missing proof, or failure
stop the helper and keep the note. Messages that queue while compaction runs, and turns they
start after BB records the compaction turn as completed, do not fail a proven compaction. Read the background error before deciding how to continue. Do not retry a
send automatically, because its delivery can be uncertain. A queued resume receipt reports a
late race, including its queue id, rather than confirmed delivery. Inspect that row before
retrying. With --no-resume, a completion notification does not authorize continuing past the
user's pending question.
Without a supported host control, keep the handoff note current and continue working. Automatic compaction is the fallback, and the hook points you to the note after it. Use the same fallback if scheduling compaction fails.
Read the handoff note before anything else and continue from its next step without asking whether to continue. When the task in the note is finished, delete the note.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ramtoshiya/skills --plugin ramtoshiyaOther plugins' skills for the same job
14 skills in this plugin
/excalidraw-boardUse when a user asks agents to read, draw, or export selected objects as PNG from a shared excalidraw.com room, or a collaborator references a room id, revision, and element ids. Uses separately installed excalidraw-board and, for PNG export, excalidraw-web-export commands./figma-restUse when reading anything out of a Figma design file — design tokens, colors, type/spacing scales, node structure, or rendered node images — and when a Figma MCP tool returns a rate-limit or "nothing selected" error. Prefer the REST API over the Figma MCP server, which is capped per seat./github-actions-authoringUse before creating or editing .github/workflows/*.yml, .github/workflows/*.yaml, action.yml, or action.yaml anywhere in a repository, even for a small non-version change. Verify every remote uses dependency against its official GitHub releases, enforce a 72-hour release cooldown, inspect compatibility and security, and pin original-repository commit SHAs. Never choose action versions from model memory.