Claude Runner logo

Claude Runner

Organization
aspenkit
claude-runner

Claude/Codex CLI execution layer — prompt loading, stream-json parsing, file output extraction, path sanitization, skill file writing, and skill rule generation

Overview

Publisheraspenkit
Repositoryaspens
Skill nameclaude-runner
Stars
102
Forks
7
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by aspenkit on GitHub. Read the source before you install it.

Installation

Install the Claude Runner AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/aspenkit/aspens/tree/main/.agents/skills/claude-runner
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/aspenkit/aspens.git /tmp/aspens
mkdir -p .claude/skills
cp -r /tmp/aspens/.agents/skills/claude-runner .claude/skills/claude-runner
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Claude Runner in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Claude Runner on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Claude Runner is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

You are working on the CLI execution layer — the bridge between assembled prompts and the claude -p / codex exec CLIs, plus skill file I/O.

Key Concepts

  • Stream-JSON protocol (Claude): runClaude() always passes --verbose --output-format stream-json. Output is NDJSON: type: 'result' has final text + usage; type: 'assistant' has text/tool_use blocks; type: 'user' has tool_result blocks.
  • JSONL protocol (Codex): runCodex() spawns codex exec --json --sandbox read-only --ephemeral. The --ask-for-approval never flag is conditionally included based on capability detection (see below). Prompt is passed via stdin ('-' placeholder arg) to avoid shell arg length limits. Stdin write happens after event handlers are attached so fast failures are captured. Events: item.completed/item.updated with normalized types.
  • Codex capability detection: getCodexExecCapabilities() (internal, cached) runs codex exec --help and checks if --ask-for-approval appears in the help text. Result is cached in module-level codexExecCapabilities variable. If the help check fails (e.g., codex not installed), capabilities default to { supportsAskForApproval: false }. runCodex() only adds --ask-for-approval never when supportsAskForApproval is true.
  • Unified routing: runLLM(prompt, options, backendId) is the shared entry point — dispatches to runClaude() or runCodex() based on backendId. Exported from runner.js so command handlers no longer need local routing helpers.
  • Codex internals (private): normalizeCodexItemType() converts PascalCase/kebab-case to snake_case. collectCodexText() recursively extracts text from nested event content. Both are internal to runner.js.
  • Prompt templating: loadPrompt(name, vars) resolves {{partial-name}} from src/prompts/partials/ first, then substitutes {{varName}} from vars. Target-specific vars (skillsDir, skillFilename, instructionsFile, configDir) are passed by command handlers.
  • File output parsing: Primary: <file path="...">content</file> XML tags. Fallback: <!-- file: path --> comment markers. parseFileOutput(output, allowedPaths) accepts optional { dirPrefixes, exactFiles } to override default allowed paths.
  • Path sanitization: sanitizePath(rawPath, allowedPaths) (internal) blocks .. traversal, absolute paths. Defaults: .claude/ prefix + AGENTS.md exact. Multi-target callers pass expanded allowed paths via getAllowedPaths() from target.js.
  • Validation: validateSkillFiles() checks for truncation (XML tag collisions), missing frontmatter, missing sections, bad file path references.
  • Skill rules generation: extractRulesFromSkills() reads all skills via skill-reader.js, produces skill-rules.json (v2.0) with file patterns, keywords, and intent patterns.
  • Domain patterns: generateDomainPatterns() converts file patterns to bash detect_skill_domain() function using BEGIN/END markers.
  • Trigger parsing precedence: parseTriggersFrontmatter(content) returns { filePatterns, keywords, alwaysActivate } parsed from a triggers: block in YAML frontmatter (supports block lists, inline arrays, and alwaysActivate: true for the base skill); returns null when no triggers: key exists. parseActivationPatterns and parseKeywords prefer this frontmatter when present and fall back to legacy ## Activation / Keywords: line parsing for older skills.
  • Settings merge: mergeSettings() merges aspens hook config into existing settings.json. Detects aspens-managed hooks by ASPENS_HOOK_MARKERS (skill-activation-prompt, graph-context-prompt, post-tool-use-tracker, save-tokens-statusline, save-tokens-prompt-guard, save-tokens-precompact). Also handles statusLine merging — replaces existing statusLine only if the current one is aspens-managed (detected by isAspensHook), preserving user-custom statusLine configs. After merging hooks, dedupeAspensHookEntries() removes duplicate aspens-managed entries per event type.
  • Directory-scoped writes: writeTransformedFiles() handles files outside .claude/ (e.g., src/billing/AGENTS.md) with explicit path allowlist — only AGENTS.md, AGENTS.md exact files and .claude/, .agents/, .codex/ prefixes are permitted.
  • findSkillFiles matching: Only matches the exact skillFilename (e.g., skill.md or SKILL.md), not arbitrary .md files in the skills directory.

Critical Rules

  • Both --verbose and --output-format stream-json are required for Claude — omitting either breaks stream parsing.
  • Codex uses --json --sandbox read-only --ephemeral — --sandbox read-only restricts filesystem access, --ephemeral avoids persisting conversation. --ask-for-approval never is added only if getCodexExecCapabilities() confirms support. Prompt goes via stdin, not as a CLI arg.
  • Codex stdin write order matters — event handlers (stdout, stderr, close, error) must be attached before writing to stdin, so fast failures are captured.
  • Path sanitization is non-negotiable — sanitizePath() blocks .. traversal, absolute paths, and any path not in the allowed set.
  • Prompt partials resolve before variables — {{skill-format}} resolves to partials/skill-format.md first. If no file, falls through to variable substitution.
  • Timeout resolution: resolveTimeout(flagValue, fallbackSeconds) — --timeout flag wins, then ASPENS_TIMEOUT env, then caller-provided fallback. Size-based defaults (small: 120s, medium: 300s, large: 600s, very-large: 900s) are set by command handlers, not runner.
  • Disk writes are sanitized — writeSkillFiles and writeTransformedFiles pass every payload through sanitizePublishedContent so forbidden blocks (## Activation, ## Key Files, hub/cluster/hotspot tables outside code-map.md) cannot leak to disk even if an earlier stage missed them.
  • mergeSettings preserves non-aspens hooks and statusLine — identifies aspens hooks by ASPENS_HOOK_MARKERS (now includes save-tokens markers), replaces matching entries, preserves everything else. StatusLine only replaced if current one is aspens-managed. Post-merge deduplication ensures no duplicate aspens entries accumulate.
  • Debug mode: Set ASPENS_DEBUG=1 to dump raw stream-json to $TMPDIR/aspens-debug-stream.json (Claude) or $TMPDIR/aspens-debug-codex-stream.json (Codex). Codex also logs exit code and output length to stderr.

Last Updated: 2026-05-11

Frequently asked questions

What does the Claude Runner AI skill do?

Claude/Codex CLI execution layer — prompt loading, stream-json parsing, file output extraction, path sanitization, skill file writing, and skill rule generation

Why use Claude Runner on TypingMind?

Because you install it once and use it with any model. Claude Runner is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Claude Runner in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/aspenkit/aspens/tree/main/.agents/skills/claude-runner. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Claude Runner?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Claude Runner?

As many as you like. As long as a model supports skills, you can use Claude Runner with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Claude Runner AI skill free?

Yes. It is published on GitHub by aspenkit under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