Skip to content
Back to skills

Fold

ASecurity

Fold this session before the user clears it, so the fresh session after /clear starts from it with nothing lost. Use when the user asks to fold, to clear without losing anything, to start fresh but keep going, or when a session's window has grown so large that each turn is costly.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 6, 2026
ai-agentsgobashnode

Works with

  • claude code

Security analysis

A100/100

Scanned December 6, 2026

npx -y skills add ctxtree/ctxtree --skill fold --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Fold?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Fold
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ctxtree-fold/badge)](https://www.skillsdirectory.com/skills/ctxtree-fold)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: fold
description: Fold this session before the user clears it, so the fresh session after /clear starts from it with nothing lost. Use when the user asks to fold, to clear without losing anything, to start fresh but keep going, or when a session's window has grown so large that each turn is costly.
allowed-tools: Bash(ctxtree *)
---

Claude Code has no way to shrink a running session's window: a fresh one starts with /clear. A fold makes that clear
lossless.

1. If the session holds a decision or a lead that must outlive the note below, pin its node (`ctxtree pin <node>`), or
   write it where the project keeps its notes.
2. Write the note the new session starts from, and fold with it:

   ```
   ctxtree fold --note - <<'EOF'
   NOW: the task and its next step.
   DECISIONS: each decision with its reason, and its node (t12) where you know it.
   RULES: the user's standing instructions for this work, in their words where you can.
   OPEN: leads, asks, and what is waiting on whom.
   EOF
   ```

   You hold the whole session; the new one holds only this note and what ctxtree carries beside it (the user's
   latest words, your last words, commands still running, pins, files edited, the newest stretches of work). At most
   3,000 characters: what it needs to carry on, not a history. Point to notes files rather than copy them. A summary
   written this way helped a fresh agent carry on the work in ctxtree's measurements, where one drafted by rules did
   not.
3. Show the user what `ctxtree fold` prints: what the next session will start with, and where the whole folded view
   is.
4. Tell the user to type `/clear` in this session. The new session starts from the fold; every turn of this one still
   opens word for word with `ctxtree open <session> <node>`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.