Agent skill

Headroom

by momori777 in momori777/Artemis

SmartCrusher + CCR context compression — crunch large JSON arrays, tool outputs, and search results to save tokens.

MITAuto-check passedAI & LLM Engineering

Install Headroom

skills CLI
$ npx skills add momori777/Artemis --skill headroom -a claude-code

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

GitHub CLI
$ gh skill install momori777/Artemis headroom --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/momori777/Artemis.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/headroom .claude/skills/headroom && 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
headroom
GitHub stars
380
Token cost
~562 tokens
SKILL.md length
137 words
Files
4
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

SmartCrusher + CCR context compression — crunch large JSON arrays, tool outputs, and search results to save tokens.

  • Works in 5 steps: First/Last items — pagination context +… → Error items — 100% preserved → Statistical outliers — > 2 std from mean → …
  • Context is bloated
  • SKILL.md covers When to Use, Quick Start, SmartCrusher — 5-Dimensional… and CCR Store —…, plus 2 more sections
  • Runs Python scripts from its folder

What it does

Headroom is an agent skill from momori777/Artemis. SmartCrusher + CCR context compression — crunch large JSON arrays, tool outputs, and search results to save tokens. Use when context is bloated or approaching token limits.

Its SKILL.md is about 560 tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files (for example `PROXY.md`, `README.md` and `__init__.py`).

It sits in AI & LLM Engineering, covering LLM cost and token optimization and Diffusion and image models. It works with ComfyUI and Telegram. The repository describes itself as: 破限本地AI女友后宫,Agent+画图语音向量数据库+live2D+桌宠+酒馆角色卡导入+webchat,QQ+Telegram双通道,8G显存可跑 uncensored Fully offline AI girlfriends harem Openclaw/Claude code+Local LLM+GPT-SoVITS+ComfyUI…. The licence is MIT.

When your agent uses it

  • Context is bloated
  • Approaching token limits

Example prompts

  • “/headroom”

Requirements

  • Python 3

Workflow steps

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

  1. First/Last items — pagination context + latest data (30% head + 15% tail)
  2. Error items — 100% preserved
  3. Statistical outliers — > 2 std from mean
  4. Query-relevant — BM25 match against user query
  5. Change points — significant transitions in data

What it can do on your machine

Read from SKILL.md and the folder at commit 19361e0. 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 script files (Python), which the agent can run.

    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

Headroom loads about 562 tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 137 words of instructions outside code blocks.

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

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 momori777/Artemis at commit 19361e0, republished under its MIT licence (© momori777). 137 words, ~562 tokens.

Download SKILL.mdSave it as .claude/skills/headroom/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
headroom
description
SmartCrusher + CCR context compression — crunch large JSON arrays, tool outputs, and search results to save tokens. Use when context is bloated or approaching token limits.
license
MIT
homepage
https://github.com/chopratejas/headroom

Headroom — Context Compression Layer

SmartCrusher + CCR (Compress-Cache-Retrieve) for token-saving context compression. Portable Python module — no external dependencies beyond stdlib.

When to Use

  • Large tool output (grep results, JSON arrays, file listings) approaching context limit
  • Before sending a long context to a model with token cap
  • Need to preserve essential items while dropping noise

Quick Start

python
from skills.headroom import SmartCrusher, CCRStore

# Compress a JSON array (keep most important items)
crusher = SmartCrusher()
result = crusher.crush(large_json, query="relevant keywords")
# result.compressed  → compressed JSON string
# result.items_kept / items_total → retention ratio
# result.compression_ratio → e.g. 0.3 means 70% tokens saved

SmartCrusher — 5-Dimensional Scoring

Keeps items by:

  1. First/Last items — pagination context + latest data (30% head + 15% tail)
  2. Error items — 100% preserved
  3. Statistical outliers — > 2 std from mean
  4. Query-relevant — BM25 match against user query
  5. Change points — significant transitions in data

Config overrides:

python
crusher = SmartCrusher(config={
    "max_items_after_crush": 15,
    "first_fraction": 0.3,
    "variance_threshold": 2.0,
})

CCR Store — Compress-Cache-Retrieve

python
store = CCRStore(max_entries=1000, ttl_seconds=3600)

# Cache original when crushing
store.put(hash_key, original_text)

# Retrieve if LLM needs more detail
full_text = store.get(hash_key)

Token Estimation

python
from skills.headroom import estimate_tokens
tokens = estimate_tokens("some text — CJK-aware counting")

Integration Notes

  • This module is already imported by skills/shared/context_trimming.py (SmartCrusher layer)
  • CCR background worker in skills/sakura/app/agent/memory_curator.py writes to Qdrant
  • For roleplay context trimming: the context_trimming module wraps SmartCrusher with 24msg/40K char cap

