Context tools

Enable optional tools that reduce noisy command output or find relevant code before it enters an agent's context. RTK OSS, sgrep, ast-grep, Repomix and Graphify are disabled by default. Selection never installs dependencies globally on the execution host or restarts a working agent.

Configure in TUI or web

System, template, project-group and repository defaults are stored in the controller with revision checks. Competing saves return a reloadable conflict instead of overwriting another client's change. Saving defaults and applying them are separate recorded steps: a returned application ID is not evidence that a tool was installed. Future starts only saves without starting an application. An unrelated access-context refresh does not apply pending tools or Graphify hooks early.

From the defaults editor, open Latest application or Recent applications to inspect durable progress. You can also choose one running container and open Install / update in container to apply a selection only there. Leaving that container panel without applying changes does not install anything.

Template and repository defaults are stored in the controller. Container overrides survive container deletion/recreation through the durable workspace record. Changes to these optional tools do not mark unrelated container configuration as requiring recreation.

Apply a selection across a scope

The selected list is complete: only checked tools are installed, and deselected devctrl-managed tools and their managed hook entries are removed. Manual installations, account-global configuration, repository data and generated Graphify output remain. An empty list removes the managed selection; it does not uninstall arbitrary executables found on PATH.

Application progress separates three views:

View What establishes completion
Prepared images The selected tool image is built and verified for future containers. Image preparation does not restart running containers or agent processes.
Existing containers Actual executables and versions match the requested selection, and every retained session checkout's generated guide is verified. A container may be partially applied or failed even when its image is ready.
Session notifications Confirmed delivery has a native receipt for that session. Queued, failed and cancelled notices remain distinct; none proves that the agent has read the guide.

Running containers apply the selection without restarting agent processes. A stopped container is updated only when safe maintenance is possible with its known inert managed entrypoint and fresh identity evidence. Maintenance respects the current start/stop intent and returns an otherwise stopped container to stopped. Frozen, absent, transitioning or otherwise ineligible targets remain Pending next start. Their selected tools are prepared before the next managed launch instead of pretending a live update succeeded.

Each tool has its own progress and elapsed time, including removal of a previously managed tool. Actual version probes precede guide publication and session notices. Installed versions are observed; tool invocations and token savings are not measured.

Closing the panel stops observation only. The server continues the accepted operation, and its progress can be reopened after disconnecting. Recent history loads bounded summaries; selecting one application loads its details. Retry failed image/container steps retries only failed components of that same selection and scope revision. It never replays session notices or forces input. A newer selection supersedes older work; reload before retrying a revision conflict.

CLI and API defaults

Read your own system defaults:

devctl context-tools defaults
devctl context-tools defaults show '{"kind":"repository","id":"my-repository"}'

Read the current revision before saving. For example, after a response with revision zero:

devctl context-tools defaults save '{"scope":{"kind":"system"},"revision":0,"enabled":["rtk","repomix"],"graphify":null,"applyToExisting":true,"tracks":"images-and-containers"}'
devctl context-tools bulk
devctl context-tools bulk APPLICATION_ID
devctl context-tools retry APPLICATION_ID

Use enabled: null to inherit and enabled: [] to explicitly disable all optional tools. graphify: null inherits its policy independently. Supported scopes are system, template (id is a managed template ID), project-group and repository. tracks also accepts images or containers. Set applyToExisting: false to save future-only defaults without creating a bulk operation.

The same authenticated operations are documented in the operator MCP catalog: GET /v1/context-tools/defaults?kind=system (or kind plus id) and PUT /v1/context-tools/defaults with the typed scope/revision body. A save that starts application returns bulkOperationId. GET /v1/context-tools/bulk returns recent summaries; GET /v1/context-tools/bulk/:operationId reads one full operation; POST /v1/context-tools/bulk/:operationId/retry retries its failed image/container components only.

