Skip to content
Agent Memory
Skill

/new-session

Start a new session when context is high. Claude uses /clear, Codex uses /exit. Use when context is high or when a fresh session is needed.

From plugin
zylos-core
1.2k14 skills

Claude Code

$ npx -y skills add zylos-ai/zylos-core --skill new-session --agent claude-code

SKILL.md

new-session.SKILL.md
name: new-session
description: Start a new session when context is high. Claude uses /clear, Codex uses /exit. Use when context is high or when a fresh session is needed.

New Session Skill

Start a fresh session with graceful handoff. Use runtime-specific switch commands:

  • Claude: `/clear`
  • Codex: `/exit`

When to Use

  • Context usage exceeds the runtime threshold (triggered automatically by context monitoring)
  • User explicitly asks for a new session or context reset
  • When you need a clean context but don't need to reload settings/hooks (use restart-claude for that)

Pre-Switch Checklist

Before sending the session switch command, complete these steps **in order**:

1. Inventory running background tasks

Check for running background agents using the current runtime's available agent/task listing capability. For Claude, this is `TaskList`.

Runtime behavior differs here:

  • **Claude**: background subagents survive `/clear`, so do not stop them.
  • **Codex**: `/exit` terminates background tasks. Before enqueueing `/exit`, make sure required background work has finished.

For each running task, note:

  • **Agent ID** (e.g., `a42c1aabc5b984e69`)
  • **What it's doing** (brief description)
  • **Output file path** (so the new session can check on it)

This information goes into the handoff summary (step 2).

2. Write a session handoff summary

Write a brief message covering:

  • **What was being worked on** (active tasks, user requests in progress)
  • **Current state** (what's done, what's pending, any blockers)
  • **Running background tasks** (from step 1 — include agent/task IDs and any output file paths or result handles so the new session can check on them with the runtime-appropriate output mechanism)
  • **What the next session should pick up** (if anything)

3. Send the handoff summary

Send the full handoff summary to the internal `void` channel via C4:

cat <<'EOF' | node ~/zylos/.claude/skills/comm-bridge/scripts/c4-send.js "void" "session-handoff"
<handoff summary>
EOF

The `void` channel is record-only: the message is stored in C4 conversation history (so the new session's startup hook, `c4-session-init`, includes it in startup context) but is never delivered to any real channel or display surface.

Do not send the full handoff summary to the active external user channel (Telegram, Lark, Feishu, HXA, etc.). Handoff summaries are operational context for the next agent session and may contain task state from outside the current conversation. If the user is actively waiting, send only a short user-facing notice to their current `reply via` path, without internal task inventory or cross-channel context.

4. Enqueue Session Switch Command

For Codex:

node ~/zylos/.claude/skills/comm-bridge/scripts/c4-control.js enqueue --content "/exit" --priority 1 --block-queue-until-idle --no-ack-suffix

For Claude:

node ~/zylos/.claude/skills/comm-bridge/scripts/c4-control.js enqueue --content "/clear" --priority 1 --block-queue-until-idle --no-ack-suffix

How It Works

1. **Early memory sync** (handled by context-monitor, not this skill): At 80% of the session-switch threshold, the context monitor triggers memory sync in the background. The new session's startup hook also checks for unsummarized conversations and triggers sync if needed — so memory sync is never lost, at most delayed by one session. 2. **Pre-switch checks**: Inventory background tasks, write handoff summary. 3. **Enqueue switch command**: Puts the runtime-specific command into the control queue (`/clear` for Claude, `/exit` for Codex) 4. **Deliver when idle**: Dispatcher delivers the command when idle 5. **Session switches**:

  • Claude: `/clear` resets conversation context, session-start hooks fire, and background subagents continue independently
  • Codex: `/exit` exits the current session so a fresh one can start

6. **New session**: Session-start hooks fire, including memory sync if unsummarized conversations exceed threshold.

Read more
@zylos-ai
Ships withzylos-core

Zylos (/ˈzaɪ.lɒs/ 赛洛丝) — Give your AI a life

Stars on GitHub

Momentum

stars in total
1.2k
Star history of zylos-ai/zylos-core on GitHub, a chart by star-history.com

Other skills on zylos-core.

activity-monitor

activity-monitor

Guardian service that monitors the active runtime agent's state and automatically restarts it if stopped. Use when checking agent…

@zylos-ai@zylos-aiInstall Skill
check-context

check-context

Accurately check current context window and token usage. Use when the user asks about context usage, token consumption, or when…

@zylos-ai@zylos-aiInstall Skill
comm-bridge

comm-bridge

C4 communication bridge — central gateway for ALL external communication (Telegram, Lark, etc.). Use when replying to users via…

@zylos-ai@zylos-aiInstall Skill
component-management

component-management

Guidelines for managing zylos components via CLI and C4 channels. Use when installing, upgrading, or uninstalling components, or…

@zylos-ai@zylos-aiInstall Skill
create-skill

create-skill

Guide for creating effective skills. Use when asked to create a new skill (or update an existing skill) that extends Claude's…

@zylos-ai@zylos-aiInstall Skill
health-check

health-check

System health check dispatched by the activity monitor via Control queue. Checks PM2 services, disk space, and memory usage. Use…

@zylos-ai@zylos-aiInstall Skill

More skills from other plugins.

agent-cost-report

agent-cost-report

Believable agent cost report for any period, default the last 7 full days PT, not counting today. Measured tokens from Claude…

claude-mem13d116k
@thedotmack@thedotmackInstall Skill
bot-handoff

bot-handoff

Keep a durable record of work passed between Bots in the shared Hindsight memory bank. Use when handing work to another Bot, when…

@vectorize-io@vectorize-ioInstall Skill
mempalace

mempalace

Install, configure, and operate MemPalace, including a private local palace, a shared-brain hub, or a client joining an existing…

@mempalace@mempalaceInstall Skill
mempalace

mempalace

Install, configure, and operate MemPalace, including a private local palace, a shared-brain hub, or a client joining an existing…

@milla-jovovich@milla-jovovichInstall Skill

Questions about new-session.

Which coding agents can use new-session?
new-session installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.