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 3mo 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.
- 3mo 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,129 stars, last pushed 5d ago), 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.
performant-code compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| performant-codevstorm-co/pydantic-deepagents | Skill | 1.1k | 5d ago | MIT | A | 14 | Claude Code, Codex |
| building-pydantic-ai-agentspydantic/pydantic-ai | Skill | 22k | today | MIT | A | 92 | Claude Code, Codex |
| pydantic-ai-harnesspydantic/pydantic-ai | Skill | 22k | today | MIT | A | 208 | Claude Code, Codex |
| migrating-langchain-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 100 | Codex |
| migrating-vercel-ai-sdk-and-eve-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 107 | Codex |
| migrating-pi-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 88 | Codex |
| migrating-claude-agent-sdk-to-pydantic-aipydantic/pydantic-ai | Skill | 22k | today | MIT | A | 90 | Codex |