{"id":51558426,"url":"https://github.com/krablante/rtk-codex-plugin","last_synced_at":"2026-07-10T08:01:13.150Z","repository":{"id":358123865,"uuid":"1239730657","full_name":"Krablante/rtk-codex-plugin","owner":"Krablante","description":"Codex-compatible shell rewrite and bounded-output plugin for token-safe command inspection.","archived":false,"fork":false,"pushed_at":"2026-05-15T19:52:37.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-15T22:47:49.605Z","etag":null,"topics":["codex","plugin","rtk","shell","token-safety"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Krablante.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-15T11:36:09.000Z","updated_at":"2026-05-15T19:53:06.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Krablante/rtk-codex-plugin","commit_stats":null,"previous_names":["krablante/rtk-codex-plugin"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Krablante/rtk-codex-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krablante%2Frtk-codex-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krablante%2Frtk-codex-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krablante%2Frtk-codex-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krablante%2Frtk-codex-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Krablante","download_url":"https://codeload.github.com/Krablante/rtk-codex-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Krablante%2Frtk-codex-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35325188,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-10T02:00:06.465Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codex","plugin","rtk","shell","token-safety"],"created_at":"2026-07-10T08:01:11.992Z","updated_at":"2026-07-10T08:01:13.140Z","avatar_url":"https://github.com/Krablante.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003ertk-codex-plugin\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eKeep Codex shell output useful before it burns the context window.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  A small Codex-compatible shell plugin for command rewrite, bounded long-line output, and artifact-backed output compaction.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Krablante/rtk-codex-plugin/actions/workflows/ci.yml\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/Krablante/rtk-codex-plugin/ci.yml?branch=main\u0026style=for-the-badge\" alt=\"CI status\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"./LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge\" alt=\"MIT License\"\u003e\n  \u003c/a\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Python-3-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white\" alt=\"Python 3\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Codex-Plugin%20Hooks-111111?style=for-the-badge\" alt=\"Codex plugin hooks\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"./docs/install.md\"\u003eInstall\u003c/a\u003e\n  ·\n  \u003ca href=\"./docs/compatibility.md\"\u003eCompatibility\u003c/a\u003e\n  ·\n  \u003ca href=\"./docs/stack.md\"\u003eStack Fit\u003c/a\u003e\n\u003c/p\u003e\n\n`rtk-codex-plugin` adds a shell-focused `PreToolUse` hook for Codex-compatible\nruntimes. It has three jobs:\n\n- route eligible Bash/`exec_command` calls through `rtk rewrite` for more\n  compact output;\n- wrap risky long-line inspections with a bounded output guard;\n- compact medium/large model-visible tool output after execution while\n  preserving the full raw output, including `write_stdin` streams, in local\n  artifacts.\n\nThe guard is useful even when `rtk` is not installed. Rewrite mode is optional\nand activates only when the `rtk` binary is available in `PATH`.\n\n## Part of the Codez stack\n\nThe Codez stack is modular. Each layer can be used on its own unless a higher\nlayer explicitly opts into it.\n\n| Layer | Public surface | Responsibility | Dependency |\n| --- | --- | --- | --- |\n| [Codez](https://github.com/Krablante/codez) | Codex-compatible runtime | App Server v2, goal RPC, long-session hardening, prompt pruning, and plugin hooks | Does not require Teledex |\n| [RTK Codex Plugin](https://github.com/Krablante/rtk-codex-plugin) | Optional Codex plugin | Shell/token safety through `rtk rewrite` and bounded output guarding | Requires a Codex-compatible plugin-hook runtime; does not require Teledex |\n| [Pitlane Codex Plugin](https://github.com/Krablante/pitlane-codex-plugin) | Optional Codex plugin | Code-navigation/token-saving rewrites through a host-local `pitlane` CLI | Requires a Codex-compatible plugin-hook runtime and local `pitlane`; does not require Teledex |\n| [Teledex](https://github.com/Krablante/teledex) | Telegram gateway/session layer | Topics, queues, live steer, `/goal` UX, and delivery/recovery around durable agent sessions | Full mode is optimized for Codez App Server v2; upstream `codex exec --json` is legacy compatibility only |\n\n## Why People Use It\n\n- avoid huge JSONL, log, and prompt-capture lines flooding the model context\n- keep simple shell exploration compact without changing test or machine\n  command semantics\n- preserve no-rewrite command semantics for `rg --files`, `git status --short`,\n  `jq`/JSON modes, counts, lists, direct `rg`/`grep` searches, build/test\n  commands, Docker commands, and interactive commands while still compacting\n  oversized model-visible output\n- install as a small plugin instead of changing every shell command by hand\n\n## Mental Model\n\n| Piece | Role |\n| --- | --- |\n| Codex-compatible runtime | executes `PreToolUse` hooks before shell calls |\n| `rtk-codex-hook` | decides whether a command should be guarded, rewritten, or left alone |\n| `rtk-output-guard` | caps per-line and total stdout for risky inspections |\n| `rtk-output-post-hook` | compacts large model-visible shell output with artifact refs |\n| optional `rtk` binary | rewrites eligible commands into a compact shell form |\n\nArchitecture at a glance:\n\n```text\nCodex shell tool call\n  -\u003e PreToolUse hook\n     -\u003e risky JSONL/log/prompt inspection? run through rtk-output-guard\n     -\u003e otherwise eligible simple command? ask rtk rewrite\n     -\u003e no-rewrite/build/test/Docker/interactive command? pass through unchanged\n  -\u003e PostToolUse hook\n     -\u003e medium/large model-visible output? summary + full local artifact\n```\n\n## Highlights\n\n- bounds known long-line inspection shapes before execution\n- bounds medium/large model-visible output after execution, including large\n  pass-through command output unless explicitly bypassed\n- works without `rtk` for output guarding\n- skips rewrite when exact stdout matters\n- uses plain Python scripts and a small plugin manifest\n- designed to work standalone and to fit the modular Codez stack\n\n## Quick Start\n\nClone the plugin into the plugin cache used by your Codex-compatible runtime.\nOne common cache layout looks like this:\n\n```bash\ncodex_home=\"${CODEX_HOME:-$HOME/.codex}\"\ngit clone https://github.com/Krablante/rtk-codex-plugin \\\n  \"$codex_home/plugins/cache/github/rtk-codex-plugin/local\"\n```\n\nEnable plugin hooks and the plugin key that matches your install location:\n\n```toml\n[features]\nplugins = true\nplugin_hooks = true\n\n[plugins.\"rtk-codex-plugin@github\"]\nenabled = true\n```\n\nRun the focused test suite:\n\n```bash\nmake test\n```\n\nRead next:\n\n- [Install](./docs/install.md)\n- [Compatibility](./docs/compatibility.md)\n- [Stack Fit](./docs/stack.md)\n\n## Notes\n\n- `rtk` rewrite is optional; install `rtk` separately when you want rewrite mode.\n- output guarding stays active without `rtk`\n- the plugin is intentionally shell-hook-only; gateway/session behavior belongs\n  in higher-level tools\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrablante%2Frtk-codex-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrablante%2Frtk-codex-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrablante%2Frtk-codex-plugin/lists"}