From Jieli
Create a paste-ready handoff/compress prompt for continuing the current Claude Code session in a fresh agent. Use when the user says handoff, hand over, compress, compact, summarize context, continue in a new session, or pass work to another agent.
How this skill is triggered — by the user, by Claude, or both
Slash command
/jieli:handoffThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Compress the current session into a self-contained handoff prompt that a fresh agent can start from. When the current Jieli thread can be identified, embed its thread id and URL so the next agent can use the `jieli-read` skill to read the full transcript if the summary is not enough.
Compress the current session into a self-contained handoff prompt that a fresh agent can start from. When the current Jieli thread can be identified, embed its thread id and URL so the next agent can use the jieli-read skill to read the full transcript if the summary is not enough.
Use this skill when:
Do not use this skill for ordinary status updates or to read/search other threads. Reading known thread ids/URLs is the jieli-read skill; searching by clues is the jieli-find skill.
jieli-handoff-info helper. The helper receives hook context from the PreToolUse hook and returns JSON. No API key is needed; the helper only builds a thread URL and never calls the Jieli API.Run the helper exactly as a plain command so the PreToolUse hook can inject the current session_id, transcript_path, and cwd:
jieli-handoff-info
If that command is not found or does not print valid JSON, resolve ../../scripts/jieli_helper.mjs relative to this SKILL.md file and run the bundled fallback helper:
node <resolved-skill-dir>/../../scripts/jieli_helper.mjs handoff-info
The fallback is a single Node entrypoint that loads the plugin runtime directly. Do not enumerate plugin cache directories, choose wrapper files, or sort installed helpers in this skill.
Expected JSON shape:
{
"confidence": "high",
"provider": "claude_code",
"session_id": "...",
"thread_id": "T-...",
"url": "https://jieli.app/threads/T-...",
"cwd": "...",
"repo_url": "...",
"branch": "...",
"worktree_status": "clean"
}
Rules:
thread_id and url for the current session.thread_id or url is empty, do not guess from the newest transcript. Still produce the handoff prompt, but omit the Jieli thread/read-thread lines and mention that the current thread could not be identified.You already hold the full conversation, so write the context yourself; do not call a model and do not read the full transcript. Treat any text after the handoff/compress request as My request and use it as the relevance filter. Prioritize facts, files, decisions, verification, and next steps that help that request; keep only global constraints and safety notes from unrelated work.
Use helper metadata such as cwd, repo_url, branch, and worktree_status as source context, but do not force those fields into the final handoff unless they are useful for the request.
Consider what would be useful for the next agent based on My request. Questions that may be relevant:
Extract what matters for the specific request below. Don't answer questions that aren't relevant. Pick an appropriate length based on the complexity of the request.
Focus on capabilities and behavior, not file-by-file changes. Avoid excessive implementation details (variable names, storage keys, constants) unless critical.
Format: Plain text with bullets. No markdown headers, no bold/italic, no code fences. Use workspace-relative paths for files.
Relevant files rules:
Never include API keys, secrets, tokens, cookies, .env contents, full transcripts, large raw logs, or sensitive private data. Say that sensitive values were omitted when relevant.
My request: <next goal / text after the handoff request, or the inferred open follow-up>
If the current thread was identified, assemble the handoff prompt in this shape. The first two lines are fixed; the body is the goal-filtered plain-text bullet context from step 2. Include helper metadata such as repo/cwd/branch/status only when useful for the request.
Continuing work from Jieli thread <THREAD_ID>.
When you lack specific information, use the jieli-read skill to read the thread.
Relevant files: <path1> <path2> <path3> ...
<goal-filtered relevant information bullets>
My request: <next goal / text after the handoff request, or the inferred open follow-up>
If the thread was not resolved, omit the first two lines and start with:
You are continuing work from a previous Claude Code session.
Current Jieli thread could not be identified automatically; ask the user for the thread id or Jieli URL if full transcript access is needed.
Write the full handoff prompt to a temp file, but do not print the full prompt in your reply:
handoff-<THREAD_ID>.md.handoff-<SLUG>.md.os.tmpdir() via path.join(os.tmpdir(), filename). Do not hard-code /tmp, because Windows agents need a platform-native temp directory.Use a safe writer, for example Node, so prompt content cannot break a shell here-doc and the temp path stays cross-platform:
node <<'JS'
const fs = require("node:fs");
const os = require("node:os");
const path = require("node:path");
const idOrSlug = "<THREAD_ID_OR_SLUG>";
const safe = idOrSlug.replace(/[^A-Za-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "handoff";
const out = path.join(os.tmpdir(), `handoff-${safe}.md`);
fs.writeFileSync(out, `<assembled handoff prompt>
`, "utf8");
console.log(`Wrote handoff to ${out}`);
JS
Then reply with only a brief summary: the saved file path, whether a thread id was included, the relevant files count/list, and the next goal. Do not include the full handoff prompt unless the user explicitly asks to print it.
jieli-read skill to read <THREAD_ID> for the full transcript.read_thread may cover history only up to the previous sync. The handoff prompt itself must carry the key current context..env contents, full transcripts, large raw logs, or sensitive private data in the handoff prompt.npx claudepluginhub jieliapp/plugins --plugin jieliCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.