Agent skill

Session Optimizer

by huangruiteng in huangruiteng/CS-Notes

OpenClaw Session 优化器 - 监控 session 状态,在需要时提醒用户切换 session。包括 session 长度监控、已完成任务数量统计、时间显示等功能。

MITAuto-check passed

Install Session Optimizer

skills CLI
$ npx skills add huangruiteng/CS-Notes --skill session-optimizer -a claude-code

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

GitHub CLI
$ gh skill install huangruiteng/CS-Notes session-optimizer --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/huangruiteng/CS-Notes.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.trae/openclaw-skills/session-optimizer .claude/skills/session-optimizer && 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
session-optimizer
GitHub stars
4k
Token cost
~257 tokens
SKILL.md length
77 words
Files
2 (incl. scripts)
Skills in repo
38
Repo updated
First seen
Licence
MIT

At a glance

OpenClaw Session 优化器 - 监控 session 状态,在需要时提醒用户切换 session。包括 session 长度监控、已完成任务数量统计、时间显示等功能。

  • Works in 4 steps: Session 状态检查 - 检查当前 session 的运行时间 → 已完成任务统计 - 监控 TODO_ARCHIVE.md 中的归档任务数量 → 自动警告 - 在达到阈值时提醒用户 → …
  • SKILL.md covers 核心功能, 使用方法, 阈值配置 and 状态文件, plus 1 more section
  • Runs Python scripts from its folder; calls python3

What it does

Session Optimizer is an agent skill from huangruiteng/CS-Notes. OpenClaw Session 优化器 - 监控 session 状态,在需要时提醒用户切换 session。包括 session 长度监控、已完成任务数量统计、时间显示等功能。

