Agent skill

Knowledge Session State And Context

by echoVic in echoVic/blade-code

覆盖会话状态所有权、持久事件、读侧投影、历史分叉/回退、活动轮次恢复及模型上下文压缩. An agent skill from echoVic/blade-code.

MITAuto-check passedAgent Workflows

Install Knowledge Session State And Context

skills CLI
$ npx skills add echoVic/blade-code --skill knowledge-session-state-and-context -a claude-code

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

GitHub CLI
$ gh skill install echoVic/blade-code knowledge-session-state-and-context --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/echoVic/blade-code.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.trae/knowledges/session-state-and-context .claude/skills/knowledge-session-state-and-context && 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
knowledge-session-state-and-context
GitHub stars
180
Token cost
~1.2k tokens
SKILL.md length
217 words
Files
1
Skills in repo
38
Repo updated
First seen
Licence
MIT

At a glance

覆盖会话状态所有权、持久事件、读侧投影、历史分叉/回退、活动轮次恢复及模型上下文压缩. An agent skill from echoVic/blade-code.

  • Tasks that involve Session handoff
  • SKILL.md covers Module Structure, Gotchas, Architecture and Decisions, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Tasks that involve Event-driven systems

What it does

Knowledge Session State And Context is an agent skill from echoVic/blade-code. 覆盖会话状态所有权、持久事件、读侧投影、历史分叉/回退、活动轮次恢复及模型上下文压缩。 适用于修改 Session 生命周期、JSONL/CQRS、resume/fork/rewind、steering、Token 预算或项目记忆。 不含 Agent 决策循环(见 ../agent-execution-and-orchestration/)和工具执行机制(见 ../tool-and-automation-platform/)。 关键词:SessionRuntime, SessionService, PersistentStore, SessionEventLog, JSONL, CQRS, compaction, rewind, steering。

Its SKILL.md is about 1.2k 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 Session handoff and Event-driven systems. The repository describes itself as: AI-powered CLI coding agent with 20+ built-in tools, MCP support, and multi-model providers. The licence is MIT.

When your agent uses it

  • Tasks that involve Session handoff
  • Tasks that involve Event-driven systems

Example prompts

  • “/knowledge-session-state-and-context”

What it can do on your machine

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

Knowledge Session State And Context loads about 1.2k tokens when it runs. Until then it costs about 91 tokens; SKILL.md has 217 words of instructions outside code blocks.

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

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 echoVic/blade-code at commit 30f8684, republished under its MIT licence (© echoVic). 217 words, ~1,216 tokens.

