agentleFS
Sapere-IASapere-IA/sdd-onboarding-kit/skills/optional/context-audit/SKILL.md

context-audit

Skill19 starsChanged 37 days agoMITView on GitHub

Inspect and reduce the context-window usage of the current session. Use when a session has grown long, behavior degrades, or before starting a new unrelated task in the same session.

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use skillify, refactor and 1 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    skillify

    Capture a repeatable process from the current session into a reusable Amplifier SKILL.md skill file. Use when the user wants to create a skill, save a workflow as a skill, turn a process into a reusable skill, or mentions "skillify", "create skill", "make a skill", "save as skill", "capture workflow", "turn this into a skill", "new skill", or wants to automate a repeatable process they just performed.

    Also in 3 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 3 projects that use this

  • MicrosoftSkill

    handoff

    Compact the current conversation into a handoff document for another agent to pick up.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 19 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep the context window healthy by auditing what is loaded and recommending targeted cleanup, following reference/context-economy.md …

    line 10
  2. Distinctive:

    Before switching to an unrelated task in the same session.

    line 17
  3. Distinctive:

    After a noisy investigation (many files read, long tool outputs).

    line 18
  4. Very specific:

    If compacting, use the harness's compaction command (/compact in Claude Code, Codex and OpenCode) with focus instructions where it accepts …

    line 38
  5. Very specific:

    Before compacting, write anything durable to its artifact (tasks.json, spec files, decision log, history.md) — artifacts, not chat, are the …

    line 43
  6. Distinctive:

    No file output by default.

    line 51
  7. Distinctive:

    Never discard unresolved questions or unrecorded decisions by compacting.

    line 57
  8. Distinctive:

    Do not write to memory or global configuration.

    line 58

“Common” is measured: kept by at least 6 in 10 of the 19 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Context audit

Purpose

Keep the context window healthy by auditing what is loaded and recommending targeted cleanup, following reference/context-economy.md (copied or linked during onboarding).

When to use

  • A session has been running long and responses degrade or lose track.
  • Before switching to an unrelated task in the same session.
  • After a noisy investigation (many files read, long tool outputs).
  • The developer asks "why is context full?" or similar.

When not to use

  • Short sessions with no symptoms — auditing costs context too.
  • Mid-implementation of an approved task: finish or reach a stable point first, so compaction does not drop in-flight details.

Required inputs

  • Current task status (from tasks.json) and any unresolved questions — these must survive any compaction.

Procedure

  1. Inspect context usage with the harness's command (/context in Claude Code, /status in Codex, the session view elsewhere — see the table in reference/context-economy.md) and identify the dominant consumers.
  2. Decide: continue, compact, or restart.
  3. If compacting, use the harness's compaction command (/compact in Claude Code, Codex and OpenCode) with focus instructions where it accepts them, to preserve: decisions made, current task state, architecture constraints, and unresolved questions. Where it does not, write those to their artifacts first.
  4. Before compacting, write anything durable to its artifact (tasks.json, spec files, decision log, history.md) — artifacts, not chat, are the source of truth.
  5. Recommend subagents for upcoming noisy exploration instead of doing it in the main conversation.

Output artifact

No file output by default. If durable information was only in chat, the output is updated artifacts (task status, decision entries) written before compaction.

Safety constraints

  • Never discard unresolved questions or unrecorded decisions by compacting.
  • Do not write to memory or global configuration; this skill only inspects and advises.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.