Pydantic Deep Agents is a self-hosted terminal AI assistant and Python framework for building coding, research, and other AI agents. It gives agents tools such as file access, shell commands, planning, memory, sub-agents, sandboxed execution, and MCP connections, and supports different models.
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.
npx skills add vstorm-co/pydantic-deepagents --skill performant-codegit clone --depth 1 https://github.com/vstorm-co/pydantic-deepagentsWrote 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.
[](https://agentmods.dev/skills/vstorm-co/pydantic-deepagents/performant-code)<a href="https://agentmods.dev/skills/vstorm-co/pydantic-deepagents/performant-code"><img src="https://agentmods.dev/badge/skills/vstorm-co/pydantic-deepagents/performant-code/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.
<a href="https://agentmods.dev/skills/vstorm-co/pydantic-deepagents/performant-code"><img src="https://agentmods.dev/badge/skills/vstorm-co/pydantic-deepagents/performant-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00014 | $0.00632 |
| Opus 5.5 | $0.00006 | $0.00253 |
| Sonnet 5.5 | $0.00003 | $0.00126 |
| Haiku 4.5 | $0.00001 | $0.00063 |
Grade A, and why
performant-code scanned grade A 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- `subprocess.run()` > `os.system()` How it starts
The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Performant Code
How to write code that won't timeout on large inputs.
Think About Scale First
Before writing code, ask: how big is the data?
| Data size | Approach |
|---|---|
| < 1 MB | Load into memory, any approach works |
| 1-100 MB | Load into memory, but use efficient algorithms |
| 100 MB - 1 GB | Stream/mmap, avoid loading entirely into memory |
| > 1 GB | Streaming only, chunk-based processing |
I/O Optimization
Large files
- mmap (C:
mmap(), Python:mmap.mmap()) — map file into memory, OS handles paging - Buffered binary reads —
fread()in C,open(f, 'rb').read(chunk)in Python - NEVER read a 500MB file line-by-line with
fgets()when you need random access
Writing output
- Buffer writes — don't call
write()for every byte - Use
fwrite()orsys.stdout.buffer.write()for binary output - Flush only when needed
Algorithm Complexity
- O(n) beats O(n log n) beats O(n²) — always
- Nested loops on large data = timeout. Restructure to single pass + hash map
- Sorting is O(n log n) — only sort if you need to
- Use hash maps/sets for lookup instead of linear search
- Pre-compute what you can outside loops
Language-Specific Tips
C
- Use
mmap()for large file access -O2or-O3for compiler optimizations- Avoid
malloc()/free()in tight loops — pre-allocate - Use
memcpy()instead of byte-by-byte copying - Integer arithmetic > floating point when possible
Python
- Use
numpyfor numerical work (100x faster than pure Python loops) collections.Counter,defaultdict— avoid manual counting- List comprehensions > explicit loops
struct.unpack()for binary parsingsubprocess.run()>os.system()- For heavy computation: consider writing a small C program instead
General
- Profile before optimizing — find the actual bottleneck
- If a program hangs, it's likely: infinite loop, deadlock, or I/O bound on huge data
- If a program is slow, check: algorithm complexity, I/O pattern, memory allocation
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.
- 1mo ago First seen · 71 lines · 14 tokens per session scan A e6b38be0640b
performant-code is a skill published in the GitHub repository vstorm-co/pydantic-deepagents (1,103 stars, last pushed today), licensed MIT. It adds 14 tokens to every session and 632 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
pydantic-ai
Build production-ready AI agents with PydanticAI — type-safe tool use, structured outputs, dependency injection, and multi-model support.
building-pydantic-ai-agents
Build AI agents with Pydantic AI — tools, capabilities (including on-demand loading), workspaces, structured output, streaming, testing, and multi-agent patterns. Use when the user mentions Pydantic AI, imports pydanticai, or asks to build an AI agent, add tools/capabilities, attach a workspace, defer capability…
pydantic-ai-harness
Extend Pydantic AI agents with capabilities from pydantic-ai-harness -- the Coder coding agent, file and shell tools in local or sandboxed workspaces (Modal, E2B, Sprites, smolvm), Code Mode, sub-agents and planning, memory and skills, context compaction, guardrails and spend limits, web research and browsers, hosted…
migrating-langchain-to-pydantic-ai
Migrate Python LangChain, LangGraph, or Deep Agents applications to Pydantic AI and, when the source uses harness features, Pydantic AI Harness. Use for LangChain agents, chains, LCEL, direct LangGraph graphs, persistence, interrupts, streaming, and createdeepagent projects with planning, filesystem or sandbox…
migrating-mastra-to-pydantic-ai
Migrate TypeScript Mastra applications to Python with Pydantic AI and, only when needed, Pydantic AI Harness. Use when source code imports @mastra/ or relies on Mastra agents, tools, workflows, memory, processors, streaming, approvals, skills, or subagents.
migrating-vercel-ai-sdk-and-eve-to-pydantic-ai
Migrate TypeScript Vercel AI SDK or Eve applications to Python with Pydantic AI and, only when needed, Pydantic AI Harness. Use when source code imports ai, @ai-sdk/, or eve, or relies on generateText, streamText, ToolLoopAgent, useChat, Eve agents, tools, skills, subagents, approvals, sessions, channels, schedules…