knowledge-runtime-state-bootstrap-and-observability

knowledge-runtime-state-bootstrap-and-observability is a skill for Claude Code, Codex from echoVic/blade-code. It costs 198 tokens per session (3,741 once invoked), scanned A, a copy of knowledge-session-state-and-context, MIT.

Shared runtime state and diagnostics for the command line, server, web app, agents, tools, and extensions. It tracks working directories, project roots, session IDs, logs, environment details, and registered projects.

In plain words
What is it for?
Use it when changing startup order, isolating workspace state, accessing shared UI state, adding logs or runtime diagnostics, identifying versions and sessions, or selecting and registering projects.
Why use it?
It prevents concurrent operations from using the wrong directory or shared state and makes runtime behavior easier to inspect across different application surfaces.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it when changing startup order, isolating workspace state, accessing shared UI state, adding logs or runtime diagnostics, identifying versions and sessions, or selecting and registering projects.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/echovic/blade-code/runtime-state-bootstrap-and-observability
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add echoVic/blade-code --skill runtime-state-bootstrap-and-observability
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for knowledge-runtime-state-bootstrap-and-observability

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/blade-code/runtime-state-bootstrap-and-observability/github.svg)](https://agentmods.dev/skills/echovic/blade-code/runtime-state-bootstrap-and-observability)
Your own site
<a href="https://agentmods.dev/skills/echovic/blade-code/runtime-state-bootstrap-and-observability"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/runtime-state-bootstrap-and-observability/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for knowledge-runtime-state-bootstrap-and-observability

Your own site · 80×15
<a href="https://agentmods.dev/skills/echovic/blade-code/runtime-state-bootstrap-and-observability"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/runtime-state-bootstrap-and-observability.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 198 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,741 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 89% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00198 $0.03741
Opus 5.5 $0.00079 $0.01496
Sonnet 5.5 $0.00040 $0.00748
Haiku 4.5 $0.00020 $0.00374

Measured 1mo ago against content hash 24c01d1a1eb3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

knowledge-runtime-state-bootstrap-and-observability scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

89% identical to knowledge-session-state-and-context — 146 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.trae/knowledges/workspace-policy-and-shared-foundations/runtime-state-bootstrap-and-observability/SKILL.md · 129 lines

How it starts

The opening of the file, as written. The whole thing — 129 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Module Structure

该组件提供各运行表面共享的进程级基础状态与观测入口;它区分启动目录、当前工作区和稳定项目根,并把 UI 状态、日志、环境探测及项目发现收敛到可被 Agent、CLI、Server、工具和扩展复用的 API。

Directory Layout

  • packages/cli/src/bootstrap/state.ts — 惰性初始化的 cwd、originalCwd 与 projectRoot 三态
  • packages/cli/src/store/ — React 与非 React 共用的 Zustand Store、切片、类型和细粒度选择器
  • packages/cli/src/logging/ — 分类 JSONL 日志与独立流式调试日志
  • packages/cli/src/utils/cwd.ts — 基于 AsyncLocalStorage 的并发 cwd 覆写
  • packages/cli/src/utils/environment.ts — 项目根发现、环境提示和目录概览
  • packages/cli/src/utils/packageInfo.ts — 源码与打包布局兼容的运行时包信息
  • packages/cli/src/utils/sessionId.ts — 可安全用于存储路径的 Session ID
  • packages/cli/src/services/DirectoryPicker.ts — macOS、Windows 与 Linux 原生目录选择
  • packages/cli/src/services/ProjectRegistry.ts — 规范化项目路径的持久绑定注册表

Key Entry Points

  • getCwd() / runWithCwdOverride() — 获取当前执行上下文的 workspace,或为异步调用链临时覆写
  • vanillaStore / useBladeStore() / ensureStoreInitialized() — 共享状态实例、React 订阅与幂等配置初始化
  • createLogger() / setLoggerSessionId() / streamDebug() — 分类日志、会话日志路由与流式专项诊断
  • getEnvironmentContext() / getVersion() / createSessionId() — 构造环境上下文、读取运行版本和生成存储安全标识
  • NativeDirectoryPicker.pick() / ProjectRegistry.list() — 选择本机目录并读取规范化项目集合

API Surface

Workspace Location

  • getCwd() — 优先返回当前 AsyncLocalStorage 覆写,否则返回进程级 cwd
  • runWithCwdOverride(cwd, fn) — 在同步及后续异步调用链内隔离 workspace
  • getOriginalCwd() — 返回 CLI 被调用时的原始目录,用于解析用户传入的相对路径
  • getProjectRoot() — 返回启动后保持稳定的项目标识根
  • findProjectRoot(startDir) / setCwd(newPath, relativeTo?) — 发现工作区根并更新规范化的全局 cwd

Shared Store

  • useBladeStore(selector) — React 对共享 Vanilla Store 的细粒度订阅入口
  • getState() — Agent、服务与命令读取当前 Store 快照
  • sessionActions() / appActions() / configActions() — 面向不同状态域的动作入口
  • ensureStoreInitialized() — 以共享 Promise 合并并发配置初始化
  • useCurrentStreamingBuffer() — 以浅比较订阅流式行缓冲、尾部、计数和版本

Observability

  • createLogger(category, options?) — 创建分类日志器,文件输出与终端调试过滤相互独立
  • Logger.setGlobalDebug(config) — 动态设置全局终端日志开关或分类过滤
  • setLoggerSessionId(sessionId) — 切换后续 JSONL 日志的文件名
  • streamDebug(source, message, data?) — 向独立流式诊断文件追加记录且不向调用方抛错
  • getEnvironmentContext(options?) — 组装系统、Git、脚本和目录信息供系统提示使用

Read the full file on GitHub · 129 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 129 lines · 198 tokens per session scan A 24c01d1a1eb3

Subscribe to this mod's changes

knowledge-runtime-state-bootstrap-and-observability is a skill published in the GitHub repository echoVic/blade-code (180 stars, last pushed 10d ago), licensed MIT. It adds 198 tokens to every session and 3,741 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 89% identical to knowledge-session-state-and-context, differing in 146 lines, and is treated as a copy.

Related

Other skills, from other repositories

smiles-validation

Strict SMILES validation, structural comparison, and modification verification. Catches invalid LLM-generated molecules.

synthetic-sciences/openscience · 24 tokens

delegation

Delegates independent work to worker agents through the Task tool, choosing between the explore scout and the ml, biology, physics, chemistry and data specialists, writing a self-contained brief for a worker that cannot see the conversation, setting boundaries on files and compute, using two independent annotators…

synthetic-sciences/openscience · 118 tokens

tricorder-cli

Full CLI reference for the tricorder daemon (build diagnostics, test results, source lookup, eval comments, logs). This is the fallback invoked by the tricorder skill when the tricorder-mcp MCP tools aren't available or aren't working — invoke tricorder first; it decides whether this is needed.

tweag/tricorder · 67 tokens

email

Manage emails via Himalaya CLI. Use when the user wants to read, send, search, or organize emails. Triggers on "email", "inbox", "send email", "check mail", "reply to", "forward", or mentions of Gmail, Outlook, iCloud, Proton Mail.

lvndry/jazz · 63 tokens

install-jazz-github-action

Set up Jazz as a GitHub Action for automated PR code review and on-demand /jazz PR assistance. Use when the user asks to add Jazz to CI, create a GitHub Action workflow, set up PR review automation, enable /jazz commands on PRs, or integrate Jazz with GitHub.

lvndry/jazz · 69 tokens

create-workflow

Create Jazz workflow automation files (WORKFLOW.md). Use this for scheduling Jazz agents to run recurring tasks. For OS-level scripts/commands, use create-system-routine.

lvndry/jazz · 38 tokens