aiko-resume

aiko-resume is a skill for Claude Code from masa-san-jp/Agent-Aiko. It costs 76 tokens per session (2,108 once invoked), scanned A, original, MIT.

A session-resume skill that reads saved state and recent automatic logs to identify unfinished work. Session state is a record of what was in progress before a restart.

In plain words
What is it for?
Finding the previous task, recently changed files, and unfinished work when starting Aiko again.
Why use it?
It helps recover context after a terminal failure, restart, or move to another working session.

Skill for Claude Code

Written for Claude Code: PostToolUse hook event. Also seen: mentions CLAUDE.md.

Good fit Finding the previous task, recently changed files, and unfinished work when starting Aiko again.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/masa-san-jp/agent-aiko/aiko-resume
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 masa-san-jp/Agent-Aiko --skill aiko-resume
Clone the repo
git clone --depth 1 https://github.com/masa-san-jp/Agent-Aiko

Made for: Claude Code.

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 aiko-resume

README.md
[![agentmods](https://agentmods.dev/badge/skills/masa-san-jp/agent-aiko/aiko-resume/github.svg)](https://agentmods.dev/skills/masa-san-jp/agent-aiko/aiko-resume)
Your own site
<a href="https://agentmods.dev/skills/masa-san-jp/agent-aiko/aiko-resume"><img src="https://agentmods.dev/badge/skills/masa-san-jp/agent-aiko/aiko-resume/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 aiko-resume

Your own site · 80×15
<a href="https://agentmods.dev/skills/masa-san-jp/agent-aiko/aiko-resume"><img src="https://agentmods.dev/badge/skills/masa-san-jp/agent-aiko/aiko-resume.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,108 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 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.00076 $0.02108
Opus 5 $0.00038 $0.01054
Sonnet 5 $0.00015 $0.00422
Haiku 4.5 $0.00008 $0.00211

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

Security

Grade A, and why

aiko-resume 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 11d 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.

claude-code/template/.claude/aiko/capability/skills/aiko-resume/SKILL.md · 155 lines

How it starts

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

aiko-resume — セッション再開支援

ターミナルが落ちる・別ウィンドウで再起動する等で会話履歴が失われても、直前の作業を即座に再開できるようにするためのスキルです。

/aiko 起動時に CLAUDE.md の起動シーケンスから自動ロードされます(capability/skills/ 配下は両モードで自動読み込み)。


参照ファイル

ファイル 役割
.claude/session-state/current.md 整理ステート(手動更新の本命)
.claude/session-state/auto.jsonl 自動ログ(hook で追記、補助情報)

動作フロー

/aiko 起動直後の追加処理

通常の人格読み込みが終わったあと、起動メッセージを返すに以下を実行します。

ステップ 1:current.md(手動ステート)の確認
  1. current.md が存在するか確認します。
  2. current.md の YAML frontmatter から status を読みます。
  3. status: in_progress採用。次の「ステップ 3:提示」に進む。
  4. status: completed または ファイルなし / 不正 → ステップ 2(auto.jsonl 推定)に進む。
ステップ 2:auto.jsonl(自動ログ)からの推定

current.md が再開ソースとして使えない場合、auto.jsonl の末尾 30 行を読んで前回の作業を推定します。

  1. .claude/session-state/auto.jsonl の末尾 30 行を取得(ファイル無し / 空なら通常起動メッセージのみで終了)。
  2. 末尾エントリの ts から「前回作業 = X 時間 / 日 前」を計算します。
  3. その 30 行の中で、file フィールドの出現回数トップ 5 を集計します(同じパスの出現回数を合算してカウント、表示は重複除いたユニークパスのみ)。Bash エントリは desc を別カラムで保持。
  4. 提示できる材料が揃ったら「ステップ 3:提示」に進みます。

行数固定(30 行)の理由:

  • 毎日連続で仕事するとは限らないため、「24h 以内」のような時間条件で切ると数日空いた途端に拾えなくなる。
  • 行数なら「最後にアイコと働いた時の作業」を時間に関係なく拾える。
ステップ 3:提示

採用したソース(current.md / auto.jsonl)に応じて、起動メッセージに続けて以下のサマリを提示します。

A. current.md 採用時

### 前回の続き

**タスク**:<current_task>
**更新時刻**:<updated>

<## いまやってること を 1〜2 行に要約>
<## 次の一手 を 1〜2 行に要約>

続きから再開しますか?(または「別件」とお伝えください)

B. auto.jsonl 採用時

### 前回の続き(自動ログより推定)

**最終アクティビティ**:<ts から計算した相対時間>
**直近に触ってたファイル**:
- <path1>(N 回)
- <path2>(N 回)
- ...

このあたりの作業の続きから入りますか?(または「別件」とお伝えください)

C. 両方ある場合

current.md が status: in_progress なら A を優先。auto.jsonl は提示しない(current.md が新しいなら手動の整理が信頼できる)。ただし current.md の updated よりも auto.jsonl の末尾 ts大幅に新しい場合(例:1 時間以上)、A の下に小さく「最終ファイル操作:<相対時間>」を 1 行添えるのは可。

ステップ 4:応答受け

ユーザーの返答を待ちます。

  • 「続き」「やる」「再開」等 → 採用ソースの内容を踏まえてタスクに着手。current.md 採用時は中身全文を読み返してから動く。auto.jsonl 採用時は触ってたファイルを Read してコンテキスト復元してから動く。
  • 「別件」「新規」「いや」等 → current.md のステータスは触らず、新しい依頼を待つ。auto.jsonl も触らない。

Read the full file on GitHub · 155 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. 11d ago First seen · 155 lines · 76 tokens per session scan A b4e985faf030

Subscribe to this mod's changes

aiko-resume is a skill published in the GitHub repository masa-san-jp/Agent-Aiko (3 stars, last pushed 1mo ago), licensed MIT. It adds 76 tokens to every session and 2,108 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.