Its SKILL.md is about 260 tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/session-optimizer.py`).

The licence is MIT.

Example prompts

  • “/session-optimizer”

Requirements

  • Python 3

Workflow steps

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

  1. Session 状态检查 - 检查当前 session 的运行时间
  2. 已完成任务统计 - 监控 TODO_ARCHIVE.md 中的归档任务数量
  3. 自动警告 - 在达到阈值时提醒用户
  4. 历史记录 - 记录 session 切换历史

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    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

Session Optimizer loads about 257 tokens when it runs. Until then it costs about 27 tokens; SKILL.md has 77 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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); the scripts in this folder are not scanned.

SKILL.md

The full file from huangruiteng/CS-Notes at commit d01d8f8, republished under its MIT licence (© huangruiteng). 77 words, ~257 tokens.

Download SKILL.mdSave it as .claude/skills/session-optimizer/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
session-optimizer
description
OpenClaw Session 优化器 - 监控 session 状态,在需要时提醒用户切换 session。包括 session 长度监控、已完成任务数量统计、时间显示等功能。

Session Optimizer Skill

监控 OpenClaw session 状态,在需要时提醒用户切换 session。

核心功能

  1. Session 状态检查 - 检查当前 session 的运行时间
  2. 已完成任务统计 - 监控 TODO_ARCHIVE.md 中的归档任务数量
  3. 自动警告 - 在达到阈值时提醒用户
  4. 历史记录 - 记录 session 切换历史

使用方法

检查 Session 状态
bash
cd /root/.openclaw/workspace/CS-Notes/.trae/openclaw-skills/session-optimizer/scripts/
python3 session-optimizer.py check
查看历史记录
bash
python3 session-optimizer.py history
准备重置 Session
bash
python3 session-optimizer.py reset

阈值配置

  • 已完成任务警告: 2 个任务
  • 已完成任务强烈建议: 3 个任务(超过 3 个建议切换 session)
  • 时间警告: 12 小时
  • 时间强烈建议: 24 小时

状态文件

状态文件保存在:/root/.openclaw/workspace/CS-Notes/.openclaw-session-optimizer.json

重要原则

  • 基于 OpenClaw 现有能力,不侵入内部代码
  • 不修改 OpenClaw 源代码
  • 不修改 OpenClaw 配置文件
  • 仅使用 OpenClaw 已提供的功能
  • 推荐使用 OpenClaw 内置的 /reset 命令
  • 监控 TODO_ARCHIVE.md 中的归档任务数量,超过 3 个建议切换 session

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

Files

SKILL.md and 1 other file (scripts) in .trae/openclaw-skills/session-optimizer of huangruiteng/CS-Notes.

  • SKILL.md
  • scripts/session-optimizer.py

Open the folder on GitHubat commit d01d8f8

Compare with similar skills

Session Optimizer 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.

Session Optimizer compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Session Optimizer this skillhuangruiteng/CS-Notes4k—~257Automated safety check: PassMIT
SQL Optimizationgithub/awesome-copilot40k2 repos~2.3kAutomated safety check: PassMIT
Agent Performance Optimizerruvnet/ruflo74k2 repos~3.6kAutomated safety check: PassMIT
Database Optimizerdavila7/claude-code-templates32k8 repos~2.5kAutomated safety check: PassMIT
Prompt Optimizeraffaan-m/ECC275k2 repos~2.4kAutomated safety check: PassMIT
Cost Optimizeruvnet/ruflo74k1 repos~997Automated safety check: NotesMIT

Similar skills

  • SQL Optimization

    github/awesome-copilot

    Official

    Universal SQL performance optimization assistant for comprehensive query tuning, indexing strategies, and database performance analysis across all SQL databases (MySQL, PostgreSQL, SQL Server…

    40k GitHub starsUsed in 2 repos~2.3k tokens
    DatabasesAuto-check passed
  • Agent skill for performance-optimizer - invoke with $agent-performance-optimizer

    74k GitHub starsUsed in 2 repos~3.6k tokens
    Auto-check passed
  • Database Optimizer

    davila7/claude-code-templates

    Expert database optimizer specializing in modern performance tuning, query optimization, and scalable architectures.

    32k GitHub starsUsed in 8 repos~2.5k tokens
    DatabasesAuto-check passed
  • Prompt Optimizer

    affaan-m/ECC

    分析原始提示,识别意图和差距,匹配ECC组件(技能/命令/代理/钩子),并输出一个可直接粘贴的优化提示。仅提供咨询角色——绝不自行执行任务。触发时机:当用户说“优化提示”、“改进我的提示”、“如何编写提示”、“帮我优化这个指令”或明确要求提高提示质量时。中文等效表达同样触发:“优化prompt”、“改进prompt”、“怎么写prompt”、“帮我优化这个指令”。不触发时机:当用户希望直接执行任…

    275k GitHub starsUsed in 2 repos~2.4k tokens
    DevelopmentAuto-check passed
  • Cost Optimize

    ruvnet/ruflo

    Analyze token usage patterns and recommend cost optimizations with estimated savings

    74k GitHub starsUsed in 1 repo~997 tokens
    AI & LLM EngineeringAuto-check: notes
  • Caveman Optimization Evaluator

    JuliusBrussee/caveman

    Turns a Caveman report-only optimization observation into one minimal code change and a paired baseline evaluation, after the operator picks which to pursue.

    110k GitHub starsUsed in 1 repo~1.2k tokens
    AI & LLM EngineeringAuto-check passed

More from huangruiteng/CS-Notes

All 38 skills in this repo
  • CLI Creator

    huangruiteng/CS-Notes

    Build a composable CLI for Codex from API docs, an OpenAPI spec, existing curl examples, an SDK, a web app, an admin tool, or a local script.

    4k GitHub starsUsed in 2 repos~2.7k tokens
    Auto-check passed
  • Slack

    huangruiteng/CS-Notes

    A skill your agent uses when you need to control Slack from Clawdbot via the slack tool, including reacting to messages or pinning/unpinning items in Slack channels or DMs.

    4k GitHub starsUsed in 10 repos~578 tokens
    Auto-check passed
  • Codex Thread Heartbeat

    huangruiteng/CS-Notes

    Inspect and manage guarded Codex App-native or launchd heartbeats for Codex main control threads.

    4k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Codex Thread Reader

    huangruiteng/CS-Notes

    Locate and read a Codex thread by a codex thread link, thread id, or rollout path across all local CODEXHOME directories (~/.codex, ~/.codex-gpt, ...).

    4k GitHub stars~1.4k tokensUpdated 2 days ago
    Auto-check passed
  • Research Material Scout

    huangruiteng/CS-Notes

    A skill your agent uses when the user asks Codex to research, find learning materials, process "素材:" links, "请你读" / "精读" a material, build a material radar, or use SenSight-like broad information…

    4k GitHub stars~8.6k tokensUpdated 2 days ago
    Auto-check passed
  • GitHub

    huangruiteng/CS-Notes

    Interact with GitHub using the gh CLI. An agent skill from huangruiteng/CS-Notes.

    4k GitHub starsUsed in 28 repos~279 tokens
    Auto-check passed

Questions about Session Optimizer

What does Session Optimizer do?

OpenClaw Session 优化器 - 监控 session 状态,在需要时提醒用户切换 session。包括 session 长度监控、已完成任务数量统计、时间显示等功能。. Session Optimizer is an agent skill from huangruiteng/CS-Notes.

How do I install Session Optimizer in Claude Code?

Run `npx skills add huangruiteng/CS-Notes --skill session-optimizer -a claude-code`. Or copy the skill folder (.trae/openclaw-skills/session-optimizer in huangruiteng/CS-Notes) into .claude/skills/session-optimizer in your project. Claude Code loads it when a task matches its description.

How do I install Session Optimizer in Codex?

Run `npx skills add huangruiteng/CS-Notes --skill session-optimizer -a codex`. Or copy the skill folder (.trae/openclaw-skills/session-optimizer in huangruiteng/CS-Notes) into .agents/skills/session-optimizer in your project. Codex loads it when a task matches its description.

Can I use Session Optimizer 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 huangruiteng/CS-Notes --skill session-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/session-optimizer, .gemini/skills/session-optimizer, .github/skills/session-optimizer and .opencode/skills/session-optimizer in your project.

What does Session Optimizer need to run?

Going by SKILL.md and its folder, Session Optimizer needs Python for the scripts in its folder and the command-line tools its instructions call (python3). Our summary lists: Python 3.

Does Session Optimizer 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 Session Optimizer safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Session Optimizer use?

Session Optimizer 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 Session Optimizer use?

About 257 tokens (SKILL.md is roughly 1k 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 Session Optimizer?

Skills that share tags, products or a category with Session Optimizer: SQL Optimization (github/awesome-copilot, 40k stars), Agent Performance Optimizer (ruvnet/ruflo, 74k stars), Database Optimizer (davila7/claude-code-templates, 32k stars) and Prompt Optimizer (affaan-m/ECC, 275k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Session Optimizer?

huangruiteng (a GitHub user) maintains it in huangruiteng/CS-Notes, which has 4,000 GitHub stars. The repository holds 38 skills in this directory. The repository was last updated on October 6, 2026.

Source: huangruiteng/CS-Notes on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.