© momori777, 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 3 other files in skills/headroom of momori777/Artemis.

  • SKILL.md
  • PROXY.md
  • README.md
  • __init__.py

Open the folder on GitHubat commit 19361e0

Compare with similar skills

Headroom 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.

Headroom compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Headroom this skillmomori777/Artemis380—~562Automated safety check: PassMIT
Comfyui AnimatoolShiroEirin/comfyui-good-anima481—~4.6kAutomated safety check: PassGPL-3.0
Comfyui Agent Skill MieMieMieeeee/comfyui-agent-skill116—~3.9kAutomated safety check: PassApache-2.0
Comfyui Media Workflowscalesthio/generative-media-skills197—~8.5kAutomated safety check: PassMIT
Comfyui Coreartokun/comfyui-mcp803—~3.3kAutomated safety check: PassMIT
Comfyui Skill OpenclawHuangYuChuh/ComfyUI_Skills_OpenClaw413—~2.7kAutomated safety check: PassApache-2.0

Similar skills

  • Comfyui Animatool

    ShiroEirin/comfyui-good-anima

    Route ALL Anima image generation: validate Danbooru hard anchors, form visual brief, assemble English prompts and args, then load comfyui-manager for workflow execution.

    481 GitHub stars~4.6k tokensUpdated 3 mo ago
    AI & LLM EngineeringAuto-check passed
  • Comfyui Agent Skill Mie

    MieMieeeee/comfyui-agent-skill

    Agent skill for running registered ComfyUI workflows through a stable CLI, and for importing a user's own ComfyUI workflow into their private registry after review.

    116 GitHub stars~3.9k tokensUpdated 2 days ago
    AI & LLM EngineeringAuto-check passed
  • Comfyui Media Workflows

    calesthio/generative-media-skills

    Provider-independent production workflow for agents assembling, auditing, executing, and handing off ComfyUI node-graph workflows for image, video, upscale, inpaint, conditioning, and batch media…

    197 GitHub stars~8.5k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Comfyui Core

    artokun/comfyui-mcp

    Core ComfyUI knowledge covering workflow format, node types, pipeline patterns, and MCP tool usage

    803 GitHub stars~3.3k tokensUpdated 6 days ago
    AI & LLM EngineeringAuto-check passed
  • Comfyui Skill Openclaw

    HuangYuChuh/ComfyUI_Skills_OpenClaw

    Run registered ComfyUI workflows through the fast comfyui-skill CLI, and use the official local Comfy MCP for live template, node, model, validation, and orchestration capabilities.

    413 GitHub stars~2.7k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • ComfyUI Custom Node Builder

    ConstantineB6/comfy-pilot

    Helps an agent write ComfyUI custom nodes in Python, including wrapping an existing script, mapping data types and handling image batches.

    230 GitHub stars~897 tokensUpdated 7 mo ago
    AI & LLM EngineeringAuto-check passed

More from momori777/Artemis

  • Mem0 Bridge

    momori777/Artemis

    Mem0 memory bridge for AI Girlfriend — search/read/write long-term memories from Qdrant vector DB.

    380 GitHub stars~453 tokensUpdated 11 days ago
    Auto-check passed

Works with

Questions about Headroom

What does Headroom do?

SmartCrusher + CCR context compression — crunch large JSON arrays, tool outputs, and search results to save tokens. Headroom is an agent skill from momori777/Artemis. SmartCrusher + CCR context compression — crunch large JSON arrays, tool outputs, and search results to save tokens.

When should I use Headroom?

Headroom fits situations like: context is bloated; approaching token limits.

How do I install Headroom in Claude Code?

Run `npx skills add momori777/Artemis --skill headroom -a claude-code`. Or copy the skill folder (skills/headroom in momori777/Artemis) into .claude/skills/headroom in your project. Claude Code loads it when a task matches its description.

How do I install Headroom in Codex?

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

Can I use Headroom 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 momori777/Artemis --skill headroom -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/headroom, .gemini/skills/headroom, .github/skills/headroom and .opencode/skills/headroom in your project.

What does Headroom need to run?

Going by SKILL.md and its folder, Headroom needs Python for the scripts in its folder. Our summary lists: Python 3.

Does Headroom 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 Headroom 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 Headroom use?

Headroom is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Headroom use?

About 562 tokens (SKILL.md is roughly 2.2k 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 Headroom?

Skills that share tags, products or a category with Headroom: Comfyui Animatool (ShiroEirin/comfyui-good-anima, 481 stars), Comfyui Agent Skill Mie (MieMieeeee/comfyui-agent-skill, 116 stars), Comfyui Media Workflows (calesthio/generative-media-skills, 197 stars) and Comfyui Core (artokun/comfyui-mcp, 803 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Headroom?

momori777 (a GitHub user) maintains it in momori777/Artemis, which has 380 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on September 30, 2026.

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