agentleFS
ppgrangerppgranger/token-saver/AGENTS.md

token-saver

AGENTS.md164 starsChanged 6 months agoApache-2.0View on GitHub

Token-Saver is a Python 3.10+ CLI-output compressor, with Claude Code and Antigravity adapters and a Jekyll documentation site. Compression runs locally and deterministically, without an LLM or network call in the compression path. This file applies to the repository. A nested AGENTS.md adds guidance for its directory; read it before editing there. CLAUDE.md describes plugin behavior and shell exclusions. Keep those guarantees consistent with code and tests. Use the Google Python Style Guide as the review standard; CONTRIBUTING.md documents project…

The file

We split this AGENTS.md into the rules it gives an agent

12 rules. About 0 are common, 6 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Use the Google Python Style Guide as the review standard.

    line 15
  2. Very specific:

    Import modules by absolute package names and qualify their members.

    line 20
  3. Very specific:

    Write meaningful Google-style docstrings for public interfaces and nontrivial behavior.

    line 22
  4. Very specific:

    Keep comprehensions simple: one for clause and at most one filter.

    line 25
  5. Distinctive:

    Keep parsing/compression, orchestration, persistence, CLI presentation, and platform integration separate.

    line 36
  6. Distinctive:

    Follow the existing Python 3.10 syntax and standard-library runtime approach.

    line 49
  7. Distinctive:

    Use explicit UTF-8 for text files and text subprocess output.

    line 50
  8. Distinctive:

    Run targeted tests while iterating.

    line 54
  9. Very specific:

    Use Ruff 0.15.15 and Pylint 4.0.5, matching pyproject.toml and the CI workflow.

    line 69
  10. Distinctive:

    Use temporary homes/data directories for installer, tracker, and config tests.

    line 77
  11. Very specific:

    Do not run installation, update, or uninstall commands against the developer's real profile just to validate a change.

    line 78
  12. Distinctive:

    Document measured savings as estimates with a reproducible scenario.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md 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
AGENTS.md

Working on Token-Saver

Token-Saver is a Python 3.10+ CLI-output compressor, with Claude Code and Antigravity adapters and a Jekyll documentation site. Compression runs locally and deterministically, without an LLM or network call in the compression path.

Read the relevant instructions

This file applies to the repository. A nested AGENTS.md adds guidance for its directory; read it before editing there. CLAUDE.md describes plugin behavior and shell exclusions. Keep those guarantees consistent with code and tests.

Python style

Use the Google Python Style Guide as the review standard; CONTRIBUTING.md documents project tooling and exceptions.

  • Format Python to 80 columns. Preserve literal fixture data when wrapping would change its meaning; justify any narrow exception rather than disabling a rule.
  • Import modules by absolute package names and qualify their members. Typing symbols from typing, typing_extensions, and collections.abc are exempt.
  • Write meaningful Google-style docstrings for public interfaces and nontrivial behavior. Describe relevant Args, Returns/Yields, Raises, and public Attributes; do not mechanically restate signatures or test names.
  • Keep comprehensions simple: one for clause and at most one filter. Use loops for nested traversal and preserve processing order.
  • Catch specific exceptions. A broad catch requires an explicit isolation boundary or re-raise; record suppressed failures without commands, captured output, secrets, exception text, or traceback locals.
  • Include the repository's Apache 2.0 header in Python files. Preserve third-party copyright and license notices, including .pylintrc. Explain unavoidable local suppressions beside the relevant code.

Design and compatibility

  • Keep parsing/compression, orchestration, persistence, CLI presentation, and platform integration separate. Prefer small interfaces and injected dependencies where a real boundary exists; avoid abstract wrappers that add no behavior or independent test seam.
  • Extend the processor contract for a new command family instead of adding command-specific branches to the engine or platform hooks.
  • Preserve public CLI behavior, processor extension points, return shapes, and installed-tree imports during refactors. New src subpackages need explicit packaging and installer coverage; current copying discovers top-level source modules and processor modules.
  • Preserve failure details and secret redaction ahead of compression ratios. A redacted result must never be replaced by its unredacted input merely because a size threshold was not met.
  • Follow the existing Python 3.10 syntax and standard-library runtime approach. Use explicit UTF-8 for text files and text subprocess output.

Validation

Run targeted tests while iterating. Before finishing changes to runtime code, run the applicable repository checks (the CI workflow is authoritative):

python3 -m pytest tests/ -q
ruff check . bin/token-saver
ruff format --check . bin/token-saver
python3 scripts/check_python_style.py
pylint --rcfile=.pylintrc src scripts installers antigravity/hook_aftertool.py \
  install.py examples/demo.py examples/custom_processor/ansible_output.py \
  bin/token-saver
mypy src/ scripts/ --ignore-missing-imports
python3 scripts/check_versions.py

Use Ruff 0.15.15 and Pylint 4.0.5, matching pyproject.toml and the CI workflow. The vendored Google Pylint configuration and Ruff serve complementary checks; Ruff owns quote normalization. For text I/O changes, also run the encoding check:

PYTHONWARNDEFAULTENCODING=1 python3 -W error::EncodingWarning -m pytest tests/ -q

Use temporary homes/data directories for installer, tracker, and config tests. Do not run installation, update, or uninstall commands against the developer's real profile just to validate a change. A normal benchmark and the wrapper's --dry-run execute their supplied command; use harmless fixture commands. CLI benchmark --dry-run only inspects routing, and benchmark --stdin uses already captured output without executing the command.

Keep public facts in sync

  • Configuration defaults: src/config.py and the README's Complete Parameter List; tests/test_readme_config_sync.py enforces both values and trust notes.
  • Processor additions/removals: discovery is automatic, but update public counts, documentation, failure fixtures, and relevant benchmark scenarios. Run tests/test_processor_count_consistency.py and tests/test_pattern_consistency.py.
  • Releases: src/__init__.py is the version source. Synchronize both Claude manifests, the Antigravity manifest, the benchmark version header, and a matching changelog entry; scripts/check_versions.py checks this. A routine refactor does not require inventing a release or bumping the version.
  • Document measured savings as estimates with a reproducible scenario; do not turn selective compression or tested preservation into universal guarantees.

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.