Command output was written for humans with scrollback, not for a model with a context window. sctx wraps the commands your agent already runs and re-renders them token-minimally — then tells you exactly how much it saved.
Measured across 8.2K real wrapped commands — 2.1M raw tokens rendered down to 918K. Not a benchmark; actual work on developer machines.
Every elision carries an explicit …+N marker, so the agent always knows something was omitted. Compression that silently drops lines is worse than none.
A hook rewrites covered commands transparently. You keep typing go test ./...; your agent receives the compact rendering.
Prebuilt binaries for macOS, Linux and Windows. Statically linked, no runtime dependencies, and nothing to configure before it starts working.
brew install synapctx/tap/sctx
Grab the darwin_arm64 (Apple Silicon) or darwin_amd64 (Intel) archive from Releases, then:
tar -xzf sctx_<version>_darwin_arm64.tar.gz
sudo install -m 0755 sctx sctxd /usr/local/bin/
Builds from source with a Go 1.26+ toolchain. Installs to $GOBIN, so it must be on your PATH.
go install github.com/synapctx/sctx/cmd/sctx@latest
brew install synapctx/tap/sctx
Grab the linux_amd64 or linux_arm64 archive from Releases, then:
tar -xzf sctx_<version>_linux_amd64.tar.gz
sudo install -m 0755 sctx sctxd /usr/local/bin/
Builds from source with a Go 1.26+ toolchain. Installs to $GOBIN, so it must be on your PATH.
go install github.com/synapctx/sctx/cmd/sctx@latest
Grab the windows_amd64 or windows_arm64 archive from Releases, then, in PowerShell:
Expand-Archive sctx_<version>_windows_amd64.zip `
-DestinationPath $env:LOCALAPPDATA\Programs\sctx
# then add that directory to your PATH
Builds from source with a Go 1.26+ toolchain. Installs to $GOBIN, so it must be on your PATH.
go install github.com/synapctx/sctx/cmd/sctx@latest
sctx works the moment it is installed — put it in front of any command. To have it applied automatically, run:
sctx setup --install
This detects which AI coding agents are on your machine and, for each one, writes a short instruction file describing what sctx is and when to use it. For Claude Code it also registers a hook, so commands are wrapped as they are issued: you and your agent keep writing go test ./..., and the compact output is what arrives.
It writes only where an agent has already left its own configuration, never creates one speculatively, and will not overwrite a file you have edited. Below is what it writes for each agent — to read before installing anything, or to follow by hand.
Your coding agent~/.config/opencode/AGENTS.md@file include mechanism, so a reference would be a line that silently loads nothing — the text goes in directly instead. That is 2579 bytes loading into every session, which is why it is short.Append the block to ~/.config/opencode/AGENTS.md:
curl -fsSL 'https://synapctx.com/sctx/block.md?agent=opencode' >> ~/.config/opencode/AGENTS.md
This installs the instructions, not the hook. Doing it by hand tells your agent what sctx is, so it stops re-explaining compact output — but for Claude Code the PreToolUse hook is what wraps commands automatically, and only sctx setup --install registers it.
Appending is a one-off, and it assumes the agent is already installed: if the directory does not exist, creating it would leave a file nothing ever reads.
~/.config/opencode/AGENTS.md@file include mechanism, so a reference would be a line that silently loads nothing — the text goes in directly instead. That is 2579 bytes loading into every session, which is why it is short.Append the block to ~/.config/opencode/AGENTS.md:
curl -fsSL 'https://synapctx.com/sctx/block.md?agent=opencode' >> ~/.config/opencode/AGENTS.md
This installs the instructions, not the hook. Doing it by hand tells your agent what sctx is, so it stops re-explaining compact output — but for Claude Code the PreToolUse hook is what wraps commands automatically, and only sctx setup --install registers it.
Appending is a one-off, and it assumes the agent is already installed: if the directory does not exist, creating it would leave a file nothing ever reads.
%USERPROFILE%\.config\opencode\AGENTS.md@file include mechanism, so a reference would be a line that silently loads nothing — the text goes in directly instead. That is 2579 bytes loading into every session, which is why it is short.Append the block to %USERPROFILE%\.config\opencode\AGENTS.md:
Add-Content -Path "$env:USERPROFILE\.config\opencode\AGENTS.md" -Encoding utf8 -Value (iwr 'https://synapctx.com/sctx/block.md?agent=opencode' -UseBasicParsing).Content
This installs the instructions, not the hook. Doing it by hand tells your agent what sctx is, so it stops re-explaining compact output — but for Claude Code the PreToolUse hook is what wraps commands automatically, and only sctx setup --install registers it.
Appending is a one-off, and it assumes the agent is already installed: if the directory does not exist, creating it would leave a file nothing ever reads.
Exactly these bytes, markers included — the same ones sctx setup writes:
<!-- BEGIN SYNAPCTX — managed by `sctx setup`; edits inside are replaced -->
# sctx — token-optimized command output
`sctx` runs a developer command and re-renders its output token-minimally.
It exists because command output is the largest uncontrolled cost in an agent
session: a test run, a `git log`, a `kubectl get` can each spend thousands
of tokens restating things you do not need.
## What it guarantees
Read these once — they are why you can act on compressed output instead of
re-running the command verbatim to check.
- **The exit code is exact.** Never inferred from the text.
- **Error signal is never compressed away.** A failing command keeps its
diagnostics; compression targets repetition and noise, not failure.
- **Every elision is marked** — `…+N` (N more lines) or `×N` (repeated N
times). If you see no marker, nothing was dropped.
- **Any parse failure degrades to raw output.** Tiers fall back
aggressive → relaxed → verbatim. Output is never suppressed, so an unexpected
format costs you nothing.
## You do not need to type it
A PreToolUse hook rewrites covered commands automatically. **Write commands
naturally** — including inside pipelines and `&&` sequences. Do not prefix
`sctx` yourself on a covered command: it is not double-wrapped, but the
token is wasted and the command reads as though it needed help.
Covered today: `go`, `git`, `grep`/`rg`, `ls`/`find`/`tree`,
`cat`/`head`/`tail`, `diff`, `ps`, `du`, `make`,
`golangci-lint`, `gh`, `docker`, `kubectl`, `pytest`,
`ruff`, `mypy`, `pip`, `npm`/`pnpm`/`yarn`, `brew`,
`mongosh`, `ssh` (delegates to the remote command's formatter),
`rsync`, `jq`/`curl`. `sctx doctor` prints the effective list.
**Where the hook declines, and why it matters to you.** It leaves a command
alone when wrapping could change what you conclude:
- a downstream `grep`/`sed`/`awk`/`wc`/`jq` — filtering already-compressed
output would make something look ABSENT that is merely elided;
- file redirects (`> out.txt`), command substitution (`$(…)`), subshells.
`2>&1` is fine, and so are pure pagers (`| head`, `| tail`).
## When to type it yourself
**When you are about to run something NOT in the list above and its output will
be long.** `sctx <cmd>` still helps: JSON stdout is compacted automatically
and repeated lines are collapsed, whatever the program.
`sctx -- <cmd>` forces verbatim passthrough when you genuinely need every
byte.
## Reporting
`sctx gain` shows tokens saved (`--project`, `--since 7d`,
`--format json`). `sctx gain --failures` lists commands that saved
nothing — the fastest way to find an output shape worth compressing.
<!-- END SYNAPCTX -->
The markers are not decoration. They are how sctx setup later recognises the block as its own and replaces it in place; without them a reinstall appends a second copy, and both load into every session from then on.
Using an agent that is not listed? What goes in the file is plain Markdown — put it wherever your tool reads its global instructions, and open an issue so detection can cover it. The document is also readable on its own at /sctx/SCTX.md.
Confirm the install and see the effective configuration with sctx version and sctx doctor.
Keep sctx and sctxd in the same directory — sctx watch looks for its helper beside its own executable, so a matched pair always wins over an older copy elsewhere on PATH.
sctx parses what it recognises and degrades safely when it does not. The guiding rule is that a wrong answer costs far more than a large one.
Each command renders through aggressive (structured parse) → relaxed (heuristic filtering) → verbatim. Any parse failure, panic or anomaly falls to the next tier. Output is never suppressed.
The wrapped command’s exit status passes through untouched, with signal forwarding intact. Your scripts and CI cannot tell sctx is there.
When a command fails, sctx compresses the surrounding noise and leaves the error intact. A stack trace is the one thing you never want summarised.
sctx gain reports savings locally, per command and per repository. The same numbers roll up to your console so you can see where the context budget actually goes.
Commands still compress inside pipelines and && chains. sctx declines only where wrapping would be lossy — a downstream filter, a redirect, a subshell.
Telemetry is fire-and-forget and strictly budgeted. With no network it spools locally and drains later; it never delays your output.
Recognised commands get a purpose-built renderer. Anything else passes through untouched, with JSON output compacted automatically.
Build, test and lint, whatever the language.
| Area | Commands with a dedicated renderer |
|---|---|
| Go | go test, go build, go vet, go run, go mod, go list, go get; golangci-lint |
| Python | pytest, ruff, mypy, pip |
| JavaScript | npm, pnpm, yarn |
Recursive search is the noisiest output a developer produces, and the most compressible.
| Area | Commands with a dedicated renderer |
|---|---|
| Search | rg, grep, find |
Listing and reading. Content that carries meaning is passed through, not compressed.
| Area | Commands with a dedicated renderer |
|---|---|
| Files | ls, tree, cat, head, tail, diff, du |
Version control, including the GitHub CLI — fetching a PR is version-control work.
| Area | Commands with a dedicated renderer |
|---|---|
| Git | status, log, diff, show, branch, blame, stash |
| GitHub CLI | gh |
What is running, locally or in a cluster.
| Area | Commands with a dedicated renderer |
|---|---|
| Containers | docker, docker compose |
| Kubernetes | kubectl |
Shell and remote work.
| Area | Commands with a dedicated renderer |
|---|---|
| Build & shell | make, curl, jq |
| Remote | ssh, rsync |
| Other | brew, mongosh |
Anything not listed still runs untouched — sctx never stands between you and a command it does not understand.
Live figures from every wrapped command sctx has reported, refreshed continuously. Not a benchmark and not a projection — sctx records both the raw output and what the agent received, so the difference is measured.
Measured from real command runs across every organization on the platform, not a benchmark — and today that means our own machines, because SynapCTX is in open beta. Your figures will differ with your codebase and how noisy your tools are: a recursive search compresses enormously, a file dump barely at all, because sctx leaves output that carries meaning alone.
sctx is complete as a local tool and always will be. SynapCTX is a separate product it can report into — useful, and entirely optional.
Free forever
sctx setup, all tierssctx gain — your savings, stored locallyAdds the org-wide view
sctx watch keeps your uncommitted work visible to retrieval, so answers describe the code in front of you rather than the last commitIf you want the dashboard side, every plan starts with a 14-day trial and no card. If you only ever want the free tool, that is a complete and supported way to use sctx — see what a plan adds.
Yes — free and MIT-licensed, with no account required for anything on this page. It is not a plan benefit that disappears if a subscription lapses: the tool, the formatters, the hook and your local savings history are yours whether or not you ever create a SynapCTX account.
It is built specifically to avoid that. Every omission is marked with a count, a render that is empty or not actually smaller is rejected in favour of the raw output, and anything it cannot parse confidently passes through verbatim.
Rendering is measured in milliseconds for typical output, and telemetry never blocks delivery. The dominant cost stays the command itself.
Yes. sctx -- <command> forces verbatim passthrough, and an environment switch disables rewriting entirely when you want the raw firehose.
No. Telemetry records what was saved — command name, token counts, timings — never your command output, arguments, or source.
brew install synapctx/tap/sctx, go install github.com/synapctx/sctx/cmd/sctx@latest, or a prebuilt archive from Releases — see the install section. Source is on GitHub under the MIT licence.
Not for anything on this page. An account adds the org-wide half — savings rolled up in a dashboard, retrieval across every repository, and sctx watch keeping your uncommitted work visible to it. Without one, nothing about sctx degrades; you simply keep your savings history locally, where sctx gain reads it.
One command, no account, and your agent stops reading output nobody chose.
brew install synapctx/tap/sctx
Want the savings rolled up across your team, and retrieval over every repository? SynapCTX plans start with a 14-day trial and no card.