persistent-python

persistent-python is a skill for Claude Code from AnswerDotAI/skill-plugins. It costs 118 tokens per session (937 once invoked), scanned B, original, Apache-2.0.

A persistent Python session for repeated Python work, including inspecting files, testing code, debugging, and working with notebooks. Values and imports remain available between commands.

In plain words
What is it for?
Use it for Python coding, package and API checks, data transformations, notebook work, and other tasks that can be performed in Python.
Why use it?
It avoids restarting the Python environment for every experiment and keeps inspection and debugging state in one place.

Skill for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: reads .claude/ paths; mentions Claude Code.

Part of the claude-aai plugin — 5 skills shipped together

Good fit Use it for Python coding, package and API checks, data transformations, notebook work, and other tasks that can be performed in Python.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/answerdotai/skill-plugins/persistent-python
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 AnswerDotAI/skill-plugins --skill persistent-python
Clone the repo
git clone --depth 1 https://github.com/AnswerDotAI/skill-plugins

Made for: Claude Code.

Or install claude-aai, the plugin that ships this one along with the rest of its 5 skills.

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 persistent-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/answerdotai/skill-plugins/persistent-python/github.svg)](https://agentmods.dev/skills/answerdotai/skill-plugins/persistent-python)
Your own site
<a href="https://agentmods.dev/skills/answerdotai/skill-plugins/persistent-python"><img src="https://agentmods.dev/badge/skills/answerdotai/skill-plugins/persistent-python/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for persistent-python

Your own site · 80×15
<a href="https://agentmods.dev/skills/answerdotai/skill-plugins/persistent-python"><img src="https://agentmods.dev/badge/skills/answerdotai/skill-plugins/persistent-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 118 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 937 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00118 $0.00937
Opus 5.5 $0.00047 $0.00375
Sonnet 5.5 $0.00024 $0.00187
Haiku 4.5 $0.00012 $0.00094

Measured 1mo ago against content hash f936b0b1d244, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

persistent-python scanned grade B with 1 finding 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 1mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- Claude Code settings are plain JSON: `~/.claude/settings.json` (user-global), `.claude/settings.json` (project, committed), `.claude/settings.local.json` (project, personal); later files override earlier. Edit them wit
plugins/claude-aai/skills/persistent-python/SKILL.md · 24 lines

How it starts

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

Persistent Python

ALWAYS use the clikernel MCP server for ALL Python work: writing code, editing code or notebooks, running or debugging anything, inspecting objects or packages, probing APIs, and transforming data. It is the workbench for every task in this environment. If the work could go through Python, it goes through clikernel. Do not fall back to python -c, shell heredocs, or ad hoc scripts.

The server's execute tool runs code in one persistent IPython session, so imports, variables, monkeypatches, and cached objects carry across calls. Check the clikernel MCP server instructions already in your context before the first call. Normally the startup script has run, and its output says what is imported and which cells to run next. Follow it. If the instructions report that project imports were skipped, or contain no startup output, report that to the user before other work. Then run the guarded import block from $XDG_CONFIG_HOME/clikernel/startup.py (default ~/.config/clikernel/startup.py) as one execute call. That file is the single source of truth for bootstrap imports; never retype them from memory.

Complete every practice task named in the server instructions (the llmdojo round started by dojo_start()) before any other work. This gate applies in every session, including tasks that only read files or search directories.

The server instructions and startup docs cover the tools, notebook magics, output shape, interaction rules, reload gotchas, and pyskills workflow, so this skill does not repeat them. list_pyskills() shows the available tooling. Prefer a relevant pyskill over ad hoc code.

Environment specifics

The following apply specifically to this environment:

  • Doc-state persists on disk per conversation and is managed mechanically (the compaction hook resets it when your context is rewritten), so there is nothing to run by hand: doc notes fire exactly for the functions whose docs you don't hold. After a kernel restart or compaction, just read doc(f) again whenever a note fires.
  • Use exhash for ALL edits -- code, tests, config, prose, notebook cells -- never the host's built-in file-edit tools, and read with lnhashview_* (not the host's file reader) the moment an edit is plausible. llmsurgery.dlgskill covers the structural cell/message operations exhash doesn't; fastcore.tools file editors are the rare fallback where exhash can't express a text edit.
  • Claude Code settings are plain JSON: ~/.claude/settings.json (user-global), .claude/settings.json (project, committed), .claude/settings.local.json (project, personal); later files override earlier. Edit them with the normal kernel tooling (lnhashview_file + %%exhash), merging into existing keys rather than replacing, then verify with json.load. Useful facts: a BARE tool name in permissions.deny removes that tool from the system prompt entirely, while a scoped rule (Bash(rm *)) only blocks matching calls; hooks live under "hooks" keyed by event (PreToolUse, SessionStart, UserPromptSubmit, ...); skillOverrides hides bundled skills ("off", or "user-invocable-only" to keep the slash command usable by the user). Settings load at startup, so changes take effect from the next session.
  • Narration between consecutive tool calls must ride inside a tool call, since mid-run assistant text is neither shown nor saved (anthropics/claude-code#75900). For clikernel work that means a separate execute call containing only a Python comment: one or two prose lines starting #, saying what the last result showed and what comes next. It runs as a no-op, renders in the transcript, and persists across resume. Retire this practice when the issue is fixed.

Read the full file on GitHub · 24 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. 1mo ago First seen · 24 lines · 0 tokens per session scan B f936b0b1d244

Subscribe to this mod's changes

persistent-python is a skill published in the GitHub repository AnswerDotAI/skill-plugins (5 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 118 tokens to every session and 937 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

matlab

Builds, reviews, migrates, and plans MATLAB or GNU Octave numerical workflows. Use for arrays, tabular/time data, tests, projects, graphics, MAT files, and explicit Python interoperability.

K-Dense-AI/scientific-agent-skills · 44 tokens

pennylane

Builds and differentiates PennyLane quantum circuits, hybrid PyTorch or JAX models, molecular VQE and QAOA workflows. Use for variational quantum algorithms, quantum machine learning, simulator validation, and moving validated circuits to provider plugins. For hardware-specific compilation use qiskit or cirq; for…

K-Dense-AI/scientific-agent-skills · 74 tokens

rocm-kernels

Provides guidance for writing and benchmarking optimized Triton kernels for AMD GPUs (MI355X, R9700) on ROCm, targeting HuggingFace diffusers (LTX-Video, SD3, FLUX) and transformers. Core kernels: RMSNorm, RoPE 3D, GEGLU, AdaLN. Includes XCD swizzle, autotune, diffusers integration patterns, and LTX-Video pipeline…

huggingface/kernels · 93 tokens

holoscan-install-wheel

Install Holoscan SDK Python wheel via pip into a venv. Use for Python installs; not for native C++/apt or Conda installs.

NVIDIA/skills · 37 tokens

typing-exclusion-worker

Python typing exclusion worker: remove assigned mypy exclusion modules in small scoped batches, fix typing issues, run validation, and produce a structured completion summary. Use when running parallel typing-debt workers or when asked to remove modules from pyproject mypy exclusion overrides.

getsentry/skills · 57 tokens

python

Python development with ruff, mypy, pytest - TDD and type safety.

alinaqi/maggy · 18 tokens