Agent skill

Env Management

by grandamenium in grandamenium/cortextos

You need to add a new API key to the system, update an existing credential, check what secrets are configured for the org or a specific agent, onboard a new third-party tool that needs credentials…

MITAuto-check: notesDevOps & Cloud

Install Env Management

skills CLI
$ npx skills add grandamenium/cortextos --skill env-management -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install grandamenium/cortextos env-management --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/grandamenium/cortextos.git skills-src && mkdir -p .claude/skills && cp -r skills-src/community/agents/security/.claude/skills/env-management .claude/skills/env-management && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
env-management
GitHub stars
101
Token cost
~1.5k tokens
SKILL.md length
270 words
Files
1
Skills in repo
55
Repo updated
First seen
Licence
MIT

At a glance

You need to add a new API key to the system, update an existing credential, check what secrets are configured for the org or a specific agent, onboard a new third-party tool that needs credentials…

  • Works in 4 steps: Go to @BotFather → /mybots → select the… → Copy the new token → Update agents/{agent}/.env — replace… → …
  • Tasks that involve Secrets management
  • SKILL.md covers Where Each Key Lives, Adding a New Shared Secret, Adding an Agent-Specific Secret and Checking What Keys Are…, plus 2 more sections
  • Calls jq; needs BOT_TOKEN and ANTHROPIC_API_KEY

What it does

Env Management is an agent skill from grandamenium/cortextos. You need to add a new API key to the system, update an existing credential, check what secrets are configured for the org or a specific agent, onboard a new third-party tool that needs credentials, diagnose why an agent cannot access a service because a key appears missing, rotate a compromised or expired key, or restart affected agents after a credential change. This skill covers the full lifecycle of environment variables and secrets in cortextOS.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in DevOps & Cloud, covering Secrets management. The licence is MIT.

When your agent uses it

  • Tasks that involve Secrets management

Example prompts

  • “/env-management”

Requirements

  • A credential in OPENAI_API_KEY
  • A credential in APIFY_TOKEN

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Go to @BotFather → /mybots → select the bot → API Token → Revoke current token
  2. Copy the new token
  3. Update agents/{agent}/.env — replace BOT_TOKEN= value
  4. Hard-restart the agent immediately (old token is already invalid)

What it can do on your machine