Operator MCP context_tools uses action: "defaults" with scope to read, or with change containing the complete save body to write. Use action: "bulk" with optional operationId for history/detail, and action: "retry" with operationId for failed components. The handler derives the owner from authentication and checks actual repository/group ownership. A tenant cannot set another owner or configure a non-base template. Ordinary session MCP remains limited to its own repository/container: get_context_tools reads desired/observed tooling and configure_context_tools requests an approved live operation. It does not gain authority to change owner-wide or foreign-group defaults.

Context freshness and package versions

Refreshing repository context and upgrading the tool itself are separate operations.

Tool When source context is refreshed Persistent repository index
RTK Filters the output of each command as it runs None
sgrep Reads current files on each search; only its public embedding models are cached None in the managed 0.3.0 release
ast-grep Parses current source for each search or rewrite None required
Repomix Creates a new context pack when invoked; an existing pack does not update itself A saved output file, not a live index
Graphify Builds a persistent code graph on request, after a commit or before a push, according to your policy graphify-out/graph.json and local extraction caches

The sgrep behavior follows its official 0.3.0 documentation. Changing package auto-update preferences below does not schedule graph rebuilds or regenerate saved Repomix packs.

Graphify repository policy

Enable Graphify in a template, Project or running container's Context tools panel. Store graph in Git (g) controls the generated-output ignore policy. Code refresh (s) cycles through:

Automatic refresh is deterministic, local and code-only. It uses the verified Graphify CLI, inherits container CPU/RAM/network limits and has a two-minute execution deadline. It never starts paid semantic extraction. Documents, papers and images require a separate explicit semantic workflow; automatic refresh does not claim to rebuild that layer. No Graphify watcher daemon is started.

With Git storage off, a managed .gitignore block excludes graphify-out/. With storage on, generated graphs and reports may be committed, while hidden machine metadata, caches and cost records remain ignored. Existing user ignore rules are preserved and can still exclude graph files. Files already tracked by Git remain tracked until you explicitly untrack them; changing this setting does not modify the index or rewrite history. Review generated outputs before publishing them.

Template settings belong to the application user and are inherited by new repositories unless a group/repository override exists. Existing materialized repository settings remain explicit. The primary repository's defaults are captured when its container starts, unless a container override exists. An apply in a shared container refreshes the policies and runtime instructions of its retained repository/session checkouts. Native Git worktrees can share hooks, so the dispatcher reads each checkout's own policy instead of applying a sibling's settings.

Existing shell hook bodies and unrelated ignore rules are preserved. Installation is idempotent. A custom core.hooksPath, non-shell hook, unsafe link or conflicting managed block produces an explicit error; devctrl does not overwrite your hook manager. Select manual refresh or integrate the refresh command through that manager. Disabling Graphify removes its managed policy/hook entries, while retaining graph data and its existing ignore rules.

Launch and update behavior

Before a new agent process starts in an existing container, the host prepares its selected tools at the latest stable release. This also covers an older base image. A new container reuses a prepared base and cached context-tools overlay where possible. Reattaching to an already running session does not install or restart anything.

Automatic updates

Settings → Context tool updates controls a private policy for your running containers. Automatic updates start OFF, with no tools selected. Enable the policy and select RTK, sgrep, ast-grep, Repomix or Graphify individually. The same policy is available from the release browser; its selected-tool action changes that tool's preference without selecting the others.

Only tools already enabled, installed and managed in a running container are eligible. The updater does not install missing tools, enable disabled tools, replace manual installations, downgrade a version, rebuild an image or update a running agent CLI. Immutable tool versions and atomic managed links preserve processes already using the previous executable.

The controller checks eligible containers every minute using the existing release catalog, which normally refreshes hourly. It keeps working with TUI, web and the laptop disconnected. Fresh ownership, host access, container and version evidence are required. Conflicting updates, autonomous Run leases and Overnight defer work. Admission is checked again before installation, including policy changes after a job was queued. Failures use persistent backoff rather than retrying every minute.

