context-reconstruct

A procedure for recovering an agent's working context from saved project records after an interruption or long-running sequence of tasks. It tells the agent to read records such as the current task, owner thread, pending questions, handoff notes, and build log before acting.

In plain words
What is it for?
Use it in agent workflows that may be interrupted, compacted, or run repeatedly. It helps the agent re-establish what is being worked on, who owns it, what remains unanswered, and what has already been built.
Why use it?
It reduces mistakes caused by relying on incomplete or outdated memory. The agent can resume work from the project's durable notes instead of asking the owner to repeat the context.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/sonichi/sutando/context-reconstruct
Any agent
npx skills add sonichi/sutando --skill context-reconstruct
Clone the repo
git clone --depth 1 https://github.com/sonichi/sutando

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,551 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00043 $0.02551
Opus 5 $0.00022 $0.01275
Sonnet 5 $0.00009 $0.00510
Haiku 4.5 $0.00004 $0.00255

Measured 2d ago against content hash 6ecd18ec9e75, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

context-reconstruct 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 2d 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.

skills/context-reconstruct/SKILL.md · 107 lines

How it starts

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

context-reconstruct

Goal: never act on lost/eroded memory of the ongoing work. The agent can be interrupted, compacted, or run dozens of interleaved cron passes and still pick up exactly where the thread left off — without the owner re-reminding it.

Why a skill, not a script: a hardcoded bundler (fixed N reads, one channel, fixed depth) is rigid — and easy to skip (narrate "re-anchor" then assert from memory anyway). The fix isn't a rigid script; it's flexible judgment + practice. This file is living — improve it whenever a reconstruction misses.

The one rule

Before interpreting or acting on anything that depends on earlier context, READ the durable record. Don't recall — read. A "re-anchor" you claim but don't actually read is the failure.

What to read — judgment, fit to the moment (not a checklist to run blindly)

Read the current-track record FIRST<workspace>/hosts/<hostname>/current-track.md (this skill owns it; see "Maintain" below). Resolve <hostname> with bash scripts/sutando-config.sh host-label, the same way pending-questions.md does. Legacy fallback: if that file is absent but <workspace>/state/current-track.md exists, read the legacy path and migrate it to the per-host path on the next write — the flat path was shared across hosts and is being retired (#2567). It's the fast anchor: the current main-track goal, the active sub-task, and the live open decisions. This is what's missing when "continue your main track" gets guessed — the goal must be a pinned record, not inferred from luck.

Then, as the situation needs (pick what's relevant; skip what isn't):

  • The live thread — the channel(s) the owner is actually active on: python3 src/discord-read.py <channel_id> --serving <task channel_id> when serving a task (the contextNotFrom gate runs before the fetch), or --operator on autonomous passes with no serving context (Discord), telegram task [Replying to…] quotes (Telegram has no history fetch). Go as deep as the thread needs with --until <id|iso> — not a fixed message count. If unsure which channel is live, check the most recent task's channel_id / state/last-owner-activity.json.
  • Open decisions — per-host pending-questions.md.
  • Recent judgment/decisions — latest relay/relay-*.md.
  • What's built / nextbuild_log.md tail.
  • Deep history (older than the channel can cheaply reach) — the session transcript JSONL.

Read the full file on GitHub · 107 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. 2d ago First seen · 107 lines · 43 tokens per session scan A 6ecd18ec9e75

Subscribe to this mod's changes

context-reconstruct is a skill published in the GitHub repository sonichi/sutando (389 stars, last pushed 2d ago), licensed MIT. It adds 43 tokens to every session and 2,551 once invoked, about $0.0002 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-30.