agentleFS
ppgrangerppgranger/token-saver/src/AGENTS.md

token-saver / src

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

- Apply the root Google Python style policy. Use absolute module imports and document public contracts, including output shape, redaction, and failure behavior. Runtime error isolation must record only content-free diagnostics. - Keep processors focused on transforming command output. Keep subprocess execution and platform JSON in adapters, persistence in the tracker, and presentation in CLI/stats code. The engine coordinates these contracts. - Preserve CompressionEngine.compress() and core.compress() compatibility when moving implementation details. Existing callers and user processors must continue to work…

The file

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

4 rules. About 1 is common, 2 are distinctive, and 1 is very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep processors focused on transforming command output.

    line 6
  2. Distinctive:

    Treat unavailable diagnostics/persistence as best effort: they must not prevent the user's command output from being returned.

    line 12
  3. Common:

    Run redaction before accepting any fallback path that could disclose the original text.

    line 18
  4. Very specific:

    Keep configuration precedence: defaults, global file, project file, environment.

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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

Runtime boundaries

  • Apply the root Google Python style policy. Use absolute module imports and document public contracts, including output shape, redaction, and failure behavior. Runtime error isolation must record only content-free diagnostics.
  • Keep processors focused on transforming command output. Keep subprocess execution and platform JSON in adapters, persistence in the tracker, and presentation in CLI/stats code. The engine coordinates these contracts.
  • Preserve CompressionEngine.compress() and core.compress() compatibility when moving implementation details. Existing callers and user processors must continue to work without platform-specific dependencies.
  • Treat unavailable diagnostics/persistence as best effort: they must not prevent the user's command output from being returned. Do not silently turn a failed command into a successful result.
  • On a known nonzero exit status, only processors that opt into failure handling may use specialized compression. Keep the generic fallback and critical-line recovery behavior covered by precision tests.
  • Run redaction before accepting any fallback path that could disclose the original text. Redaction must also survive processor chaining, size gates, and error recovery; recovered lines must not reintroduce secrets.
  • Keep configuration precedence: defaults, global file, project file, environment. Project configuration must not control user_processors_dir, disabled_processors, or redaction_allowlist. Validate values at the configuration boundary and update the README when defaults change.
  • Token counts derived from chars_per_token are estimates. Do not label them exact model usage or billing savings.
  • Reuse data_dir() and platform helpers for paths. Preserve Linux, macOS, and Windows behavior; tests must not depend on the developer's actual config, processor directory, or savings database.

For orchestration changes, start with tests/test_engine.py, tests/test_core.py, tests/test_precision.py, and tests/test_compression_ratchet.py. Run CLI/config/tracker tests when those boundaries change. Read src/processors/AGENTS.md before editing processors.

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.