ctx exec
ctx exec <command> runs any shell command and applies a context-aware filter to compress the output before returning it. Commands without a registered filter pass through unchanged.
Quick examples
Section titled “Quick examples”ctx exec git status # only modified files, no boilerplatectx exec cargo test # only failures + summary preservedctx exec kubectl logs my-pod # deduplicates repeated lines with (×N) groupingctx exec terraform plan # strips refresh/lock noise, keeps diff + summaryctx exec git push origin main # reduces to "ok abc1234..def5678 main -> main"Token savings report
Section titled “Token savings report”ctx exec reportctx exec report --days 7 # last weekctx exec report --project /path # filter by projectctx exec report --json # machine-readableSupported command families (17)
Section titled “Supported command families (17)”| Category | Commands |
|---|---|
| VCS | git status/log/diff/show/branch/tag/stash/blame/push/pull/add/commit/fetch |
| Rust | cargo test/build/check/clippy/fmt/run/install |
| JS/TS | npm/yarn/pnpm (install/test/build/run), jest, vitest |
| Linters JS/TS | tsc, eslint, prettier, biome |
| Python | ruff, mypy, pytest |
| Go | go test, go build, go vet, golangci-lint |
| Ruby | rubocop, rspec, rake |
| JVM | gradle/gradlew/mvn/mvnw (test/build/package/install/verify), grails |
| Containers | docker ps/images/logs/compose, kubectl get/logs/describe |
| AWS | aws logs/sts/s3/ec2/lambda/iam/dynamodb/cloudformation |
| IaC | terraform plan/apply/init/validate, tofu plan/apply/init/validate |
| GitHub | gh pr/issue/run |
| Filesystem | ls, find, tree, grep/rg/ag |
| Data | curl/wget, jq, sqlite3 |
Smart filters
Section titled “Smart filters”- Log deduplication —
kubectl logs,docker logs,aws logsnormalize timestamps/UUIDs/hex/paths and group identical messages with(×N)suffix - Git ok-style —
git push/pull/commit/addreduce took abc1234 main: feat: msg(-92% as in RTK) - AWS service-specific —
dynamodbunwraps{"S":"value"}→"value";iamstrips inlinePolicyDocumentblocks - Terraform —
plankeeps diff + finalPlan: N to addsummary, strips refresh/install noise - Linters formatted — preserves
file:line:col: error/warning code msgremoving tables and footer noise
Filter not registered?
Section titled “Filter not registered?”The command passes through unchanged. No surprise behavior. To request a new filter, open an issue at github.com/JaimeJunr/context-engine.
Via MCP
Section titled “Via MCP”ctx exec is also available as the ctx_exec MCP tool — agents can call it directly with {"command": ["git", "status"]} JSON arguments.