code-mode-skill

code-mode-skill is a skill for Claude Code from zeenie-ai/OpenCompany. It costs 21 tokens per session (1,511 once invoked), scanned A, original, MIT.

A way to generate Python code that carries out a complete task in one execution instead of issuing tool calls one after another.

In plain words
What is it for?
Writing scripts that analyse data, repeat actions, handle conditions, and solve multi-step tasks with Python.
Why use it?
It can reduce repeated communication and keep loops, conditions, variables, and error handling together in one place.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Writing scripts that analyse data, repeat actions, handle conditions, and solve multi-step tasks with Python.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zeenie-ai/opencompany/code-mode-skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zeenie-ai/OpenCompany --skill code-mode-skill
Clone the repo
git clone --depth 1 https://github.com/zeenie-ai/OpenCompany

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-mode-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/zeenie-ai/opencompany/code-mode-skill.svg)](https://agentmods.dev/skills/zeenie-ai/opencompany/code-mode-skill)
Your own site
<a href="https://agentmods.dev/skills/zeenie-ai/opencompany/code-mode-skill"><img src="https://agentmods.dev/badge/skills/zeenie-ai/opencompany/code-mode-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,511 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.01511
Opus 5 $0.00010 $0.00756
Sonnet 5 $0.00004 $0.00302
Haiku 4.5 $0.00002 $0.00151

Measured 8d ago against content hash 120adaddb878, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

code-mode-skill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

server/skills/autonomous/code-mode-skill/SKILL.md · 226 lines

How it starts

The opening of the file, as written. The whole thing — 226 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Code Mode Pattern

You are a Code Mode agent. Instead of calling tools sequentially, generate Python code that accomplishes the entire task in a single execution.

Why Code Mode?

Research from Cloudflare and Anthropic shows Code Mode provides:

  • 81-98% token savings vs sequential tool call sequences
  • Explicit control flow - loops, conditionals, error handling in code
  • Reusable patterns - functions and variables persist across iterations
  • Better debugging - executable code is easier to trace and verify

Available Libraries

When generating Python code, you have access to:

import math          # Mathematical functions (factorial, sqrt, sin, cos, etc.)
import json          # JSON parsing and serialization
import datetime      # Date and time operations
from datetime import timedelta
import re            # Regular expressions for text processing
import random        # Random number generation
from collections import Counter, defaultdict  # Data structures

Core Pattern

  1. Analyze - Understand the complete task requirements
  2. Generate - Write complete Python code that solves the entire task
  3. Execute - Use the python_code tool to run the code
  4. Return - The code output becomes your response

Simple Example

Task: "Calculate factorial of 10 and check if it's divisible by 7"

Wrong approach (multiple tool calls - wasteful):

1. Call calculator: factorial(10)
2. Get result: 3628800
3. Call calculator: 3628800 % 7
4. Get result: 0
5. Return answer
(4 LLM round-trips, ~4000 tokens)

Code Mode approach (single execution):

import math
import json

# Calculate factorial
result = math.factorial(10)

# Check divisibility
divisible = result % 7 == 0

# Output structured result
output = {
    "factorial_of_10": result,
    "divisible_by_7": divisible,
    "remainder": result % 7
}
print(json.dumps(output, indent=2))

(2 LLM round-trips, ~800 tokens - 80% savings)

Complex Example with Loop

Read the full file on GitHub · 226 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 226 lines · 21 tokens per session scan A 120adaddb878

Subscribe to this mod's changes

code-mode-skill is a skill published in the GitHub repository zeenie-ai/OpenCompany (871 stars, last pushed yesterday), licensed MIT. It adds 21 tokens to every session and 1,511 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.