Skip to main content

RAYNSIS Footprint

Measure, trim and cap the startup context of a Claude Code install.

Every Claude Code session starts with a fixed load before you type anything: the system prompt, tool definitions, your CLAUDE.md, the memory index, the list of skills and agents, and whatever your SessionStart hooks print. That load is sent again with every turn, so it costs quota on every turn, and it only grows: memories pile up, skills get installed and never used. A session that opened at 46,000 tokens a month ago opens at 63,000 today, and on a 200k auto-compact window the status line shows 37% before the first message.

raynsis-footprint does three things:

  1. Measure the startup load from your own session transcripts and show what fills it.
  2. Trim it reversibly: park skills nobody invoked, archive memory pointers nobody touched.
  3. Cap it: a SessionStart hook that prints one line when a limit is exceeded and stays silent otherwise.

Python 3.9+, standard library only, works on Windows, macOS and Linux.

What it never does

  • It never deletes anything. Skills are moved to skills-parked/, memory lines are moved to MEMORY_ARCHIVE.md, settings.json and MEMORY.md are backed up with a timestamp before every write.
  • It never touches the network.
  • It never prints or copies the content of your conversations. Only counts, sizes, type names and file names.
  • It never changes anything without --apply.

Quick start

Windows (PowerShell):

git clone https://github.com/RAYNSIS/footprint
cd footprint
python -m raynsis_footprint measure --save
python -m raynsis_footprint skills --park --apply
python -m raynsis_footprint memory --apply
python -m raynsis_footprint install --apply

macOS and Linux: the same commands with your Python 3 interpreter.

Open a new session, then run python -m raynsis_footprint measure --save and python -m raynsis_footprint report.

Commands

All commands accept --home <dir>; the default is CLAUDE_CONFIG_DIR, or ~/.claude.

measure

sessions measured      2
  a1b2c3d4     63000 tokens  compactions 1  claude-test-1
  e5f6a7b8     61000 tokens  compactions 0  claude-test-1
startup tokens         min 61000  median 62000  max 63000
injected before the first reply (characters, newest session):
      31200  attachment:skill_listing
       9800  attachment:hook_additional_context:SessionStart
CLAUDE.md bytes        1400
memory index bytes     14200  (my-project)
user skills            54  (description characters 21000)
auto-compact window    200000  pct 70  model claude-test-1
gauge base             180000
startup share %        34.4
compact threshold      126000
working room           64000

The startup load of a session is the input of its first main-thread reply: input_tokens + cache_creation_input_tokens + cache_read_input_tokens. Agent transcripts are ignored. working room is how many tokens of conversation fit before auto-compact fires. --save appends the numbers to raynsis-footprint/snapshots.jsonl; --json prints everything as JSON.

skills

Counts how often each skill was invoked in the last 30 days, as a tool call or as a slash command. --park --apply moves the user skills that were never invoked to skills-parked/. --restore NAME or --restore-all moves them back. Plugin skills are reported, never moved.

memory

Keeps MEMORY.md an index. Reports lines longer than 150 characters, pointers to missing files, and lines whose every pointer targets a memory file that was neither modified nor mentioned in a session for 30 days. --apply moves those lines to MEMORY_ARCHIVE.md. The memory files themselves stay in place, so nothing is forgotten: the pointer is one grep away.

gate, install, uninstall

install --apply adds the gate as a SessionStart hook. The hook command is built from the Python interpreter that ran the install, with forward slashes, so it works on Windows where python3 is often an empty Store shortcut.

The gate prints one line per exceeded limit and nothing otherwise:

raynsis-footprint: last startup tokens 63000 over limit 55000

It always exits 0 and cannot break a session. Limits live in raynsis-footprint/limits.json:

{"memory_index_bytes": 9000, "claude_md_bytes": 3000, "user_skills": 40, "startup_tokens": 55000}

report

Before and after, from the first and the last saved snapshot.

Widening the window

If your plan gives you quota headroom, the auto-compact window is the other lever. In settings.json:

{"autoCompactWindow": 400000, "env": {"CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "55"}}

Claude Code compacts at (window - 20000) * pct / 100. A wider window gives more working room, and longer sessions cost more quota per turn, so trim first and widen second. measure shows both numbers.

Tests

python -m unittest tests.test_measure tests.test_trim tests.test_gate_install

License

Apache-2.0. See LICENSE and NOTICE.

Metadata

Release files for raynsis-footprint 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for raynsis-footprint 0.1.0
File Size Uploaded Provenance Actions
raynsis_footprint-0.1.0.tar.gz 22.2 kB Without provenance Details for raynsis_footprint-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for raynsis-footprint 0.1.0
File Interpreter ABI Platform Actions
raynsis_footprint-0.1.0-py3-none-any.whl Python 3 none any Details for raynsis_footprint-0.1.0-py3-none-any.whl

Total release size: 40.7 kB

Release files / raynsis_footprint-0.1.0.tar.gz

Download URL raynsis_footprint-0.1.0.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d1bc575ca9ff970ae67badb4f93b3bebd1398659e947c0f3bbde30e568952bb7
BLAKE2b-256 checksum
How to use checksums
f7584d499d26456f448519242320b372c4405d76325970d214b66a4b0b771004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Release files / raynsis_footprint-0.1.0-py3-none-any.whl

Download URL raynsis_footprint-0.1.0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc61c86b4b23dce07a26e30256b2a45768730a1f5829d96eeb93e765fc1333f1
BLAKE2b-256 checksum
How to use checksums
2f0afaecc39e11c517ed9fe68ff783e04d831ce1e759fe0d002ce99a1f57d0e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.16

Security for raynsis-footprint 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page