With automatic updates off, select a context tool in release notes and use Update selected tool. A container-scoped view selects its current container; the Dashboard asks which running container to update. This action changes only the selected installed tool. The existing Install / update in container action remains the separate way to apply a complete enabled-tool selection.

A manual selected-tool update first reads actual installed versions from the selected container, then builds its update plan. Before each executable is published, the host reads those versions again and the controller rechecks the exact container, owner, selection, target version and write lease. An automatic check with stale versions queues a read-only refresh before trying an update. A lightweight managed-container identity observation allows these checks during a slow full host scan; it does not refresh resource statistics or weaken the container replacement check.

Per-container tooling history

Open Tooling history from the container's context-tools settings or release browser. History separates actual container IDs, including retained records for replaced containers. It covers agent CLIs, context tools and observed runtime tools: Node, npm, pnpm, gh, Git, Docker CLI and tmux.

Each record identifies its tool, source (auto, manual, launch, rebuild or observation), actor/command when known, requested and completion timestamps, before/after versions and outcome. Queued targets are not installed versions. An observation records what was actually found; the first observation has an unknown previous version and does not invent a historical installation. Missing or unverified version results remain explicit. Rebuilding a container starts a new container lineage rather than overwriting the old one's records.

Press Enter or select a record to open its full, scrollable details. This keeps long container IDs, source metadata and errors readable on narrow screens; Back returns to the same history page without downloading the journal again.

Runtime versions use cached, unprivileged, version-only probes with private configuration, fixed commands and bounded process/transport timeouts. They do not log in, invoke a model, query a Docker daemon or install packages. Image labels are not substituted for installed-version evidence. History begins when this instrumentation is enabled; past updates cannot be reconstructed reliably. Pages load separately from normal console state, with at most 50 records per request. The journal currently retains up to 5,000 records per owner for 90 days.

An accepted operation is a durable controller job executed by the enrolled host. Closing the TUI, browser or laptop only stops client polling. Progress, errors and results remain available when reconnecting. Each selected tool has its own queued/running/completed/failed row, current stage and elapsed or completed installation time. A known stage plan uses a progress bar; an unmeasured stage uses a spinner. The panel also shows total elapsed time from the original job timestamps, without resetting when reopened. Esc closes the panel while installation continues on the server. The shared console header and every session row/tile in the affected container retain a progress marker, including sessions from another repository. Enabled tools join the same release monitor and changelog workflow as agent CLIs. A changed selection triggers a refresh; periodic checks continue hourly. Template-only and prepared-image selections also participate, even without an active session. Optional version observations run asynchronously and are cached for one minute; they do not block terminal attachment or primary host inventory.

After actual version and selection verification, devctrl refreshes each retained checkout's generated runtime guide and queues a native notification to running Claude, Codex and Antigravity sessions in that container. Guide verification and native delivery are tracked separately. Delivery uses the existing generation-fenced protocol and waits for a safe composer; a changed session identity cancels the old notice instead of replaying it. A queued notice is not a confirmed native receipt. This does not restart the session or imply new network/service authorization.

Tools

Tool Installed edition / source Use Limitations
RTK Apache-2.0 OSS edition; SHA-256-verified official amd64 static binary; pinned source/locked dependencies on Linux arm64 rtk git status, rtk test, rtk proxy <command>, rtk gain New Claude launches get the official rtk hook claude Bash hook in their managed settings. Existing/user hooks are preserved. Codex and other clients use explicit RTK commands and the runtime guide. The full proprietary engine is not bundled.
sgrep MIT; official stable release source pinned to its commit, compiled in an isolated builder sgrep "find request retries" ./src -n 10 --json Linux amd64/arm64 glibc containers. The verified 0.3.0 release supports code/text search, model selection and JSON; newer README options such as stdin reranking are not assumed to exist in that release. It does not parse PDFs or images.
ast-grep MIT; official release commit and locked Cargo dependencies, compiled for the managed Debian baseline ast-grep run --lang ts --pattern 'console.log($ARG)' ./src Structural search and rewrites, not embedding search. Only the ast-grep executable is published; the optional sg alias would conflict with the system command. Preview matches before applying rewrites.
Repomix MIT; pinned official source, upstream npm lock, production dependencies; no dependency lifecycle install scripts repomix --include "src/example.ts,README.md" --compress --output /tmp/context.xml Node.js 22+; managed containers use Node 24. Include only relevant files, preserve ignore rules and secret checks, and inspect the output token count before loading. No automatic whole-repository packing or background MCP process.
Graphify Apache-2.0; pinned official graphifyy source, frozen upstream Python dependency lock with hash checks, private Debian Python runtime graphify query "how does authentication work?", graphify update . Persistent code graph; managed automatic refresh is code-only. Python is bundled privately, including for base containers without system Python. Semantic document extraction and upstream optional model-provider extras are not automatically enabled.

