Environment Plugin
Query execution environment (OS, shell, architecture) and internal context (token usage, GC thresholds) to generate platform-appropriate commands and manage resources.
| Name | environment |
| Type | Tool Plugin (Registry-managed) |
| Auto-approved | Yes (read-only, no side effects) |
| Tools | get_environment |
Use Cases
- Shell command generation - Determine correct syntax (bash vs PowerShell)
- Path construction - Use correct separators (
/vs\) - Tool availability - Know which utilities exist on the platform
- Binary selection - Choose correct architecture (x86_64 vs arm64)
- Context management - Monitor token usage and proactively manage context
get_environment
Query environment information with optional aspect filtering.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
aspect |
string |
No | Filter to specific aspect: os, shell, arch, cwd, context, or all (default) |
Aspect Details
OS (aspect="os")
| Field | Description | Examples |
|---|---|---|
type | Lowercase OS identifier | linux, darwin, windows |
name | Platform name | Linux, Darwin, Windows |
release | OS version | 5.15.0, 22.1.0 |
friendly_name | Human-readable | Linux, macOS, Windows |
Shell (aspect="shell")
| Field | Description | Examples |
|---|---|---|
default | Default shell | bash, zsh, cmd |
current | Current shell | bash, powershell |
path | Shell path (Unix) | /bin/bash |
path_separator | PATH delimiter | : (Unix), ; (Windows) |
dir_separator | Directory separator | / (Unix), \ (Windows) |
Architecture (aspect="arch")
| Field | Description | Examples |
|---|---|---|
machine | Raw machine type | x86_64, arm64 |
processor | Processor info | x86_64, arm |
normalized | Standardized name | x86_64, arm64, x86 |
Working Directory (aspect="cwd")
Returns the absolute path to the current working directory as a string.
Context (aspect="context")
Returns token usage and GC settings. Requires session injection via set_session_plugin().
| Field | Description | Examples |
|---|---|---|
model | Model name | claude-sonnet-4-20250514 |
context_limit | Max context size | 1048576 |
total_tokens | Total tokens used | 15234 |
prompt_tokens | Input tokens | 12000 |
output_tokens | Output tokens | 3234 |
tokens_remaining | Available tokens | 1033342 |
percent_used | Usage percentage | 1.45 |
turns | Conversation turns | 5 |
gc | GC settings | Object with thresholds |
Configuration
This plugin requires no configuration for basic aspects. For context aspect,
inject the session via set_session_plugin().
Basic usage
from jaato import PluginRegistry
registry = PluginRegistry()
registry.discover()
registry.expose_tool("environment")
# Get all executors
executors = registry.get_exposed_executors()
# Query all environment info
result = executors["get_environment"]({})
# Query specific aspect
os_info = executors["get_environment"]({"aspect": "os"})
shell_info = executors["get_environment"]({"aspect": "shell"})
Response: context aspect
{
"model": "claude-sonnet-4-20250514",
"context_limit": 1048576,
"total_tokens": 15234,
"prompt_tokens": 12000,
"output_tokens": 3234,
"tokens_remaining": 1033342,
"percent_used": 1.45,
"turns": 5,
"gc": {
"threshold_percent": 80.0,
"auto_trigger": true,
"preserve_recent_turns": 5
}
}
Response: single aspect
// get_environment(aspect="shell")
{
"default": "bash",
"current": "bash",
"path": "/bin/bash",
"path_separator": ":",
"dir_separator": "/"
}
// get_environment(aspect="cwd")
"/home/user/project"
With JaatoClient
from jaato import JaatoClient, PluginRegistry
client = JaatoClient()
client.connect() # Reads JAATO_PROVIDER and MODEL_NAME from env
registry = PluginRegistry()
registry.discover()
registry.expose_tool("environment")
registry.expose_tool("cli") # Often used together
client.configure_tools(registry)
# Model can now query environment before
# generating platform-specific commands
response = client.send_message(
"List files in the current directory"
)