agentleFS
HorizonBruteHorizonBrute/Standardized_AI_Looping_Language-SAILL/skills/context-cost/SKILL.md

context-cost

Skill1 starsChanged 5 months agoMITView on GitHub

Report harness context overhead (KB, words, estimated tokens) for a given path by walking the directory tree and collecting all CLAUDE.md, agents.md, and @-import files the harness auto-loads. Use when the user types /context-cost or /ctx-cost, or wants to know what files are loading into context.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the script is not found, report its expected location and stop.

    line 34

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “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

Skill: /context-cost

Model preference: #lowcost

Report how much context overhead the harness will auto-load for a given path — walking up the directory tree and collecting every CLAUDE.md, CLAUDE.local.md, agents.md, and @-import file pulled in at session start.


Arguments

/context-cost [path]

  • path — optional; defaults to the current working directory if omitted.

Step-by-step execution

Step 1 — Locate the script

Find context_cost.py in the bin/ directory of the SAILL repo. If you are running from within a tested_implementation directory, the script is at ../../bin/context_cost.py relative to your working directory. If running from the repo root, it is at bin/context_cost.py.

Run:

python <path-to-bin>/context_cost.py <target-path> --json

If the script is not found, report its expected location and stop.

Step 2 — Parse and format the output

The JSON structure is:

{
  "path": "...",
  "files": [
    {"level": N, "path": "...", "kb": N, "words": N, "tokens": N, "imported_by": "..." or null}
  ],
  "total_kb": N,
  "total_words": N,
  "total_tokens": N
}

Step 3 — Present the report

3.1 Print: Context overhead for: <path>

3.2 Print a table sorted by level (outermost first):

Level  File                              KB     Words   ~Tokens
-----  --------------------------------  -----  ------  -------
  0    CLAUDE.md                         1.2    210     280
  1    agents.md                         3.4    580     775
       (imported by CLAUDE.md)

Show (imported by <basename>) on a sub-line when imported_by is non-null.

3.3 Print totals:

Total: N files — X.X KB — Y words — ~Z tokens

3.4 Threshold flags:

  • If total_tokens >= 20000: [WARN] High context load: ~Z tokens. Consider trimming @-imports.
  • Else if total_tokens >= 8000: [NOTE] Moderate context load: ~Z tokens. Worth reviewing.
  • Otherwise: no flag.

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.