Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
sctx
command
sctx is the SynapCTX token-optimizing command wrapper: it runs developer commands and re-renders their output in a token-minimal form for AI agents, accounting the savings locally (`sctx gain`) and org-wide via the SynapCTX platform.
|
sctx is the SynapCTX token-optimizing command wrapper: it runs developer commands and re-renders their output in a token-minimal form for AI agents, accounting the savings locally (`sctx gain`) and org-wide via the SynapCTX platform. |
|
internal
|
|
|
adapters/exec/osproc
Package osproc runs wrapped commands via os/exec with exact exit-code fidelity, signal forwarding to the child, and bounded-memory output capture.
|
Package osproc runs wrapped commands via os/exec with exact exit-code fidelity, signal forwarding to the child, and bounded-memory output capture. |
|
adapters/format/brew
Package brew implements a format.Formatter for the Homebrew CLI, covering `brew install` and `brew upgrade`.
|
Package brew implements a format.Formatter for the Homebrew CLI, covering `brew install` and `brew upgrade`. |
|
adapters/format/collapse
Package collapse holds the line-run collapsing that several formatters share: runs of blank lines, runs of identical lines, and runs of log lines that are identical once a leading timestamp is stripped.
|
Package collapse holds the line-run collapsing that several formatters share: runs of blank lines, runs of identical lines, and runs of log lines that are identical once a leading timestamp is stripped. |
|
adapters/format/dig
Package dig filters stable protocol metadata from native full `dig` output while preserving the DNS response header, flags, question, records, timing, server, warnings, and any line it does not explicitly recognize.
|
Package dig filters stable protocol metadata from native full `dig` output while preserving the DNS response header, flags, question, records, timing, server, warnings, and any line it does not explicitly recognize. |
|
adapters/format/docker
Package docker implements a format.Formatter for the docker CLI.
|
Package docker implements a format.Formatter for the docker CLI. |
|
adapters/format/du
Package du implements a format.Formatter for `du`.
|
Package du implements a format.Formatter for `du`. |
|
adapters/format/filediff
Package filediff implements a format.Formatter for the `diff` CLI.
|
Package filediff implements a format.Formatter for the `diff` CLI. |
|
adapters/format/fs
Package fs formats the output of common filesystem inspection commands (ls, find, tree) into token-minimal representations for AI agents.
|
Package fs formats the output of common filesystem inspection commands (ls, find, tree) into token-minimal representations for AI agents. |
|
adapters/format/generic
Package generic is the fallback formatter for commands no dedicated formatter claims.
|
Package generic is the fallback formatter for commands no dedicated formatter claims. |
|
adapters/format/gh
Package gh implements native-output formatters for the GitHub CLI.
|
Package gh implements native-output formatters for the GitHub CLI. |
|
adapters/format/git
Package git implements a format.Formatter for the git CLI.
|
Package git implements a format.Formatter for the git CLI. |
|
adapters/format/gofmt
Package gofmt implements a format.Formatter for the `gofmt` CLI.
|
Package gofmt implements a format.Formatter for the `gofmt` CLI. |
|
adapters/format/golangcilint
Package golangcilint implements a format.Formatter for golangci-lint.
|
Package golangcilint implements a format.Formatter for golangci-lint. |
|
adapters/format/gotest
Package gotest formats output from the `go` CLI (test, build, vet, and other subcommands) into a token-minimal rendering.
|
Package gotest formats output from the `go` CLI (test, build, vet, and other subcommands) into a token-minimal rendering. |
|
adapters/format/grep
Package grep formats grep and ripgrep match output.
|
Package grep formats grep and ripgrep match output. |
|
adapters/format/jsoncompact
Package jsoncompact is the content-sniff fallback formatter: when no argv-matched formatter claims a command but its stdout is valid JSON (e.g.
|
Package jsoncompact is the content-sniff fallback formatter: when no argv-matched formatter claims a command but its stdout is valid JSON (e.g. |
|
adapters/format/jsonlines
Package jsonlines detects and safely bounds JSON Lines / NDJSON streams.
|
Package jsonlines detects and safely bounds JSON Lines / NDJSON streams. |
|
adapters/format/kubectl
Package kubectl implements a format.Formatter for the kubectl CLI.
|
Package kubectl implements a format.Formatter for the kubectl CLI. |
|
adapters/format/makefmt
This file delegates the region of `make`'s output that came from a recognisable inner tool — `go test`/`go vet`/`go build`, or `golangci-lint run` — to that tool's own formatter, reusing its parser rather than forking it.
|
This file delegates the region of `make`'s output that came from a recognisable inner tool — `go test`/`go vet`/`go build`, or `golangci-lint run` — to that tool's own formatter, reusing its parser rather than forking it. |
|
adapters/format/mongosh
Package mongosh implements a format.Formatter for `mongosh` (the MongoDB Shell).
|
Package mongosh implements a format.Formatter for `mongosh` (the MongoDB Shell). |
|
adapters/format/mypy
Package mypy implements a format.Formatter for mypy (Python static type checker) output.
|
Package mypy implements a format.Formatter for mypy (Python static type checker) output. |
|
adapters/format/nested
Package nested contains the shared mechanics for delegating a transport's captured streams to the formatter for its finite inner command.
|
Package nested contains the shared mechanics for delegating a transport's captured streams to the formatter for its finite inner command. |
|
adapters/format/npm
Package npm implements a format.Formatter for the npm, pnpm, and yarn JavaScript package-manager CLIs.
|
Package npm implements a format.Formatter for the npm, pnpm, and yarn JavaScript package-manager CLIs. |
|
adapters/format/pip
Package pip implements a format.Formatter for pip/pip3 output.
|
Package pip implements a format.Formatter for pip/pip3 output. |
|
adapters/format/projectfilter
Package projectfilter implements declarative, explicitly trusted filters for project-specific commands.
|
Package projectfilter implements declarative, explicitly trusted filters for project-specific commands. |
|
adapters/format/psproc
Package psproc implements a format.Formatter for `ps`.
|
Package psproc implements a format.Formatter for `ps`. |
|
adapters/format/psql
Package psql bounds validated native psql result sets.
|
Package psql bounds validated native psql result sets. |
|
adapters/format/pytest
Package pytest formats output from the `pytest` CLI into a token-minimal rendering.
|
Package pytest formats output from the `pytest` CLI into a token-minimal rendering. |
|
adapters/format/read
Package read implements a shared format.Formatter for cat, head, and tail: three thin instances over one set of internals, since these commands render identically (JSON/JSONL-sniff delegation on the aggressive tier, generic blank/dupe/timestamped-repeat collapsing on the relaxed tier).
|
Package read implements a shared format.Formatter for cat, head, and tail: three thin instances over one set of internals, since these commands render identically (JSON/JSONL-sniff delegation on the aggressive tier, generic blank/dupe/timestamped-repeat collapsing on the relaxed tier). |
|
adapters/format/rsync
Package rsync implements a format.Formatter for `rsync`.
|
Package rsync implements a format.Formatter for `rsync`. |
|
adapters/format/ruff
Package ruff implements a format.Formatter for ruff, the Python linter/formatter.
|
Package ruff implements a format.Formatter for ruff, the Python linter/formatter. |
|
adapters/format/sed
Package sed implements a format.Formatter for the narrow, provably-safe sed invocations that are actually a READ: `sed -n 'A,Bp' FILE` and `sed -n '/re/p' FILE`.
|
Package sed implements a format.Formatter for the narrow, provably-safe sed invocations that are actually a READ: `sed -n 'A,Bp' FILE` and `sed -n '/re/p' FILE`. |
|
adapters/format/ssh
Package ssh implements a format.Formatter for `ssh` by delegating to the formatter for the REMOTE command.
|
Package ssh implements a format.Formatter for `ssh` by delegating to the formatter for the REMOTE command. |
|
adapters/hook
This file implements `sctx hook claude`, the Claude Code PreToolUse Bash hook: it reads a tool-call JSON payload on stdin and, when the command matches a known rewrite rule (see rewrite.go), prints an "updatedInput" JSON directive on stdout that prefixes the command with "sctx ".
|
This file implements `sctx hook claude`, the Claude Code PreToolUse Bash hook: it reads a tool-call JSON payload on stdin and, when the command matches a known rewrite rule (see rewrite.go), prints an "updatedInput" JSON directive on stdout that prefixes the command with "sctx ". |
|
adapters/stats/sqlite
Package sqlite persists run accounting in a single local SQLite database (pure-Go driver, WAL mode) so concurrent sctx invocations can record safely and `sctx gain` can aggregate cheaply.
|
Package sqlite persists run accounting in a single local SQLite database (pure-Go driver, WAL mode) so concurrent sctx invocations can record safely and `sctx gain` can aggregate cheaply. |
|
adapters/telemetry/spool
Package spool implements offline-safe telemetry: Emit appends one JSONL line to a local spool file and returns immediately; Flush opportunistically POSTs the spooled batch to the developer-mcp-proxy under a strict deadline.
|
Package spool implements offline-safe telemetry: Emit appends one JSONL line to a local spool file and returns immediately; Flush opportunistically POSTs the spooled batch to the developer-mcp-proxy under a strict deadline. |
|
application/report
Package report renders the `sctx gain` token-savings report from the local stats store.
|
Package report renders the `sctx gain` token-savings report from the local stats store. |
|
application/run
Package run orchestrates the wrap-a-command use case: resolve a formatter, execute the child, render its output through the tier chain, account tokens, and emit stats plus telemetry.
|
Package run orchestrates the wrap-a-command use case: resolve a formatter, execute the child, render its output through the tier chain, account tokens, and emit stats plus telemetry. |
|
domain/exec
Package exec defines the port for running a wrapped command with exact exit-code fidelity and bounded-memory output capture.
|
Package exec defines the port for running a wrapped command with exact exit-code fidelity and bounded-memory output capture. |
|
domain/format
Package format defines the formatter port: how sctx re-renders a wrapped command's output in a token-minimal form, and the tier model used to degrade safely when a structured parse is not possible.
|
Package format defines the formatter port: how sctx re-renders a wrapped command's output in a token-minimal form, and the tier model used to degrade safely when a structured parse is not possible. |
|
domain/stats
Package stats defines the local token-savings accounting model behind `sctx gain`.
|
Package stats defines the local token-savings accounting model behind `sctx gain`. |
|
domain/telemetry
Package telemetry defines the fire-and-forget usage-event port feeding the SynapCTX platform (org-wide savings on the management console).
|
Package telemetry defines the fire-and-forget usage-event port feeding the SynapCTX platform (org-wide savings on the management console). |
|
platform/agentenv
Package agentenv identifies which coding agent, and which of its sessions, is driving the current process.
|
Package agentenv identifies which coding agent, and which of its sessions, is driving the current process. |
|
platform/agentsetup
Package agentsetup inspects and repairs the agent-side delivery path of a SynapCTX install: the instruction files that tell a coding agent when to reach for `sctx` and SynapCTX, plus the Codex MCP registrations that make those tools exist.
|
Package agentsetup inspects and repairs the agent-side delivery path of a SynapCTX install: the instruction files that tell a coding agent when to reach for `sctx` and SynapCTX, plus the Codex MCP registrations that make those tools exist. |
|
platform/binaries
Package binaries answers "which copies of a program exist on this machine, and what version does each report" — the question behind `sctx doctor` warning about a SHADOWED or stale sctx: a customer with a dev build ahead of a Homebrew one on PATH sees the dev build run while an installed hook still calls the older one, and nothing about that is visible from inside either binary alone.
|
Package binaries answers "which copies of a program exist on this machine, and what version does each report" — the question behind `sctx doctor` warning about a SHADOWED or stale sctx: a customer with a dev build ahead of a Homebrew one on PATH sees the dev build run while an installed hook still calls the older one, and nothing about that is visible from inside either binary alone. |
|
platform/config
Package config binds SCT__ environment variables (naming conventions) to the CLI configuration.
|
Package config binds SCT__ environment variables (naming conventions) to the CLI configuration. |
|
platform/dockerargv
Package dockerargv parses Docker's stable global argv and the nested `docker compose` command grammar.
|
Package dockerargv parses Docker's stable global argv and the nested `docker compose` command grammar. |
|
platform/ghargv
Package ghargv parses GitHub CLI's stable global argv and classifies the read-only command surface that sctx can safely buffer.
|
Package ghargv parses GitHub CLI's stable global argv and classifies the read-only command surface that sctx can safely buffer. |
|
platform/gitargv
Package gitargv parses Git's stable global argv and classifies invocations that cannot safely be buffered by sctx.
|
Package gitargv parses Git's stable global argv and classifies invocations that cannot safely be buffered by sctx. |
|
platform/gitrepo
Package gitrepo detects the "org/repo" identity of the git repository containing a directory, purely by parsing on-disk git metadata (no shelling out to git) so telemetry can attribute events per repository without adding startup latency.
|
Package gitrepo detects the "org/repo" identity of the git repository containing a directory, purely by parsing on-disk git metadata (no shelling out to git) so telemetry can attribute events per repository without adding startup latency. |
|
platform/httpclient
Package httpclient builds the one User-Agent string every HTTP call sctx makes must send, so the server-side telemetry ingest and MCP proxy can tell sctx traffic apart from the generic Go-http-client default and from each other's client environment.
|
Package httpclient builds the one User-Agent string every HTTP call sctx makes must send, so the server-side telemetry ingest and MCP proxy can tell sctx traffic apart from the generic Go-http-client default and from each other's client environment. |
|
platform/iospill
Package iospill provides a bounded-memory output capture: bytes are held in memory up to a threshold and spill to a temporary file beyond it, so a wrapped command with gigabytes of output cannot exhaust memory.
|
Package iospill provides a bounded-memory output capture: bytes are held in memory up to a threshold and spill to a temporary file beyond it, so a wrapped command with gigabytes of output cannot exhaust memory. |
|
platform/kubectlargv
Package kubectlargv parses the stable, global portion of kubectl's argv.
|
Package kubectlargv parses the stable, global portion of kubectl's argv. |
|
platform/nestedcmd
Package nestedcmd defines the conservative command grammar shared by transport formatters that delegate output to an inner command formatter.
|
Package nestedcmd defines the conservative command grammar shared by transport formatters that delegate output to an inner command formatter. |
|
platform/progkey
Package progkey derives the program key that identifies a command in telemetry: either "program" or "program subcommand", never anything more.
|
Package progkey derives the program key that identifies a command in telemetry: either "program" or "program subcommand", never anything more. |
|
platform/rawcache
Package rawcache stores short-lived, owner-only copies of command output when a formatter explicitly reports that it omitted content.
|
Package rawcache stores short-lived, owner-only copies of command output when a formatter explicitly reports that it omitted content. |
|
platform/redact
Package redact scrubs secrets from the final rendered bytes of a command's output.
|
Package redact scrubs secrets from the final rendered bytes of a command's output. |
|
platform/sedargv
Package sedargv shares the recognition grammar for the two sed invocation shapes that are actually a READ (an untransformed subset of a file's own lines) rather than a stream-editing transform: both the hook's wrap decision and the formatter's own recognition guard must agree on exactly which shapes are safe, or one buffers what the other refuses to render.
|
Package sedargv shares the recognition grammar for the two sed invocation shapes that are actually a READ (an untransformed subset of a file's own lines) rather than a stream-editing transform: both the hook's wrap decision and the formatter's own recognition guard must agree on exactly which shapes are safe, or one buffers what the other refuses to render. |
|
platform/sshargv
Package sshargv extracts finite remote commands from OpenSSH argv.
|
Package sshargv extracts finite remote commands from OpenSSH argv. |
|
platform/tokenizer
Package tokenizer estimates token counts from byte lengths.
|
Package tokenizer estimates token counts from byte lengths. |
|
pkg
|
|
|
agentdoc
Package agentdoc holds the instruction documents `sctx setup` installs, the table of coding agents it knows how to teach, and the pure text rendering that turns the two into the block written to an agent's instruction file.
|
Package agentdoc holds the instruction documents `sctx setup` installs, the table of coding agents it knows how to teach, and the pure text rendering that turns the two into the block written to an agent's instruction file. |
Click to show internal directories.
Click to hide internal directories.