session-health SKILL.md skillA

session-health from ninjasln-labs/agent-skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add ninjasln-labs/agent-skills/session-health@v1.0.3

Pins v1.0.3 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
ninjasln-labs/agent-skills
Path
session-health/SKILL.md
Versions recorded
4
Latest version
v1.0.3, committed Sep 22, 2026
First version recorded
Aug 3, 2026
Size
15,281 bytes
Repository stars
3
License
none declared

Session Health: assess the current AI coding tool session — context compaction/condensation ratio, message count, context occupation cost, work nature, recoverability (git/handoff/runtime), and token economics — to judge continue vs new-session. Reads tool session storage read-only. Use when the user mentions context compaction, starting a new session, high context overhead, or long-session continuation (e.g. "go" / "keep going"). NOT for: auditing skill descriptions, full-codebase…

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# 会话健康度评估(Session Health)
在长会话中评估「继续 vs 新开」的得失,判断是否该新开会话。**只评估不修改**任何会话文件。
核心原则:**压缩比例高 ≠ 该切换**;**窗口占比低 ≠ 经济无忧**。决策 = 继续成本(容量 + 质量 + 每轮 token 经济)vs 切换成本(丢失早期精确细节 + 交接轮次)的权衡。
## 何时使用
- **被动**:用户提到「压缩 / 新开会话 / 上下文开销 / context」时,立即完整评估。
- **主动**:长会话中用户持续推进(go / 继续 / 按计划推进)时,顺带检查一次;仅在**状态明显恶化或达到阈值**时提醒,否则一句「会话健康(压缩 x%)」带过。
## 硬约束
1. **只读评估**——不得修改任何工具的会话存储(Deep Code:`~/.deepcode/projects/`;Cursor:`~/.cursor/`;其他工具按适配层定位)。会话 JSONL / SQLite / 索引 / 快照一律只读。
2. **不夸大、不虚构**——数字来自实际文件统计;查不到就说明查不到,不猜。
3. **不机械建议切换**——必须评估工作性质与可恢复性;依赖早期内容的工作(重构/优化)即使压缩高也未必该切换。
4. **未达阈值不展开**——健康时一句话确认即可,完整报告只在达到阈值或用户要求时给。
5. **信号缺失走降级,不装精确**——工具适配层声明「能测什么、不能测什么」;缺失维度按降级规则处理(见「信号缺失降级规则」),不因缺数据默认健康或默认不健康。
## 工具适配层(数据来源入口)
本技能不硬编码任何工具的数据格式——每工具的读取方式集中在 **工具适配层**:
- **`references/tool-data-sources.md`**——已实现的工具适配节(Deep Code / Cursor):会话目录定位、各信号读取命令、恢复能力入口。
- **`references/tool-adapter-template.md`**——新工具接入模板:按模板 + 探测流程为新工具生成适配节。
> **防双源**:SKILL.md 不写具体数据命令(命令会随工具版本漂移——见刷新机制);命令一律只存在于 `references/tool-data-sources.md`。本页只留稳定方法论。
### 工具探测(确定当前跑在哪个工具上)
按以下优先级确认,取第一个可行的:
1. 会话上下文/环境变量已显式说明当前工具(如 agent 自知所在工具)→ 直接用。
2. 探测各工具会话存储目录,取**最近有写入**的那个(`ls -td` 按 mtime 排序比对)。
3. 仍不确定 → AskUserQuestion 问用户当前在哪个工具。
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add ninjasln-labs/agent-skills/session-health@sha256:35acb0dc43339086

