headlenss-new-session

headlenss-new-session is a skill for Claude Code from takashicompany/headlenss. It costs 93 tokens per session (1,183 once invoked), scanned C, original, MIT.

A skill for creating a new session in headlenss, a local server that manages persistent terminal sessions. It uses the server’s API rather than creating a terminal multiplexer session directly.

In plain words
What is it for?
Use it to check headlenss health, create named sessions in a chosen working directory, and optionally start Claude Code or Codex in the new session.
Why use it?
Using the server API preserves headlenss’s setup, detection, and persistence behavior. It also checks whether the server is available before creating the session.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code; mentions Codex.

Part of the headlenss plugin — 3 skills shipped together

Good fit Use it to check headlenss health, create named sessions in a chosen working directory, and optionally start Claude Code or Codex in the new session.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/takashicompany/headlenss/headlenss-new-session
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 takashicompany/headlenss --skill headlenss-new-session
Clone the repo
git clone --depth 1 https://github.com/takashicompany/headlenss

Made for: Claude Code.

Or install headlenss, the plugin that ships this one along with the rest of its 3 skills.

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 headlenss-new-session

README.md
[![agentmods](https://agentmods.dev/badge/skills/takashicompany/headlenss/headlenss-new-session/github.svg)](https://agentmods.dev/skills/takashicompany/headlenss/headlenss-new-session)
Your own site
<a href="https://agentmods.dev/skills/takashicompany/headlenss/headlenss-new-session"><img src="https://agentmods.dev/badge/skills/takashicompany/headlenss/headlenss-new-session/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 headlenss-new-session

Your own site · 80×15
<a href="https://agentmods.dev/skills/takashicompany/headlenss/headlenss-new-session"><img src="https://agentmods.dev/badge/skills/takashicompany/headlenss/headlenss-new-session.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,183 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found 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.00093 $0.01183
Opus 5 $0.00046 $0.00592
Sonnet 5 $0.00019 $0.00237
Haiku 4.5 $0.00009 $0.00118

Measured 12d ago against content hash 3d13664501a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade C, and why

headlenss-new-session scanned grade C with 2 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 12d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -s http://127.0.0.1:3000/api/sessions | python3 -c "import json,sys; print([s['name'] for s in json.load(sys.stdin)['sessions']])"

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:3000/api/health
plugin/skills/headlenss-new-session/SKILL.md · 77 lines

How it starts

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

headlenss に新しいセッションを作る

headlenss サーバのセッション作成 API を 1 回叩くだけ。tmux を直接操作しない (サーバが tmux 設定・検出・永続化まで面倒を見るため、tmux new-session を 手で打つとそれらが揃わない)。

以下のコマンドは headlenss サーバの API が http://127.0.0.1:3000/api で使える前提。 別のホスト・ポートの環境では URL を読み替える。

手順

1. サーバの確認

curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:3000/api/health

200 以外ならサーバが動いていない。常駐サービスとして入れてある環境 (Linux + systemd ユーザーサービス headlenss) なら systemctl --user status headlenss を 確認し、落ちていたらユーザーに報告する (勝手に stop/kill しない。start は systemctl --user start headlenss でよい)。サービス化していない環境では サーバの起動方法をユーザーに確認する。

2. 作成

curl -s -X POST http://127.0.0.1:3000/api/sessions \
  -H 'Content-Type: application/json' \
  -d '{"name": "<セッション名>", "cwd": "<作業フォルダ>", "startClaude": true}'

成功すると {"ok":true}。失敗は 400 + {"error":"..."}

フィールド 必須 内容
name セッション名。[a-zA-Z0-9_-] のみ、40 文字まで (日本語・スペース不可)。一覧にそのまま出るので短く分かりやすく
cwd - 作業フォルダの絶対パス。省略時は $HOME存在しなければ親ごと自動作成される (typo に注意)
startClaude - true で Claude Code を起動 (claude -c で前回会話の継続を試み、なければ新規)
startCodex - true で Codex を起動 (codex resume --last を試み、なければ新規)。startClaude と併用しない

どちらの start も付けなければ素のシェルだけのセッションになる。 エージェント指定が無い依頼では startClaude: true を既定にし、迷ったらユーザーに聞く。

3. 確認

curl -s http://127.0.0.1:3000/api/sessions | python3 -c "import json,sys; print([s['name'] for s in json.load(sys.stdin)['sessions']])"

作った名前が一覧に入っていれば完了。スマホ Web・G2 の一覧にも同じものが出る。

よくあるエラー

エラー 原因
invalid session name (use [a-zA-Z0-9_-], max 40 chars) 名前に日本語・スペース・記号が入っている。英数字とハイフンに直す
duplicate session 同名セッションが既に存在する。既存を消さず、別名にするかユーザーに確認
接続できない サーバ未起動、または URL が違う。手順 1 へ

してはいけないこと

  • 既存セッションの削除 (DELETE /api/sessions/:name)・改名 (PATCH)・退避 (release) を この流れで勝手に行わない。ユーザーが明示的に依頼した場合のみ。
  • tmux new-session / tmux kill-session の直接実行で代替しない。
  • 既に同名がある場合に「作り直し」目的で削除しない (別ランの会話履歴が消える)。

前提

  • headlenss サーバが稼働していること
  • API のベース URL が http://127.0.0.1:3000/api 以外の環境では読み替える (別 PC の headlenss を操作する場合も同様に URL を差し替えるだけでよい)

Read the full file on GitHub · 77 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. 12d ago First seen · 77 lines · 93 tokens per session scan C 3d13664501a4

Subscribe to this mod's changes

headlenss-new-session is a skill published in the GitHub repository takashicompany/headlenss (5 stars, last pushed 3d ago), licensed MIT. It adds 93 tokens to every session and 1,183 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.