lov-auto-context

A context-management tool for coding-agent sessions. It checks for long conversations, topic drift, and stale information, then can write project memory, propose instruction changes, or suggest commands such as starting a fresh session.

In plain words
What is it for?
Use it to assess session context, record project memory, update approved project instructions, or receive recommendations to fork or compact a conversation.
Why use it?
It helps keep the agent focused when a conversation becomes noisy or approaches its context limit, while requiring confirmation before sensitive instruction changes.

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/lovstudio/skills/auto-context
Any agent
npx skills add lovstudio/skills --skill auto-context
Clone the repo
git clone --depth 1 https://github.com/lovstudio/skills

Made for: Claude Code, Codex.

Per session 112 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,964 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.00112 $0.01964
Opus 5 $0.00056 $0.00982
Sonnet 5 $0.00022 $0.00393
Haiku 4.5 $0.00011 $0.00196

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

Security

Grade A, and why

lov-auto-context 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/auto-context/SKILL.md · 200 lines

How it starts

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

AutoContext: Context Operator

Not just a health check — a full operator over everything that shapes context. Three layers by action sensitivity:

Layer Examples Behavior
Auto-execute write project memory, update MEMORY.md index Do it, report path
Confirm-first edit global agent instructions, edit project CLAUDE.md, overwrite/delete existing memory Show diff, wait for "yes"
Suggest-only /fork, /compact, /btw, new session Print the exact command to paste

The harness owns /fork and /compact; this skill cannot invoke them. But it can do everything else and will.

Auto Mode (via Plugin Hook)

When the skill-publisher plugin is enabled, a UserPromptSubmit hook monitors transcript size. Above threshold (40+ entries or 150KB+), it injects a lightweight <auto-context> reminder.

When you see <auto-context>:

Context State Action
Mostly relevant Continue, say nothing
Some stale noise Mentally deprioritize, proceed
Mostly irrelevant Suggest /fork or /btw with exact command
Near capacity Suggest /compact or /fork with exact command

Rules:

  • 1 sentence max unless acting.
  • If context is fine, say nothing.
  • Never auto-fork/auto-compact (can't anyway — harness-only).
  • Don't mention "AutoContext" unless asked.

Manual Mode (/lov-auto-context [args])

Two call shapes:

A. Bare call — health report + opportunistic memory write

/lov-auto-context
  1. Measure — estimate turns, tool calls, distinct topics
  2. Assess — healthy / getting noisy / polluted / critical
  3. Scan recent turns for unpersisted feedback/preferences — if the user stated a rule or preference earlier in the session that should persist to future conversations (typical trigger phrases: "从今以后", "以后都", "所有 X 应该 Y", "别再", "记住"), and no memory was written, auto-execute: write the memory file + update MEMORY.md. Report the path.
  4. Recommend harness actions if needed (/fork, /compact, /btw) with the exact command to paste.

Read the full file on GitHub · 200 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 200 lines · 112 tokens per session scan A 6f3cb48f69e8

Subscribe to this mod's changes

lov-auto-context is a skill published in the GitHub repository lovstudio/skills (64 stars, last pushed 3d ago), licensed MIT. It adds 112 tokens to every session and 1,964 once invoked, about $0.0006 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.

Related

Other skills, from other repositories

agenttrace-session-audit

Audit local AI coding-agent sessions with agenttrace. Use when the user asks to inspect Claude Code, Codex CLI, Gemini CLI, Qwen Code, Cline, Aider, Cursor exports, Hermes Agent, OpenCode, OpenClaw, Pi, Oh My Pi, Kimi CLI, Copilot-style logs, or generic JSON/JSONL traces for cost, tokens, tool failures, latency…

luoyuctl/agenttrace · 99 tokens

sdd

Execute the Liatrio Spec-Driven Development (SDD) workflow when explicitly invoked by the user. NOTE: this skill is NOT intended to be dynamically loaded or automatically triggered; it should only ever be explicitly called by the user.

liatrio-labs/spec-driven-workflow · 50 tokens

ship-it

End-to-end ship loop: atomic commits, PR, tiered review (lite|heavy), fix every finding, re-review until zero remain, then merge-commit. lite runs a single /review pass; heavy spins up a dynamic Workflow with diff-aware review personas plus a Codex cross-model peer. Use when Stevie says "/ship-it", "ship it", "ship…

stevengonsalvez/agents-in-a-box · 96 tokens

ainb-fleet:daemon

Long-running watcher that scans every claude session every 5s and auto-sends continue to any session whose recent tmux pane buffer matches a known API-error regex (ratelimited, overloadederror, internalservererror, requesttimeout, sockethangup, fetchfailed, ECONNRESET). Use this when you want unattended recovery from…

stevengonsalvez/agents-in-a-box · 89 tokens

ainb-fleet:broadcast

Fan out a single prompt to selected claude sessions across the fleet. Use when you need to apply the same instruction (e.g. /clear, git pull, remote-control disconnect) to many sessions at once. Routing: tmux send-keys by default (the broker is an opt-in fallback, toggled via AINBFLEETTRANSPORT). Refuses to run…

stevengonsalvez/agents-in-a-box · 114 tokens

app-backend

Guide for adding a backend layer (REST API, WebSockets, cron jobs) to Fusebase Apps apps. Use when: (1) An app needs a server-side API beyond the Dashboard SDK, (2) Adding REST endpoints or WebSocket support, (3) Setting up the backend/ folder structure, (4) Scheduling cron jobs for periodic tasks. The backend is…

fusebase-dev/fusebase-flow · 92 tokens