Workspaces

Features

RTK token compression, OpenTelemetry observability, LSP code intelligence, and plugin hooks in workspace images.

RTK Token Compression

RTK intercepts Bash tool calls and compresses output from commands like ls, find, git log, and tree. This reduces the tokens Claude consumes reading command output.

How It Works

RTK is initialized via rtk init in the container entrypoint. It creates shell aliases that wrap common commands with token-optimized formatting. Claude Code's Bash tool calls go through these aliases transparently.

Measured Impact

Live A/B evaluation on an "explore repository" task:

MetricWithout RTKWith RTKSavings
Context tokens61,11728,66353%
Cost (USD)$0.13$0.0929%
Conversation turns12650%
Bash tool calls10550%

RTK reduces context consumption without changing agent behavior: the same tasks complete with fewer tokens.

OpenTelemetry Observability

Workspace images export standard OTel metrics via OTLP, providing real-time token and cost tracking.

Exported Metrics

MetricTypeDescription
claude_code.token.usageCounterToken count per turn (input, output, cacheRead, cacheCreation)
claude_code.cost.usageCounterCumulative cost in USD
claude_code.session.countCounterSession counter
claude_code.commit.countCounterGit commit counter

Exported Log Events

EventDescription
claude_code.api_requestPer-API-call cost, model, cache tokens, duration, speed mode
claude_code.api_errorAPI error with status code and retry count
claude_code.tool_resultTool execution completion (name, duration, success)
claude_code.user_promptUser prompt submitted (length only, no content by default)

Configuration

OTel export is enabled by default in the image. The orchestrator auto-injects the collector endpoint when COLLECTOR_URL is configured:

# Set by the image (defaults, no user action needed)
CLAUDE_CODE_ENABLE_TELEMETRY=1
OTEL_METRICS_EXPORTER=otlp
OTEL_LOGS_EXPORTER=otlp
OTEL_METRIC_EXPORT_INTERVAL=5000  # 5s granularity

# Auto-injected by orchestrator when COLLECTOR_URL is set
OTEL_EXPORTER_OTLP_ENDPOINT=http://collector:8080

If no endpoint is provided, OTel export silently no-ops (no crash, no side effects).

Two-Channel Observability

Workspace observability uses two complementary channels. They capture different data, neither can fully replace the other:

Captured by Plugin Hooks onlyCaptured by OTel onlyCaptured by both
Subagent lifecyclePer-API-call cost + modelToken usage totals
Session end eventAPI errors (status code, retries)Cost totals
Context compactionCache token breakdownTool completion
Git branch / merge / pushActive time trackingUser prompts
Tool start eventsprompt.id correlation
Permission requests

See the Observability guide for the full event pipeline and how to verify both channels are flowing.

LSP Code Intelligence

The image bundles language servers for Claude Code's LSP plugins:

LanguageServerPlugin
Pythonpyrightpyright-lsp
TypeScripttypescript-language-servertypescript-lsp
Rustrust-analyzerrust-analyzer-lsp

LSP servers are lazy: they only start when Claude encounters files in the matching language. An agent working on a Python-only repo will not start rust-analyzer or typescript-language-server.

Pre-Bundled Plugins

Plugins are baked into /opt/agentic/plugins/ and loaded at runtime via --plugin-dir. Available plugins:

  • sdlc: Git operation hooks (commit metrics, branch tracking, push events)
  • workspace: Compaction tracking, subagent lifecycle events

Plugin hooks emit JSONL events to stderr, captured by the orchestrator's event collection pipeline.

Syntropic137 Docs v0.25.4 · Last updated March 2026

On this page