Download SKILL.mdSave it as .claude/skills/knowledge-session-state-and-context/SKILL.md (or your agent's skills folder).
name
knowledge-session-state-and-context
description
覆盖会话状态所有权、持久事件、读侧投影、历史分叉/回退、活动轮次恢复及模型上下文压缩。 适用于修改 Session 生命周期、JSONL/CQRS、resume/fork/rewind、steering、Token 预算或项目记忆。 不含 Agent 决策循环(见 ../agent-execution-and-orchestration/)和工具执行机制(见 ../tool-and-automation-platform/)。 关键词:SessionRuntime, SessionService, PersistentStore, SessionEventLog, JSONL, CQRS, compaction, rewind, steering。

Module Structure

该域负责把一次会话的权威事实、活动运行时与各端读模型分开:持久事实进入 JSONL,运行时持有互斥与恢复状态,TUI/Web/ACP 从相同事实投影,模型上下文则可在不破坏完整历史的前提下压缩。

Directory Layout
  • packages/cli/src/context/:事件模型、持久存储、上下文组装、压缩与 Token 预算
  • packages/cli/src/agent/runtime/:Session 所有权、活动轮次 mailbox、恢复和私有 artifact
  • packages/cli/src/services/SessionService.ts:会话目录、加载、分叉、回退、归档与导出编排
  • packages/cli/src/services/SessionInteractionService.ts:持久交互请求、响应和崩溃恢复
  • packages/cli/src/memory/:跨会话项目记忆与压缩后巩固
Key Entry Points
  • SessionRuntime.initialize() in packages/cli/src/agent/runtime/SessionRuntime.ts:获取会话所有权并执行恢复
  • PersistentStore in packages/cli/src/context/storage/PersistentStore.ts:将领域动作转换为有序事件
  • SessionService in packages/cli/src/services/SessionService.ts:面向 CLI、Web 与 ACP 的持久会话服务
  • CompactionService.compact() in packages/cli/src/context/CompactionService.ts:生成并约束模型可见替换上下文

Gotchas

  • sessionId 不是全局身份;省略 projectPath 的查找可能因多个工作区同名而拒绝,跨端路由必须保持 sessionId + canonical projectPath 复合身份 (packages/cli/src/services/SessionService.ts, packages/cli/src/server/sessionRef.ts)
  • Runtime、TUI store、Web store 和 SQLite 都不是持久真相,修复恢复问题时必须从 materialized JSONL 重新推导,不能把某个内存快照写回当作权威 (packages/cli/src/context/storage/PersistentStore.ts, packages/cli/src/context/storage/sqlite/projection.ts)
  • rewind 与 compaction 都保留原始 transcript:前者通过 session_rewound 改变有效事件,后者通过 replacement checkpoint 改变模型可见上下文;直接截断 JSONL 会同时破坏审计、导出和断点续传 (packages/cli/src/services/sessionRewind.ts, packages/cli/src/services/SessionService.ts)
  • durable inbox、prompt artifact 等 sidecar 不是独立会话真相;它们必须通过 transcript 中的 acknowledgement、message metadata 或生命周期事件对账后才能删除或重放 (packages/cli/src/agent/runtime/DurableSteeringInbox.ts, packages/cli/src/agent/runtime/UserPromptArtifactStore.ts)
  • 会话恢复必须先取得 SessionLease 再修复 orphan 进程、工具调用和 turn;颠倒顺序会让两个进程同时“恢复”同一条父链 (packages/cli/src/agent/runtime/SessionRuntime.ts, packages/cli/src/agent/runtime/SessionLease.ts, git:46145c53)

Architecture

  • 写路径为 SessionRuntime/SessionService -> ContextManager/PersistentStore -> SessionEventLog -> JSONLStore,事件落盘并取得 seq 后才允许发布给各 surface (packages/cli/src/agent/runtime/SessionRuntime.ts, packages/cli/src/context/ContextManager.ts, packages/cli/src/context/events/SessionEventLog.ts)
  • 读路径有三种不同投影:完整可见历史供 UI/导出,replacement checkpoint 之后的上下文供模型,SQLite materialization 供目录与搜索;三者不能互相替代 (packages/cli/src/services/SessionService.ts, packages/cli/src/context/storage/sqlite/projection.ts)
  • 活动轮次采用“双账本”恢复:inbox 保存尚未确认的输入,JSONL 保存 turn/tool/interaction 事实;启动时通过 message ID 和终态 receipt 对账形成 exactly-once continuation (packages/cli/src/agent/runtime/DurableSteeringInbox.ts, packages/cli/src/context/storage/PersistentStore.ts)
  • 跨端一致性依赖同一事件语义而非同一 UI reducer:TUI 使用共享 conversation reducer,Web 消费 SSE 投影,ACP 消费顺序化 update,但都以已提交 JSONL 生命周期为恢复边界 (packages/cli/src/store/slices/sessionSlice.ts, packages/cli/web/src/store/session/handlers/eventHandlers.ts, packages/cli/src/acp/Session.ts)

Decisions

  • 项目从多套 surface 事件系统收敛为 append-only committed events 加 ephemeral deltas,以换取可重放、可断点续传和持久化先于可见性的统一契约 (packages/cli/src/context/events/SessionEventLog.ts, git:c776d496)
  • SQLite 被刻意定义为可删除、可重建、失败开放的读缓存,而不是第二写模型,因此绕过 event log 的历史写入仍能被拉取式同步捕获 (packages/cli/src/context/storage/sqlite/projection.ts, git:1f856671)
  • ContextManager 已从状态容器收缩为 PersistentStore 的薄门面,压缩、过滤和记忆均由独立服务拥有,新增上下文行为不应重新塞回 ContextManager (packages/cli/src/context/ContextManager.ts, git:a074815b)

Conventions

  • 需要“只允许一个胜者”的生命周期转换使用 commitValidated 或 commitValidatedBatch,在同一 per-file 队列内读取最新事实、校验并追加 (packages/cli/src/context/events/SessionEventLog.ts, packages/cli/src/context/storage/JSONLStore.ts)
  • 所有恢复与目录聚合先调用 materializeSessionEvents(),确保历史中的多次 rewind 按顺序生效后再计算 turn、interaction、搜索或 metadata (packages/cli/src/services/sessionRewind.ts, packages/cli/src/services/SessionService.ts)
  • UI 可见性、模型可见性和持久性是三个独立维度;例如 token handoff 可持久但不对客户端广播,delta 可广播但不持久 (packages/cli/src/context/TokenBudgetHandoff.ts, packages/cli/src/context/events/SessionEventLog.ts)

Child Knowledge Nodes

  • ./durable-transcript-and-event-projection/SKILL.md:修改 JSONL 提交、seq、replay、SQLite 或 TUI/Web 事件投影时进入
  • ./session-catalog-fork-rewind-and-export/SKILL.md:修改目录分页、归档、恢复、分叉、回退、搜索或 Markdown 导出时进入
  • ./active-turn-interactions-and-recovery/SKILL.md:修改 turn 互斥、steering、持久交互、崩溃恢复、旁路问答或用户 Shell 时进入
  • ./context-compaction-token-budget-and-memory/SKILL.md:修改上下文组装、压缩策略、Token handoff、工具结果预算或 Auto Memory 时进入

© echoVic, MIT. 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 .trae/knowledges/session-state-and-context of echoVic/blade-code.

Open the folder on GitHubat commit 30f8684

Compare with similar skills

Knowledge Session State And Context 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.

Knowledge Session State And Context compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Knowledge Session State And Context this skillechoVic/blade-code180—~1.2kAutomated safety check: PassMIT
CodemanArk0N/Codeman784—~13kAutomated safety check: NotesMIT
Session Managementjosstei/maestro-orchestrate465—~3.5kAutomated safety check: PassApache-2.0
Adversarial Beampproenca/dot-skills214—~2.2kAutomated safety check: PassMIT
Orca CLIstablyai/orca87k2 repos~593Automated safety check: PassMIT
Beads Task Memorygastownhall/beads28k—~1.2kAutomated safety check: PassMIT

Similar skills

  • Codeman

    Ark0N/Codeman

    Drive Codeman, the session manager this agent is running inside, over its HTTP API: list sessions, start worker sessions, send them prompts, block until they finish (wait / wait-output /…

    784 GitHub stars~13k tokensUpdated today
    Agent WorkflowsAuto-check: notes
  • Session Management

    josstei/maestro-orchestrate

    Manages orchestration session state, tracking, and resumption

    465 GitHub stars~3.5k tokensUpdated today
    Agent WorkflowsAuto-check passed
  • Adversarial Beam

    pproenca/dot-skills

    A skill your agent uses to gate Elixir/OTP systems on BEAM runtime architecture with a pass/fail adversarial review — a single blind reviewer subagent judges a diff or file set against 23 decidable…

    214 GitHub stars~2.2k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Orca CLI

    stablyai/orca

    Operate Orca-managed worktrees, folder contexts, terminals, repos, automations, artifacts, skill sharing, worktree comments, and Orca's embedded browser…

    87k GitHub starsUsed in 2 repos~593 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
  • Searches past Claude Code, Codex and Cursor sessions and summarizes what was worked on, tried or decided, using extraction scripts instead of reading raw logs.

    24k GitHub stars~3.1k tokensUpdated today
    Agent WorkflowsAuto-check passed

More from echoVic/blade-code

All 38 skills in this repo
  • Base64 Parser

    echoVic/blade-code

    Base64 编解码工具,支持编码/解码文本、JSON、二进制文件,自动检测格式,支持批量处理. An agent skill from echoVic/blade-code.

    180 GitHub stars~545 tokensUpdated 10 days ago
    Auto-check: notes
  • Code Review

    echoVic/blade-code

    Review frontend code for best practices, bugs, and improvements.

    180 GitHub stars~377 tokensUpdated 10 days ago
    Auto-check: notes
  • GitHub Explorer

    echoVic/blade-code

    Explore and summarize popular GitHub projects. An agent skill from echoVic/blade-code.

    180 GitHub stars~434 tokensUpdated 10 days ago
    Auto-check passed
  • 覆盖 Session 级 LSP 配置快照、stdio 进程、文档同步、语义查询、诊断回注、崩溃恢复 和子 Session 继承。进入条件:新增语言服务器、修改 LSP 工具、排查诊断缺失/重复、 处理 worktree 或 ACP 差异、修复进程泄漏或 transport 代际问题。不包含:VS Code 扩展桥接(见…

    180 GitHub stars~1.9k tokensUpdated 10 days ago
    Auto-check passed
  • 覆盖 SkillRegistry、SKILL.md 延迟加载、自定义命令 Markdown 解析、来源覆盖、插件 命名空间、Session 快照和模型/用户调用入口。进入条件:新增 Skill 或命令字段、调整 发现优先级、调试 /command 或 Skill 工具、修改 Prompt 元数据或消费者集成。不包含: 插件安装生命周期(见…

    180 GitHub stars~2.1k tokensUpdated 10 days ago
    Auto-check passed
  • Covers 领域能力如何包装成内置工具、getBuiltinTools 的 Session 依赖注入、ToolSearch 延迟激活,以及 Goal/Task/Team/Plan/Skill/LSP/MCP/Web/Config/Worktree 适配边界。

    180 GitHub stars~2.1k tokensUpdated 10 days ago
    Auto-check passed

Questions about Knowledge Session State And Context

What does Knowledge Session State And Context do?

覆盖会话状态所有权、持久事件、读侧投影、历史分叉/回退、活动轮次恢复及模型上下文压缩. An agent skill from echoVic/blade-code. Knowledge Session State And Context is an agent skill from echoVic/blade-code.

When should I use Knowledge Session State And Context?

Knowledge Session State And Context fits situations like: tasks that involve Session handoff; tasks that involve Event-driven systems.

How do I install Knowledge Session State And Context in Claude Code?

Run `npx skills add echoVic/blade-code --skill knowledge-session-state-and-context -a claude-code`. Or copy the skill folder (.trae/knowledges/session-state-and-context in echoVic/blade-code) into .claude/skills/knowledge-session-state-and-context in your project. Claude Code loads it when a task matches its description.

How do I install Knowledge Session State And Context in Codex?

Run `npx skills add echoVic/blade-code --skill knowledge-session-state-and-context -a codex`. Or copy the skill folder (.trae/knowledges/session-state-and-context in echoVic/blade-code) into .agents/skills/knowledge-session-state-and-context in your project. Codex loads it when a task matches its description.

Can I use Knowledge Session State And Context 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 echoVic/blade-code --skill knowledge-session-state-and-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/knowledge-session-state-and-context, .gemini/skills/knowledge-session-state-and-context, .github/skills/knowledge-session-state-and-context and .opencode/skills/knowledge-session-state-and-context in your project.

What does Knowledge Session State And Context need to run?

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

Does Knowledge Session State And Context 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 Knowledge Session State And Context 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 Knowledge Session State And Context use?

Knowledge Session State And Context 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 Knowledge Session State And Context use?

About 1.2k tokens (SKILL.md is roughly 4.9k 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 Knowledge Session State And Context?

Skills that share tags, products or a category with Knowledge Session State And Context: Codeman (Ark0N/Codeman, 784 stars), Session Management (josstei/maestro-orchestrate, 465 stars), Adversarial Beam (pproenca/dot-skills, 214 stars) and Orca CLI (stablyai/orca, 87k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Knowledge Session State And Context?

echoVic (a GitHub user) maintains it in echoVic/blade-code, which has 180 GitHub stars. The repository holds 38 skills in this directory. The repository was last updated on September 27, 2026.

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