context-window-self-clearing
Preserve Datarim task continuity while orchestrated Claude Code or Codex sessions compact or clear context at deterministic pressure thresholds.
Skill by Arcanada-one
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/arcanada-one-context-window-self-clearing
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: productivity, agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/context-window-self-clearing
What's inside
- Skill name
context-window-self-clearing- Description
- Preserve Datarim task continuity while orchestrated Claude Code or Codex sessions compact or clear context at deterministic pressure thresholds.
- License
- MIT
- Instructions
- 65 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Context-Window Self-Clearing Use this skill only for orchestrator-launched Claude Code and Codex sessions that explicitly enable context-window automation. It is default-off. ## Contract 1. Read the active task snapshot first. Bind the active task-description path, last completed snapshot stage, snapshot path, and snapshot digest into a private transaction before sending a reset instruction. 2. Pressure has TWO arms and the stricter verdict wins. **Absolute arm (primary).** Below 200000 tokens of working set is `no_op`, 200000 through 279999 is `selective_drop`, 280000 and above is `full_clear`. Ceilings are overridable per deployment via `DR_CTX_SOFT_TOKENS` and `DR_CTX_HARD_TOKENS`. **Percentage arm (retained).** Below 75 percent is `no_op`, 75 through 89 is `selective_drop`, 90 through 100 is `full_clear`. A private exact-label policy may select a mode only at or above its declared floor, never below 50. A percentage alone cannot express pressure, because it hides its denominator: 75 percent of a 200k window is 150k tokens, while 75 percent of a 1M window is 750k. Attention degrades with the LENGTH of the accumulated history, not with its ratio to a limit, so a larger window is headroom for one large read — never a licence to accumulate proportionally more. A threshold written only as a percentage silently changes meaning when the runtime's window changes, which is how a session reached 98 percent of a large window while every declared threshold read as satisfied. An orchestrator that cannot obtain a token count MUST still apply the percentage arm, and MUST treat the missing count as a gap to close rather than as evidence of low pressure. 3. Use only these fixed instructions: - Codex selective: `/compact` - Claude selective: `/compact Preserve active Datarim task pointer last completed phase current plan open verification findings and next action` - full clear: `/clear` 4. Claim transaction state before terminal input. A failed or crashed claim is ambiguous and must be reconciled; never replay it automatically. 5. After full clear, accept only a changed conversation marker bound to the same runtime instance, launch incarnation, and pane, revalidate the snapshot digest, then send `/dr-next <TASK-ID>`. After selective compaction, a matching PostCompact marker completes the transaction exactly once. 6. Never persist raw pane, prompt, assistant, notify, or rollout content. ## Trust boundary An unsandboxed runtime hook and an ordinary agent tool shell run as the same OS user. HMAC tags therefore protect private-state integrity, ordering, replay, and pane correlation; they do not prove vendor-event origin. Automation requires both `key_injection: true` and `context_window.trust_same_uid_runtime: true`. Enabling both explicitly trusts that same-UID runtime domain for the three fixed reversible actions above. ## Recovery Use `context_window_controller.sh reconcile` to report or abort an ambiguous transaction. Use `context_window_setup.sh doctor --recover-stale-instances` only after the helper proves the old tmux socket/server epoch and process birth are gone, the current epoch differs, and no nonterminal transaction references the instance. Never delete active mappings merely to free capacity. Continuity source of truth: `skills/dr-next-snapshot-replay/SKILL.md`.
From Arcanada-one/datarim, MIT.
More from Arcanada-one/datarim
- 0.642score
human-outcome-reporting
Arcanada-one
Explain human-facing task outcomes with requirements, evidence, honest acceptance status and read-only re-explanation, inside or outside Datarim.
SkillAFreshness: A★ 16Claude Code +9 - 0.640score
finishing-a-development-branch
Arcanada-one
Use when implementation is complete and all tests pass.
SkillAFreshness: A★ 16Claude Code +9 - 0.639score
hypothesis-validation
Arcanada-one
Use when a product decision depends on an uncertain claim and needs a bounded, falsifiable check.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
diataxis-docs
Arcanada-one
Diátaxis documentation taxonomy mandate four orthogonal categories tutorials how-to reference explanation for every Datarim-managed repo and product site
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
artifact-context
Arcanada-one
Canonical conventions for native agents generating or editing Datarim artifacts, including stage headers, frontmatter, and exact contract quotations.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
customer-delivery
Arcanada-one
Enforce delivery from a verbatim requirement through pre-work knowledge selection, production evidence, and disposition; excludes enabling-only closure.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
ai-quality
Arcanada-one
Five pillars of AI-assisted development — decomposition, TDD, architecture-first, focused work, context.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
brainstorming
Arcanada-one
MUST use this before any creative work — features, components, functionality, behavior changes.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
compliance
Arcanada-one
Post-QA hardening — detects task type (code, docs, research, legal, content, infra) and applies the matching verification checklist before archiving.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
consilium
Arcanada-one
Assemble a panel of Datarim agents for multi-perspective analysis of decisions.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
cron-agent-patterns
Arcanada-one
Layered timeout defense for cron-orchestrated agents calling external APIs (LLM CLI, HTTP, subprocess) — nested tiers, anti-patterns, headroom.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
adversarial-review
Arcanada-one
Forces an adversarial mindset on a plan, PRD, design, or code change — break it rather than bless it.
SkillAFreshness: A★ 16Claude Code +9
Signals
- Stars
- 16
- Forks
- 1
- Open issues
- 0
- Last commit (this folder)
- Oct 4, 2026 (24 days ago)
- Last release
- Oct 22, 2026 (5 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Arcanada-one/datarim
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Arcanada-one
- 0.642score
human-outcome-reporting
Arcanada-one
Explain human-facing task outcomes with requirements, evidence, honest acceptance status and read-only re-explanation, inside or outside Datarim.
SkillAFreshness: A★ 16Claude Code +9 - 0.640score
finishing-a-development-branch
Arcanada-one
Use when implementation is complete and all tests pass.
SkillAFreshness: A★ 16Claude Code +9 - 0.639score
hypothesis-validation
Arcanada-one
Use when a product decision depends on an uncertain claim and needs a bounded, falsifiable check.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
brainstorming
Arcanada-one
MUST use this before any creative work — features, components, functionality, behavior changes.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
artifact-context
Arcanada-one
Canonical conventions for native agents generating or editing Datarim artifacts, including stage headers, frontmatter, and exact contract quotations.
SkillAFreshness: A★ 16Claude Code +9 - 0.637score
ai-quality
Arcanada-one
Five pillars of AI-assisted development — decomposition, TDD, architecture-first, focused work, context.
SkillAFreshness: A★ 16Claude Code +9
Cite this page
context-window-self-clearing skill. Agent Mart. https://agentmart.dev/skills/arcanada-one-context-window-self-clearing (last updated 2026-10-24)