Local-first command wrapper for AI coding agents with compressed terminal output and privacy-safe proof metrics.
Project description
SAGE - Smart Agent Guidance Engine
SAGE is a local-first command wrapper for AI coding agents. It keeps full terminal output on your machine, sends agents a clean compressed summary, and tracks proof metrics without uploading your raw logs.
Use it with Claude Code, Codex, Cursor, Windsurf, OpenCode, Cline, custom agents, CI scripts, and normal terminal workflows.
Start Here: Install SAGE, Then Use Any AI Agent
Package installation is passive for package-registry safety. After installing, run sage install once to connect this machine and activate SAGE for supported local AI agents.
PyPI / pip
pip install psycgod-sage
# or
python -m pip install --upgrade psycgod-sage
sage install
sage run -- python -m pytest
npm / npx
npm install -g psycgod-sage
npx -y psycgod-sage install
npx -y psycgod-sage run -- npm test
After install, restart any open AI-agent sessions. New sessions should read the SAGE instructions automatically and route terminal commands through SAGE.
Example prompt after restarting your AI agent:
Please help me with my general book in this folder.
Natural shortcuts also work:
sage pytest
sage npm test
sage git status
These are treated as:
sage run -- pytest
sage run -- npm test
sage run -- git status
What SAGE Does
| Step | Result |
|---|---|
sage install |
Connects the machine, repairs global/project agent instructions, and verifies activation |
sage run -- <command> |
Runs the command, stores raw output locally, and returns a compact useful summary |
| Agent memory/hooks | Tell supported AI agents to use SAGE for noisy terminal work |
| Local database | Keeps command history, compression proof, and retry context on the user's machine |
| Optional cloud proof | Sends aggregate metrics only when connected proof mode is enabled |
SAGE does not auto-enable MCP. MCP is optional and manual for users who want it.
Live Proof
Latest pulled stats as of 2026-07-22:
| Metric | Value |
|---|---|
| SAGE telemetry command events | 23,081 |
| Tokens processed | 750.0M |
| Tokens saved | 736.1M |
| Compression rate | 98.14% |
| Estimated savings | $15,273.07 |
| Command success rate | 89.7% |
| PyPI downloads, last 7 days | 885 |
| npm downloads, last 7 days | 1,268 |
| GitHub clones, last 14 days | 1,635 |
Live dashboard: sage.api.marketingstudios.in/dashboard Install page: sage.api.marketingstudios.in/install
Why It Helps
AI coding agents burn context on repeated logs, failed test output, install noise, stack traces, and build spam. SAGE sits between the command and the agent.
| Without SAGE | With SAGE |
|---|---|
| Agent sees full noisy terminal output | Agent sees the useful summary |
| Context disappears fast | Context lasts longer |
| Repeated failures waste tokens | Errors are grouped and explained |
| Raw logs may enter prompts | Raw logs stay local |
| Hard to prove savings | SAGE records proof metrics |
Distribution
| Channel | Package | Status |
|---|---|---|
| PyPI | psycgod-sage |
Canonical Python package |
| npm / npx | psycgod-sage |
Node launcher for the Python core |
| MCP Registry | io.github.PsYcGoD/sage |
Optional/manual MCP entry |
| Glama | PsYcGoD/sage |
Optional/manual hosted MCP listing |
The npm package delegates to the Python implementation so both install paths use the same local database, telemetry rules, compression, and command behavior.
Common Commands
sage install # Activate this machine and AI-agent instructions
sage doctor --activation # Verify activation
npx -y psycgod-sage doctor --activation
sage run -- <command> # Wrap any command
sage pytest # Shortcut for: sage run -- pytest
sage npm test # Shortcut for: sage run -- npm test
sage git status # Shortcut for: sage run -- git status
sage context stats # Token savings summary
sage context report # Full compression report
sage history --limit 10 # Recent command history
sage explain --failed # Explain the latest failed command
sage suggest --failed # Suggest the next fix
sage fix --apply # Try an automatic fix
sage ml setup # Optional ML V2 dependencies
sage mcp install # Optional/manual MCP config
sage dashboard start # Local dashboard
Privacy Modes
| Mode | Requires login? | Sends data? | What leaves the machine? |
|---|---|---|---|
| Local-only | No | No | Nothing |
| Connected proof | Machine auth | Yes | Aggregate counters and proof metrics |
| Debug telemetry | Optional | Opt-in only | Redacted diagnostic summaries |
SAGE is designed to keep prompts, source code, credentials, raw command output, and project files local unless the user deliberately enables a feature that requires sending data.
Known Limitations
| Limitation | What To Do |
|---|---|
| Already-open AI-agent sessions may not reload new instructions | Restart Claude/Codex/Cursor/Windsurf/OpenCode after sage install |
| Locked-down host apps can disable shell tools | SAGE cannot enable tools the host application has blocked |
| npm/PyPI installs cannot safely auto-run activation | Run sage install once after package install |
| MCP can disconnect in some stdio agent sessions | Use normal sage run -- <command> by default; enable MCP manually only if needed |
| Package installs are passive by design | Real activation starts with sage install |
Demos
| Flow | Preview |
|---|---|
| PyPI install | |
| npm install | |
sage run -- |
|
| CLI run |
Team View Preview - Enterprise Only
Team View is not part of the free public CLI package. It is a future enterprise dashboard concept for organizations that need shared usage proof, team-level savings, and admin reporting.
Links
- Landing: sage.api.marketingstudios.in
- Dashboard: sage.api.marketingstudios.in/dashboard
- Install guide: sage.api.marketingstudios.in/install
- PyPI: pypi.org/project/psycgod-sage
- npm: npmjs.com/package/psycgod-sage
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file psycgod_sage-2.5.7.tar.gz.
File metadata
- Download URL: psycgod_sage-2.5.7.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d01c988b65e7d876eb9b49c259dca7e19026f8517a25931c6b86dd44d48627db
|
|
| MD5 |
39ed1c3a5ccd3b25f6dac6334f9722cd
|
|
| BLAKE2b-256 |
e724e986e5696932cd1e5a991a4af5b7c55d8c073f0af4becb777f54e8a50b66
|
Provenance
The following attestation bundles were made for psycgod_sage-2.5.7.tar.gz:
Publisher:
pypi-publish.yml on PsYcGoD/sage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
psycgod_sage-2.5.7.tar.gz -
Subject digest:
d01c988b65e7d876eb9b49c259dca7e19026f8517a25931c6b86dd44d48627db - Sigstore transparency entry: 2224336709
- Sigstore integration time:
-
Permalink:
PsYcGoD/sage@50a6868313d290513614f63a9f43b633593240d2 -
Branch / Tag:
refs/tags/v2.5.7 - Owner: https://github.com/PsYcGoD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@50a6868313d290513614f63a9f43b633593240d2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file psycgod_sage-2.5.7-py3-none-any.whl.
File metadata
- Download URL: psycgod_sage-2.5.7-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07e5956ca2c7dd2e8adadd2349d78b1ac2fd4663927c8c6ed43e69fa5df4092c
|
|
| MD5 |
5a58b270b81d9b31e576177a1cb3d901
|
|
| BLAKE2b-256 |
18df24b5336bf77c7bca048115037934eaabfe4490ed83654d1142469b01f8d9
|
Provenance
The following attestation bundles were made for psycgod_sage-2.5.7-py3-none-any.whl:
Publisher:
pypi-publish.yml on PsYcGoD/sage
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
psycgod_sage-2.5.7-py3-none-any.whl -
Subject digest:
07e5956ca2c7dd2e8adadd2349d78b1ac2fd4663927c8c6ed43e69fa5df4092c - Sigstore transparency entry: 2224337382
- Sigstore integration time:
-
Permalink:
PsYcGoD/sage@50a6868313d290513614f63a9f43b633593240d2 -
Branch / Tag:
refs/tags/v2.5.7 - Owner: https://github.com/PsYcGoD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@50a6868313d290513614f63a9f43b633593240d2 -
Trigger Event:
release
-
Statement type: