Agent skill

Session Usage

by stello-agent in stello-agent/stello

Session 对话单元的设计理念、上下文组装规则、memory / insight 槽位语义、单一 Session 模型与跨 Session 通信模型。

Apache-2.0Auto-check passedAgent Workflows

Install Session Usage

skills CLI
$ npx skills add stello-agent/stello --skill session-usage -a claude-code

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

GitHub CLI
$ gh skill install stello-agent/stello session-usage --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/stello-agent/stello.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/session-usage .claude/skills/session-usage && 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-usage
GitHub stars
112
Token cost
~763 tokens
SKILL.md length
245 words
Files
1
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

Session 对话单元的设计理念、上下文组装规则、memory / insight 槽位语义、单一 Session 模型与跨 Session 通信模型。

  • Tasks that involve Agent memory
  • SKILL.md covers 单一 Session 模型, 上下文组装规则, 三个上下文槽位的语义 and 跨 Session 通信模型, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Session Usage is an agent skill from stello-agent/stello. Session 对话单元的设计理念、上下文组装规则、memory / insight 槽位语义、单一 Session 模型与跨 Session 通信模型。

Its SKILL.md is about 760 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Agent memory. The repository describes itself as: Conversations aren't linear — why should AI chats be? The first open-source conversation topology engine. Auto-branching session trees, inherited memory, star-map visualization… The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Agent memory

Example prompts

  • “/session-usage”

What it can do on your machine

Read from SKILL.md and the folder at commit 3bc9493. 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

    No scripts in the folder and no shell commands in SKILL.md.

    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 Usage loads about 763 tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 245 words of instructions outside code blocks.

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

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from stello-agent/stello at commit 3bc9493, republished under its Apache-2.0 licence (© stello-agent). 245 words, ~763 tokens.