The line at the top of this page pins the label v1.0.3, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_xoyz5jjndie763ih.svg)](https://markdownregistry.com/a/art_xoyz5jjndie763ih)

1 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 4 versions of this file, between Aug 3, 2026 and Sep 22, 2026, about one every 17 days.

versioncommittedcommitsizeaudit
v1.0.3 latest2026-09-22 75c75c0 15,281 BA view · diff
v1.0.02026-09-18 cbc6719 15,204 BA view · diff
git:20260813.1cc67b32026-08-13 1cc67b3 15,140 BA view · diff
git:20260803.cf548c92026-08-03 cf548c9 15,164 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (15281 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

ninjasln-labs/agent-skills · 3 stars · license none declared · pushed 2026-10-05 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_xoyz5jjndie763ih
GET https://markdownregistry.com/api/v1/resolve?ref=ninjasln-labs/agent-skills/session-health
GET https://markdownregistry.com/api/v1/blob/35acb0dc433390868a3416446c75e3f0bdbe8f2da3ed6054044af7b42abf16d5

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from ninjasln-labs/agent-skills

accessibility-auditor SKILL.md skill
ninjasln-labs/agent-skills · accessibility-auditor/SKILL.md · Comprehensive WCAG 2.1 AA compliance testing combining automated axe-core scans with manual keyboard navigation and…
v1.2.0 · audit A · 3 stars
agent-dispatch SKILL.md skill
ninjasln-labs/agent-skills · agent-dispatch/SKILL.md · User-invoked only: run it when the user explicitly asks to hand work to an external agent CLI, never on your own…
v1.5.6 · audit A · 3 stars
api-contract-validator SKILL.md skill
ninjasln-labs/agent-skills · api-contract-validator/SKILL.md · Validate API responses against OpenAPI/Swagger specifications, JSON Schema definitions, and GraphQL schemas to prevent…
v1.1.1 · audit A · 3 stars
architecture-patterns SKILL.md skill
ninjasln-labs/agent-skills · architecture-patterns/SKILL.md · Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven…
v1.2.0 · audit A · 3 stars
audit-item SKILL.md skill
ninjasln-labs/agent-skills · audit-item/SKILL.md · Track audit/review findings as numbered issue files (audit-items/NNN-slug.md, under the directory the project keeps…
v1.1.0 · audit A · 3 stars
autonomous-investigation SKILL.md skill
ninjasln-labs/agent-skills · autonomous-investigation/SKILL.md · The evidence protocol behind recurring competitive and market investigation skills — market scans, competitive…
v1.2.0 · audit A · 3 stars
battle-card-builder SKILL.md skill
ninjasln-labs/agent-skills · battle-card-builder/SKILL.md · Research and draft a competitive battle card from public evidence — every claim labeled and sourced. Use when a rep…
v1.1.1 · audit A · 3 stars
cicd-pipeline SKILL.md skill
ninjasln-labs/agent-skills · cicd-pipeline/SKILL.md · Configure testing in CI/CD pipelines for GitHub Actions, Jenkins, and GitLab CI: shards, parallelization, wait-on…
v1.2.0 · audit A · 3 stars
code-review SKILL.md skill
ninjasln-labs/agent-skills · code-review/SKILL.md · Review the changes since a fixed point (commit, branch, tag, or merge-base) along two axes — Standards (does the code…
v1.1.0 · audit A · 3 stars
codebase-design SKILL.md skill
ninjasln-labs/agent-skills · codebase-design/SKILL.md · Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find…
v1.0.1 · audit A · 3 stars
company-intel SKILL.md skill
ninjasln-labs/agent-skills · company-intel/SKILL.md · Research a company, industry, or competitor set using web search and seven analytical lenses. Use when you need…
v1.1.1 · audit A · 3 stars
competitive-analysis-process SKILL.md skill
ninjasln-labs/agent-skills · competitive-analysis-process/SKILL.md · Orchestrate a complete competitive analysis end to end: market landscape, product-level comparison, ability to fulfill…
v1.1.1 · audit A · 3 stars

Every file in ninjasln-labs/agent-skills

Other files named session-health

session-health SKILL.md skill
eltmon/overdeck · sync-sources/skills/session-health/SKILL.md · Detect and clean up stuck or corrupted Claude Code sessions. Use when agents crash with stack overflow, when sessions…
git:20260522.817c2c7 · audit A · 31 stars

Browse by kind, by grade A, or by owner.