Read from SKILL.md and the folder at commit 6f93838. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • BOT_TOKEN
    • ANTHROPIC_API_KEY
    • OPENAI_API_KEY
    • APIFY_TOKEN
    • GEMINI_API_KEY
    • CLAUDE_CODE_OAUTH_TOKEN
    • NEW_KEY
    • SOME_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Env Management loads about 1.5k tokens when it runs. Until then it costs about 117 tokens; SKILL.md has 270 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~117
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:4
    ers: ["add key", "api key", "env file", ".env", "secret", "credential", "token", "environment variable", "configure key"
  • NoteMentions a .env fileSKILL.md:15
    4. orgs/{org}/agents/{agent}/.env  ← agent-specific secrets
  • NoteMentions a .env fileSKILL.md:25
    t Telegram credentials | `agents/{agent}/.env` | `BOT_TOKEN`, `CHAT_ID`, `ALLOWED_USER` |
  • NoteMentions a .env fileSKILL.md:26
    | Agent OAuth tokens | `agents/{agent}/.env` | `CLAUDE_CODE_OAUTH_TOKEN` |
  • NoteMentions a .env fileSKILL.md:28
    ent uses it, it belongs in that agent's `.env`.
  • NoteMentions a .env fileSKILL.md:37
    # 1. Locate the org .env
  • NoteMentions a .env fileSKILL.md:57
    # 1. Locate the agent .env
  • NoteMentions a .env fileSKILL.md:58
    OOT/orgs/$CTX_ORG/agents/$CTX_AGENT_NAME/.env"
  • NoteMentions a .env fileSKILL.md:74
    '^#' "$CTX_FRAMEWORK_ROOT/orgs/$CTX_ORG/.env" | grep '=' | cut -d= -f1
  • NoteMentions a .env fileSKILL.md:77
    OOT/orgs/$CTX_ORG/agents/$CTX_AGENT_NAME/.env" | grep '=' | cut -d= -f1

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from grandamenium/cortextos at commit 6f93838, republished under its MIT licence (© grandamenium). 270 words, ~1,461 tokens.

Download SKILL.mdSave it as .claude/skills/env-management/SKILL.md (or your agent's skills folder).
name
env-management
description
You need to add a new API key to the system, update an existing credential, check what secrets are configured for the org or a specific agent, onboard a new third-party tool that needs credentials, diagnose why an agent cannot access a service because a key appears missing, rotate a compromised or expired key, or restart affected agents after a credential change. This skill covers the full lifecycle of environment variables and secrets in cortextOS.
triggers
add key, api key, env file, .env, secret, credential, token, environment variable, configure key, set key, missing key, key not set, where do I put, shared…

Environment Variable Management

cortextOS uses a 4-layer env hierarchy. Later layers override earlier ones:

1. Base shell (PATH, HOME, etc.)
2. CTX_* vars (set by agent-pty at session start)
3. orgs/{org}/secrets.env  ← shared secrets, all agents in the org
4. orgs/{org}/agents/{agent}/.env  ← agent-specific secrets

Where Each Key Lives

Key typeFileExample
Shared API keys (multiple agents use)orgs/{org}/secrets.envOPENAI_API_KEY, APIFY_TOKEN, GEMINI_API_KEY
Agent Telegram credentialsagents/{agent}/.envBOT_TOKEN, CHAT_ID, ALLOWED_USER
Agent OAuth tokensagents/{agent}/.envCLAUDE_CODE_OAUTH_TOKEN

Rule: If more than one agent uses a key, it belongs in orgs/{org}/secrets.env. If only one agent uses it, it belongs in that agent's .env.

ANTHROPIC_API_KEY is inherited from the shell that launched the daemon — never stored in any file.


Adding a New Shared Secret

bash
# 1. Locate the org .env
ORG_ENV="$CTX_FRAMEWORK_ROOT/orgs/$CTX_ORG/secrets.env"

# 2. Append the new key (never overwrite existing)
echo 'NEW_KEY=value' >> "$ORG_ENV"
chmod 600 "$ORG_ENV"

# 3. Restart all running agents so they pick it up
cortextos bus list-agents --format json | jq -r '.[].name' | while read agent; do
  echo "Restarting $agent..."
  cortextos bus send-message "$agent" high "hard-restart" "new shared secret added: NEW_KEY"
  sleep 10
done

Adding an Agent-Specific Secret

bash
# 1. Locate the agent .env
AGENT_ENV="$CTX_FRAMEWORK_ROOT/orgs/$CTX_ORG/agents/$CTX_AGENT_NAME/.env"

# 2. Append the key
echo 'MY_KEY=value' >> "$AGENT_ENV"
chmod 600 "$AGENT_ENV"

# 3. Restart THIS agent only
cortextos bus self-restart --reason "new agent secret added: MY_KEY"

Checking What Keys Are Configured

bash
# Check org-level keys (names only — never print values)
grep -v '^#' "$CTX_FRAMEWORK_ROOT/orgs/$CTX_ORG/.env" | grep '=' | cut -d= -f1

# Check agent-level keys (names only)
grep -v '^#' "$CTX_FRAMEWORK_ROOT/orgs/$CTX_ORG/agents/$CTX_AGENT_NAME/.env" | grep '=' | cut -d= -f1

# Verify a key is set in current session
[[ -n "${SOME_KEY:-}" ]] && echo "SET" || echo "NOT SET"

Rotating a Secret

A key update without restarting the agent does nothing — the old value stays in the PTY environment until the process restarts.

Rotation Decision Tree
Is this a shared org-level key (OPENAI_API_KEY, APIFY_TOKEN, etc.)?
  → Update orgs/{org}/secrets.env → hard-restart ALL agents

Is this an agent-specific key (BOT_TOKEN, CHAT_ID, OAuth token)?
  → Update agents/{agent}/.env → hard-restart THAT AGENT ONLY

Is this ANTHROPIC_API_KEY?
  → Update ~/.zshrc or ~/.bashrc → restart the daemon via PM2
  → Do NOT store in any .env file
Rotating a Shared Org Secret
bash
ORG_ENV="$CTX_FRAMEWORK_ROOT/orgs/$CTX_ORG/secrets.env"
# Update the value in the file (edit KEY_NAME line)

# Restart all agents in sequence (stagger to avoid gaps)
cortextos bus list-agents --format json | jq -r '.[].name' | while read agent; do
  echo "Restarting $agent..."
  cortextos bus send-message "$agent" high "hard-restart" "secret rotation: KEY_NAME"
  sleep 30
done

# Log the rotation
cortextos bus log-event action secret_rotated info \
  --meta "{\"key\":\"KEY_NAME\",\"scope\":\"org\",\"agent\":\"$CTX_AGENT_NAME\"}"
Rotating an Agent-Specific Secret
bash
AGENT_ENV="$CTX_FRAMEWORK_ROOT/orgs/$CTX_ORG/agents/AGENT_NAME/.env"
# Update the value in the file
chmod 600 "$AGENT_ENV"

# Hard-restart that agent (not soft — PTY must rebuild env)
cortextos bus send-message AGENT_NAME high "hard-restart" "secret rotation: KEY_NAME"

cortextos bus log-event action secret_rotated info \
  --meta "{\"key\":\"KEY_NAME\",\"scope\":\"agent\",\"agent\":\"AGENT_NAME\"}"
Rotating a Bot Token (BOT_TOKEN)
  1. Go to @BotFather → /mybots → select the bot → API Token → Revoke current token
  2. Copy the new token
  3. Update agents/{agent}/.env — replace BOT_TOKEN= value
  4. Hard-restart the agent immediately (old token is already invalid)

Critical Rules

  1. Never print secret values — log key names only, never values
  2. Never commit .env files — they are in .gitignore by design
  3. Always chmod 600 after writing any .env file
  4. Never edit a running agent's .env without restarting — changes won't take effect until the PTY env is rebuilt
  5. Never add BOT_TOKEN to org .env — each agent must have its own Telegram bot
  6. ANTHROPIC_API_KEY lives only in the shell — do not add to any .env file
  7. Always hard-restart after rotating — soft-restart preserves the PTY env which still has the old value

© grandamenium, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in community/agents/security/.claude/skills/env-management of grandamenium/cortextos.

Open the folder on GitHubat commit 6f93838

Compare with similar skills

Env Management next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Env Management compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Env Management this skillgrandamenium/cortextos101—~1.5kAutomated safety check: NotesMIT
Iron Proxy Gateway for NanoClawnanocoai/nanoclaw31k—~4.6kAutomated safety check: NotesMIT
LangBot Deployment Guidelangbot-app/LangBot18k—~1.5kAutomated safety check: NotesApache-2.0
Env Var Conventionssgl-project/sglang37k2 repos~2.9kAutomated safety check: PassApache-2.0
Mac Fleet Maintenancesteipete/agent-scripts7.3k—~4.8kAutomated safety check: PassMIT
Add Config Env Varbaserow/baserow6.1k—~1.1kAutomated safety check: PassCustom licence

Similar skills

  • Installs or refreshes Iron Proxy and its Iron Control web console for NanoClaw, with a local Docker setup, database, credentials and a human approval bridge.

    31k GitHub stars~4.6k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • LangBot Deployment Guide

    langbot-app/LangBot

    Deploys and configures a LangBot instance with Docker Compose or Kubernetes, covering config.yaml, the Box sandbox runtime, the plugin runtime and the global API key.

    18k GitHub stars~1.5k tokensUpdated today
    DevOps & CloudAuto-check: notes
  • Env Var Conventions

    sgl-project/sglang

    Conventions for SGLang environment variables — where to define, how to access, how to name, and how to deprecate.

    37k GitHub starsUsed in 2 repos~2.9k tokens
    DevOps & CloudAuto-check passed
  • Mac Fleet Maintenance

    steipete/agent-scripts

    Inventories and maintains a fleet of Macs from a desired-state file: package updates, repo and Xcode sync, and disk, backup and security health reports.

    7.3k GitHub stars~4.8k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Add Config Env Var

    baserow/baserow

    Add a Baserow configuration environment variable for the backend, frontend, or both, and propagate it through settings, Nuxt runtime config, Docker Compose, documentation, consumers, and tests as…

    6.1k GitHub stars~1.1k tokensUpdated yesterday
    DevOps & CloudAuto-check passed
  • Edgeone Makers CLI

    TencentEdgeOne/edgeone-makers-tools

    EdgeOne Makers CLI command reference. An agent skill from TencentEdgeOne/edgeone-makers-tools.

    1.9k GitHub starsUsed in 1 repo~739 tokens
    DevOps & CloudAuto-check: notes

More from grandamenium/cortextos

All 55 skills in this repo
  • Cortext Self Diagnosis

    grandamenium/cortextos

    Diagnose cortextOS itself when the framework misbehaves — an agent has gone silent or wedged, agents are crash-looping, Telegram or agent-to-agent messages are not arriving, crons did not fire, an…

    101 GitHub stars~3.7k tokensUpdated 18 days ago
    Auto-check passed
  • Activity Channel

    grandamenium/cortextos

    You have completed something significant and want the whole org — all agents and the user — to know about it.

    101 GitHub stars~624 tokensUpdated 18 days ago
    Auto-check passed
  • Agentcard Purchase

    grandamenium/cortextos

    You need to make a purchase on behalf of the user — buy a SaaS subscription, pay for an API, purchase a domain, or any transaction requiring a credit card.

    101 GitHub stars~1.1k tokensUpdated 18 days ago
    Auto-check passed
  • Claude To Codex Migration

    grandamenium/cortextos

    Migrate ANY cortextOS agent from the claude-code runtime to the live codex-app-server runtime.

    101 GitHub stars~12k tokensUpdated 18 days ago
    Auto-check: warnings
  • Bus Reference

    grandamenium/cortextos

    Complete cortextos bus CLI reference - all available commands with examples.

    101 GitHub stars~3.8k tokensUpdated 18 days ago
    Auto-check passed
  • Business News Monitor

    grandamenium/cortextos

    Daily cron-driven scan of news/forums/social in a domain to surface market shifts, new competitors, regulatory changes, and net-new opportunities.

    101 GitHub stars~1.3k tokensUpdated 18 days ago
    Auto-check passed

Categories

Questions about Env Management

What does Env Management do?

You need to add a new API key to the system, update an existing credential, check what secrets are configured for the org or a specific agent, onboard a new third-party tool that needs credentials…. Env Management is an agent skill from grandamenium/cortextos. You need to add a new API key to the system, update an existing credential, check what secrets are configured for the org or a specific agent, onboard a new third-party tool that needs credentials, diagnose why an agent cannot access a service because a key appears missing, rotate a compromised or expired key, or restart affected agents after a credential change.

When should I use Env Management?

Env Management fits situations like: tasks that involve Secrets management.

How do I install Env Management in Claude Code?

Run `npx skills add grandamenium/cortextos --skill env-management -a claude-code`. Or copy the skill folder (community/agents/security/.claude/skills/env-management in grandamenium/cortextos) into .claude/skills/env-management in your project. Claude Code loads it when a task matches its description.

How do I install Env Management in Codex?

Run `npx skills add grandamenium/cortextos --skill env-management -a codex`. Or copy the skill folder (community/agents/security/.claude/skills/env-management in grandamenium/cortextos) into .agents/skills/env-management in your project. Codex loads it when a task matches its description.

Can I use Env Management in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add grandamenium/cortextos --skill env-management -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/env-management, .gemini/skills/env-management, .github/skills/env-management and .opencode/skills/env-management in your project.

What does Env Management need to run?

Going by SKILL.md and its folder, Env Management needs the command-line tools its instructions call (jq) and credentials named BOT_TOKEN, ANTHROPIC_API_KEY, OPENAI_API_KEY and APIFY_TOKEN. Our summary lists: A credential in OPENAI_API_KEY; A credential in APIFY_TOKEN.

Does Env Management access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Env Management safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Env Management use?

Env Management is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Env Management use?

About 1.5k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Env Management?

Skills that share tags, products or a category with Env Management: Iron Proxy Gateway for NanoClaw (nanocoai/nanoclaw, 31k stars), LangBot Deployment Guide (langbot-app/LangBot, 18k stars), Env Var Conventions (sgl-project/sglang, 37k stars) and Mac Fleet Maintenance (steipete/agent-scripts, 7.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Env Management?

grandamenium (a GitHub user) maintains it in grandamenium/cortextos, which has 101 GitHub stars. The repository holds 55 skills in this directory. The repository was last updated on September 23, 2026.

Source: grandamenium/cortextos on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.