Download SKILL.mdSave it as .claude/skills/session-usage/SKILL.md (or your agent's skills folder).
name
session-usage
description
Session 对话单元的设计理念、上下文组装规则、memory / insight 槽位语义、单一 Session 模型与跨 Session 通信模型。

Session 使用

单一 Session 模型

@stello-ai/session 只对外暴露一种 Session。对话起点是一个 parentId === null 的 root session(由 agent.createSession() 创建),其余通过 agent.forkSession() 挂在父节点下。Root 与 child 在运行时行为完全一致——差异仅在 TopologyNode.parentId。

一棵树可以有任意多 root,互相独立(森林)。

Session 始终是单次 LLM 调用原语:send() 单次调用 + 持久化,tool call 循环由 @stello-ai/core 的 Engine 驱动。


上下文组装规则

这是固定规则,不暴露扩展点(设计决策 #7)。

system prompt → session_identity(label) → insight(若有,消费后清除) → L3 历史 → 当前用户消息
  • system prompt 来自 getSystemPrompt(sessionId),全局每 Session 一份。
  • session_identity 由 label 自动生成的 <session_identity> 系统消息,告知 LLM 当前所在子会话身份。
  • insight 来自 getInsight(sessionId),一次性:被消费后 send() 内置触发 clearInsight。
  • L3 历史 来自 listRecords(sessionId),会先经 removeIncompleteToolCallGroups 净化掉因中断/崩溃残留的不完整 tool call 组。
  • memory 槽位不进入 send() 上下文——它是对外暴露的描述,由 orchestrator-facing 视角消费,详见下文。

当估算 token 数超过 maxContextTokens * 0.8 时,会调用闭包注入的 compressFn,将历史压缩为一段 system 摘要,与近期消息拼接。Session 内部缓存压缩结果,避免每次 send() 都调用 compressFn。


三个上下文槽位的语义

每个 Session 在 SessionStorage 中有三个独立内容槽位:

槽位写入者消费者生命周期
systemPromptfork 合成链固化 / 应用层Session.send() 组装上下文持久(每次 send 读取)
insightOrchestrator(应用层通过 putInsight)Session.send() 消费一次后清除一次性 inbox
memory应用层(通过 consolidate 输出 / 直接 putMemory)Orchestrator-facing 反思层(listSessionDigests)持久(被外部读,不进 send)

关键不变量:memory 不进入 Session 自身的 LLM 上下文。它是面向外部视角的描述——上层可以批量收集所有 Session 的 memory 做反思、规划、调度,再通过 putInsight 把派生的洞察定向回写给目标 Session。Session 自身不感知这个回路。


跨 Session 通信模型

子 Session 之间完全不感知。唯一的跨 Session 信息通道:

所有 Session 的 memory   ──┐
                          ├─→  应用层反思层(任意 LLM)──→  putInsight(targetId, content)
                          ┘
(StelloAgent.listSessionDigests 一次性取齐)
  • 反思层由应用层实现:应用层可以用任意频率、任意 LLM、任意策略对 listSessionDigests 的结果做综合,再把派生 insight 定向回写。
  • insight 是一次性的:每次 reflection 写入新 insight;target session 下一次 send() 注入后自动 clear。重复 reflect 不会累积。
  • memory 是持久的:putMemory 的语义是替换不是追加。

fork() 的语义

Session 层 fork(options) 完成上下文继承:

  • 创建一个新 Session 实例(id 由调用方传入,topology-first)
  • 按 context: 'none' | 'inherit' | ForkContextFn 决定是否拷贝父 session 的 L3 记录
  • 不复制 memory / insight 槽位
  • 一次性继承后两个 Session 互相独立

Engine 在编排层会先创建 TopologyNode(拿到 ID),再调用 session.fork({ id })。调用方通过 agent.forkSession() 一次完成两步,详见 skill fork-design。


LLM Adapter

包内置两个 adapter:OpenAI 兼容协议和 Anthropic 协议(均为 optional peerDependencies)。也可自行实现 LLMAdapter 接口,但 stream() 是必需能力,不支持 complete-only adapter。

Session 始终以 stream 作为底层传输:stream() 实时转发文本增量,send() 使用同一执行器静默消费并聚合完整结果。complete() 仅是 adapter 对直接调用方保留的流式聚合 facade,不得切回 provider 的非流式端点。


ConsolidateFn / CompressFn

  • ConsolidateFn:L3 → memory 的提炼函数,由应用层定义输出格式,框架对 memory 内容格式完全无感知。
  • CompressFn:超 token 阈值时把对话历史压缩为一段摘要,注入到上下文里。
  • 两者都不注入 LLM——应用层通过闭包自行选择 LLM tier(设计决策 #12)。

© stello-agent, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/session-usage of stello-agent/stello.

Open the folder on GitHubat commit 3bc9493

Compare with similar skills

Session Usage 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 Usage compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Session Usage this skillstello-agent/stello112—~763Automated safety check: PassApache-2.0
Coding Agent Session Findercode-yeongyu/oh-my-openagent70k1 repos~2.8kAutomated safety check: PassCustom licence
Claude-Mem Cloud Syncthedotmack/claude-mem98k1 repos~1kAutomated safety check: NotesApache-2.0
Cognee CLI Memory Commandstopoteretes/cognee32k1 repos~2.2kAutomated safety check: NotesApache-2.0
Neat-Freak Knowledge CloseoutKKKKhazix/khazix-skills21k—~1.9kAutomated safety check: PassMIT
Claude-Mem Searchthedotmack/claude-mem98k1 repos~511Automated safety check: PassApache-2.0

Similar skills

  • Coding Agent Session Finder

    code-yeongyu/oh-my-openagent

    Finds, reads and reconstructs past coding-agent sessions across Codex, Claude, OpenCode, Senpi and many other local agent logs.

    70k GitHub starsUsed in 1 repo~2.8k tokens
    Agent WorkflowsAuto-check passed
  • Claude-Mem Cloud Sync

    thedotmack/claude-mem

    Checks claude-mem cloud sync status and guides you through connecting a cmem.ai Pro account without the sync token ever passing through the chat.

    98k GitHub starsUsed in 1 repo~1k tokens
    Agent WorkflowsAuto-check: notes
  • Cognee CLI Memory Commands

    topoteretes/cognee

    Drives cognee from the terminal with remember, recall, forget and improve memory commands, dataset and config management and database migrations.

    32k GitHub starsUsed in 1 repo~2.2k tokens
    Agent WorkflowsAuto-check: notes
  • Neat-Freak Knowledge Closeout

    KKKKhazix/khazix-skills

    Brings project docs, agent rule files, authorized memory and leftover workspace files back in line with what the code and runtime actually do at the end of a work session.

    21k GitHub stars~1.9k tokensUpdated 6 days ago
    Agent WorkflowsAuto-check passed
  • Claude-Mem Search

    thedotmack/claude-mem

    Searches the user's persistent cross-session memory for timestamped observations synthesized from past agent sessions on cmem.ai.

    98k GitHub starsUsed in 1 repo~511 tokens
    Agent WorkflowsAuto-check passed
  • Beads Task Memory

    gastownhall/beads

    Tracks multi-session work with dependencies in the bd issue tracker so the agent can find ready tasks and recover its context after conversation compaction.

    28k GitHub stars~1.2k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from stello-agent/stello

All 12 skills in this repo
  • Fork Design

    stello-agent/stello

    Fork 机制完整说明。覆盖 ForkProfile 与 EngineForkOptions 的字段对齐、四层 fallback 合成链(sessionDefaults → parent → profile → forkOptions)、systemPrompt 合成三种模式、skills 三态语义、持久化边界(SerializableSessionConfig 只固化…

    112 GitHub stars~2k tokensUpdated 2 mo ago
    Auto-check passed
  • LLM Call Sites

    stello-agent/stello

    Stello 框架内所有 LLM 调用位置的消息结构速查。覆盖 Session 对话、compress、consolidate;应用层 reflection 调用由 orchestrator 自行决定。

    112 GitHub stars~793 tokensUpdated 2 mo ago
    Auto-check passed
  • Stello Agent Creation

    stello-agent/stello

    StelloAgent 创建配置教程。完整说明 createStelloAgent 的每个配置项,包含 sessionDefaults、storage、tools、skills、forkProfiles、session 层接入、orchestration 等。

    112 GitHub stars~3.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Stello Agent Usage

    stello-agent/stello

    StelloAgent 运行时使用教程。覆盖 Session 生命周期、createSession、turn/stream 对话、fork 配置合成链、orchestrator-facing 数据 SDK、runtime 管理、热更新等运行时 API。

    112 GitHub stars~2.7k tokensUpdated 2 mo ago
    Auto-check passed
  • Stello Usage

    stello-agent/stello

    Stello 仓库总览入口。快速理解各包的关系、推荐入口、编排模型、单一 Session 模型. An agent skill from stello-agent/stello.

    112 GitHub stars~547 tokensUpdated 2 mo ago
    Auto-check passed
  • Storage Design

    stello-agent/stello

    存储接口的设计原则、SessionMeta 与 TopologyNode 解耦、上下文槽位、单一 SessionStorage 接口。触发条件:理解或实现 SessionStorage / SessionTree。

    112 GitHub stars~871 tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about Session Usage

What does Session Usage do?

Session 对话单元的设计理念、上下文组装规则、memory / insight 槽位语义、单一 Session 模型与跨 Session 通信模型。. Session Usage is an agent skill from stello-agent/stello.

When should I use Session Usage?

Session Usage fits situations like: tasks that involve Agent memory.

How do I install Session Usage in Claude Code?

Run `npx skills add stello-agent/stello --skill session-usage -a claude-code`. Or copy the skill folder (.agents/skills/session-usage in stello-agent/stello) into .claude/skills/session-usage in your project. Claude Code loads it when a task matches its description.

How do I install Session Usage in Codex?

Run `npx skills add stello-agent/stello --skill session-usage -a codex`. Or copy the skill folder (.agents/skills/session-usage in stello-agent/stello) into .agents/skills/session-usage in your project. Codex loads it when a task matches its description.

Can I use Session Usage 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 stello-agent/stello --skill session-usage -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-usage, .gemini/skills/session-usage, .github/skills/session-usage and .opencode/skills/session-usage in your project.

What does Session Usage need to run?

SKILL.md names no scripts, command-line tools or credentials: Session Usage is instructions for the agent only.

Does Session Usage 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 Usage 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. Review the folder before installing.

What licence does Session Usage use?

Session Usage is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Session Usage use?

About 763 tokens (SKILL.md is roughly 3.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 Usage?

Skills that share tags, products or a category with Session Usage: Coding Agent Session Finder (code-yeongyu/oh-my-openagent, 70k stars), Claude-Mem Cloud Sync (thedotmack/claude-mem, 98k stars), Cognee CLI Memory Commands (topoteretes/cognee, 32k stars) and Neat-Freak Knowledge Closeout (KKKKhazix/khazix-skills, 21k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Session Usage?

stello-agent (a GitHub organization) maintains it in stello-agent/stello, which has 112 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on July 24, 2026.

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