memory

memory is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 36 tokens per session (3,436 once invoked), scanned A, original, MIT.

Swift memory guidance covers InlineArray and Span, newer Swift types for fixed-size storage and checked access to contiguous memory. It also explains alternatives to unsafe pointer-based code.

In plain words
What is it for?
Use it for performance-critical paths such as binary parsing, signal processing, embedded Swift, and other code working with fixed-size or contiguous data.
Why use it?
It helps reduce unnecessary allocation and copying while keeping low-level memory access checked by the compiler.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the apple-skills plugin — 182 skills shipped together , and of apple-skills

Good fit Use it for performance-critical paths such as binary parsing, signal processing, embedded Swift, and other code working with fixed-size or contiguous data.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/memory
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 rshankras/claude-code-apple-skills --skill memory
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 182 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 memory

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/memory/github.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/memory)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/memory"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/memory/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 memory

Your own site · 80×15
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/memory"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,436 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.
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.00036 $0.03436
Opus 5.5 $0.00014 $0.01374
Sonnet 5.5 $0.00007 $0.00687
Haiku 4.5 $0.00004 $0.00344

Measured yesterday against content hash 71bf7bb3ecc9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

memory 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 yesterday.

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.

skills/swift/memory/SKILL.md · 359 lines

How it starts

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

InlineArray and Span

Guidance for Swift 6.2's low-level memory types: InlineArray for fixed-size inline storage without heap allocation, and Span for safe, zero-cost access to contiguous memory. These replace common uses of UnsafeBufferPointer and hand-tuned tuple storage with compiler-checked alternatives.

When This Skill Activates

Use this skill when the user:

  • Asks about InlineArray, fixed-size arrays, or stack-allocated collections
  • Mentions Span, MutableSpan, RawSpan, or UTF8Span
  • Wants to eliminate heap allocations in hot paths
  • Is replacing UnsafeBufferPointer or UnsafePointer with safe alternatives
  • Asks about value generics or let count: Int generic parameters
  • Needs zero-copy access to collection storage
  • Mentions inline storage, contiguous memory, or memory layout
  • Is doing binary parsing, signal processing, or embedded Swift work
  • Wants to avoid copy-on-write overhead for small fixed collections
  • Asks about non-escapable types or lifetime dependencies in Swift

Decision Tree

What memory optimization do you need?
│
├─ A fixed-size collection that never grows/shrinks
│  │
│  ├─ Size known at compile time, stored on stack
│  │  └─ InlineArray<N, Element>
│  │     ├─ No heap allocation
│  │     ├─ No reference counting
│  │     └─ No copy-on-write (eager copies)
│  │
│  └─ Size may vary at runtime
│     └─ Array<Element> (standard library)
│
├─ Safe read access to contiguous memory
│  │
│  ├─ Read-only access to typed elements
│  │  └─ Span<Element>
│  │
│  ├─ Mutable access to typed elements
│  │  └─ MutableSpan<Element>
│  │
│  ├─ Read-only access to raw bytes
│  │  └─ RawSpan
│  │
│  ├─ Mutable access to raw bytes
│  │  └─ MutableRawSpan
│  │
│  ├─ Unicode text processing
│  │  └─ UTF8Span
│  │
│  └─ Initializing a new collection's storage
│     └─ OutputSpan
│
├─ Unsafe pointer access (legacy or interop)
│  └─ UnsafeBufferPointer / UnsafeMutableBufferPointer
│     └─ Prefer Span instead for new code
│
└─ Standard dynamic collection
   └─ Array<Element>
      ├─ Heap-allocated, copy-on-write
      └─ Grows/shrinks dynamically

Read the full file on GitHub · 359 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. yesterday First seen · 359 lines · 36 tokens per session scan A 71bf7bb3ecc9

Subscribe to this mod's changes

memory is a skill published in the GitHub repository rshankras/claude-code-apple-skills (864 stars, last pushed 2d ago), licensed MIT. It adds 36 tokens to every session and 3,436 once invoked, about $0.0001 per session on Opus 5.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-11-05.

Related

memory compared with skills from other repositories

memory next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
memoryrshankras/claude-code-apple-skillsSkill8642d agoMITA36Claude Code
swift-expertpersonamanagmentlayer/pclSkill4411d agoApache-2.0A76Claude Code
ios-expertpersonamanagmentlayer/pclSkill4411d agoApache-2.0A64Claude Code
swift6-concurrencymarkdavidgan/apple-dev-skillsSkill52mo agoMITA74Claude Code
ios-swiftui-productJasonColapietro/ios-app-dev-skillsSkill92mo agoMITA67Codex
swiftui-maxDev869/swift-tothemaxSkill74mo agoMITA271Claude Code
swift-languageDev869/swift-tothemaxSkill74mo agoMITA167Claude Code