sgrep's two small public embedding models are prepared against public fixture text in the builder, then shipped read-only with the binary. Its managed launcher uses that model cache with HF_HUB_OFFLINE=1; source files and queries stay in the workspace. No broadening of workspace Internet permissions is required. Search indexes introduced by future releases must remain private to the runtime user; shared host caches must never contain Project source or search results.

RTK reports its own measured output compression through rtk gain. devctrl does not convert it into actual subscription savings or claim the upstream benchmark's percentage as its own measurement.

Cache and installation boundary

The host retains immutable, checksummed artifacts in its managed context-tool-cache. The cache key includes tool, stable version, release commit/digest and CPU architecture. Only shipped official repositories/install strategies are accepted; agents cannot provide arbitrary installer URLs or shell scripts.

Linux source builds have no Project mounts, coding-account credentials or managed secrets. They use a clean environment and locked Cargo or npm dependencies. Repomix includes its production dependency tree and never installs it globally on the host. The builder warms public models only. Temporary build containers, output-image tags and staging directories are removed; Docker's ordinary builder cache remains visible to operator storage cleanup.

Inside a container, root-owned versions live under /opt/devctl/context-tools/<tool>/<version>. The updater verifies versions with an unprivileged process and atomically changes managed links. Old binaries remain available to processes that already use them. Failed downloads, checksum failures, unsupported platforms and build errors preserve the running container and provider processes. A multi-tool job can fail after an earlier tool was installed; inspect observed versions and retry the intended selection. Manual executables are never overwritten.

CLI and MCP

./devctl context-tools catalog
./devctl context-tools template base '["rtk","sgrep","ast-grep","repomix"]'
./devctl context-tools project example-project '["rtk"]'
./devctl context-tools project example-project '["graphify"]' '{"storeInGit":false,"updateStrategy":"before-push"}'
./devctl context-tools status WORKSPACE_ID
./devctl context-tools check WORKSPACE_ID
./devctl context-tools apply WORKSPACE_ID '["rtk","sgrep","ast-grep","repomix"]'
./devctl context-tools apply WORKSPACE_ID '["rtk","graphify"]' '{"storeInGit":true,"updateStrategy":"after-commit"}'
./devctl context-tools prepare-image WORKSPACE_ID '["rtk","sgrep","ast-grep","repomix"]'
./devctl context-tools images HOST_ID
./devctl context-tools image HOST_ID devctl-project-runtime:BASE_TAG '["rtk"]'

Operator MCP exposes context_tools with these typed actions, targetId, complete enabled selection and, for images, imageReference. Server users can configure only their own Project/container or approved base template; host-wide image management requires the infrastructure operator.

For operator context_tools, template, project and apply accept optional graphify: {storeInGit, updateStrategy}. Session configure_context_tools accepts the same policy only with action: "apply"; the exact approved argument set and existing effective policy are checked before changing it. Status, selected-tool update and image preparation cannot change repository policy. Image builds contain tooling, not repository hooks or graphs.

Session MCP exposes:

Operator MCP context_tools adds action: "update" with targetId and tools, action: "auto-update" to read the current owner's policy (or save a complete policy: {enabled, tools}), and action: "history" with targetId, limit, cursor and containerId as needed. Ordinary session MCP cannot set an owner's automatic policy for other containers.

The built-in devctl-project-setup skill documents this flow and how to use the selected tools. Session changes are distinct from granting APIs, credentials or network destinations.

The operator API uses /v1/context-tools, /v1/runtime-templates/:template/context-tools, /v1/projects/:id/context-tools, /v1/workspaces/:id/context-tools and /v1/hosts/:id/context-tools/images. Jobs use the existing command result/progress endpoints. /v1/context-tools/operations returns only active workspace operations visible to the current user/allowed hosts. The attached browser terminal uses one compact console-level poll to discover installations started by another client; it does not poll every session or fetch full resource inventories.

GET / PUT /v1/context-tools/auto-update reads/replaces your policy; POST /v1/workspaces/:id/context-tools with {action:"update",tools:["rtk"]} queues a selected-tool update, returning commandId: null if already current. GET /v1/workspaces/:id/tooling/history?limit=25 returns {items,nextCursor}; optional containerId filters this workspace's retained container records. These routes use the same user/host authorization as the console and are discoverable through operator controller_operations / controller_request.

CK and sgrep

CK is an alternative semantic-search engine, not an additional default. Its own MCP server, hybrid semantic/keyword search and persistent incremental index are useful when a project needs those capabilities. It overlaps with sgrep and adds another index/model cache; devctrl currently manages sgrep and does not install CK. Evaluate replacing the search engine rather than enabling both by default.

Verification

Automated tests cover schema validation, template inheritance, tenant authorization, one-shot MCP approvals, deduplication, failure preservation, version publication, checksums, official sources, configuration preservation and safe disable behavior. Scoped-application tests also cover exact selection/removal, independent image/container outcomes, safe stopped maintenance, revision changes, failed-component retry and guide/notification receipts. UI tests exercise real native keyboard and browser selection, save, history and retry flows. An opt-in Docker smoke test uses actual public releases, tests offline semantic search, preserves a running process and verifies cached-image reuse:

pnpm build
node e2e/context-tools/smoke.mjs

It requires Docker and public dependency downloads; no paid provider credentials are needed. Normal CI does not download/compile these CLIs.

get_context_tool_releases reads official per-release notes using a tool ID and observed fromVersion; optional toVersion limits the range. It does not install tools or make a paid Decisions call. Operator MCP context_tools supports action: "releases", and CLI uses context-tools releases TOOL_ID FROM_VERSION [TO_VERSION].

Runtime guide and startup instructions

Every enabled tool is documented in the generated DEVCTRL.AGENTS.MD with its executable, purpose, example command and limits. Selection is distinct from successful installation: agents confirm observed versions through get_context_tools. The same guide documents the managed environment, resource limits and available runtime tools.

Before a new native process launches, devctrl appends the guide to its session-private DEVCTL.RULES.md alongside a requirement to read the live guide before starting work. Claude receives this file through --append-system-prompt-file; Codex receives it through its managed profile's model_instructions_file. This supplies the instructions as model context rather than typing a task into the composer. A live context-tools update regenerates the guide and queues a safe reread notification; it preserves the native process and does not rewrite repository-owned AGENTS.md or CLAUDE.md.

Graphify instructions include the effective Git storage and code-refresh policy. Running Claude, Codex and Antigravity sessions receive native, generation-fenced reread notifications after a live change. A superseded Graphify policy invalidates its older pending notice, so it cannot overwrite the current guide with stale settings.

For sessions sharing a container across repositories or worktrees, applying tools refreshes each retained checkout guide, including inactive sessions whose worktrees still exist. Only the Context tools section is refreshed there; another repository's permission scope is never copied into it. Running Claude, Codex and Antigravity sessions also receive the native reread notification described above. Generated guides are published through unique exclusive temporary files and file handles, preserving files referenced by supplied symlinks or hardlinks.