profile-memory

profile-memory is a skill for Claude Code from marcus/sidecar. It costs 57 tokens per session (2,142 once invoked), scanned B, original, MIT.

A guide for investigating Sidecar memory and performance problems using profiling data and system tools.

In plain words
What is it for?
It helps inspect processes, memory regions, heap and CPU profiles, goroutine stacks, file descriptors, SQLite locks, and changes over time.
Why use it?
It helps connect symptoms such as growing memory use, high CPU, leaked goroutines, or too many open files to possible causes.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: positional $N argument; mentions Codex.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./scripts/mem-monitor.sh # Default: port 6060, 60s interval.

Good fit It helps inspect processes, memory regions, heap and CPU profiles, goroutine stacks, file descriptors, SQLite locks, and changes over time.

Compare 6 skills from other repositories ↓
About the project

Sidecar is a terminal-based workspace for running AI coding agents alongside file trees, task issues, Git diffs, and Jira or GitHub resources in split panes. Developers use it to monitor agent sessions, inspect files and changes, manage workspaces, and handle tasks without leaving one shell. The catalogue entries extend or guide coding-agent workflows used with Sidecar.

marcus/sidecar · 1,091 stars · on GitHub

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/marcus/sidecar
agentmods
npx agentmods add skills/marcus/sidecar/profile-memory

Made for: Claude Code.

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 profile-memory

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/marcus/sidecar/profile-memory"><img src="https://agentmods.dev/badge/skills/marcus/sidecar/profile-memory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 57 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,142 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 4 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Agent Snooping · line 80
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 81
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 211
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 212
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
How audits are shown
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.00057 $0.02142
Opus 5.5 $0.00023 $0.00857
Sonnet 5.5 $0.00011 $0.00428
Haiku 4.5 $0.00006 $0.00214

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

Security

Grade B, and why

profile-memory scanned grade B with 2 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 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.

lsof -p <PID> | grep -c '\.claude/projects'

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl http://localhost:6060/debug/pprof/heap > heap.prof
.claude/skills/profile-memory/SKILL.md · 251 lines

How it starts

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

Memory Profiling for Sidecar

Quick Triage

Symptom Tool Action
High RSS / memory growth vmmap, pprof heap Check system memory, then heap profile
Too many open files lsof Check FD count and breakdown
High CPU pprof cpu, ps Capture CPU profile
Goroutine leak pprof goroutines Check goroutine count and stacks
Plugin unresponsive lsof + goroutines Check SQLite locks, blocked goroutines
Triage flow: Is RSS high? -> Check FD count -> Check vmmap -> Check heap profile

System-Level Profiling (No pprof Required)

Find the Process

pgrep -f sidecar
ps aux | grep sidecar

Basic Stats

# RSS, VSZ, CPU%, thread count
ps -o pid,rss,vsz,%cpu,nlwp -p <PID>

# Human-readable RSS
ps -o pid,rss -p <PID> | awk 'NR>1{printf "%d MB\n", $2/1024}'

# Watch over time
while true; do ps -o rss,%cpu -p <PID> | tail -1; sleep 5; done

System Memory

macOS (vmmap):

vmmap --summary <PID>

Key sections: VM_ALLOCATE (Go heap), MALLOC (C heap/SQLite), Physical footprint, Swapped.

Red flags:

  • RESIDENT SIZE >500MB for idle sidecar
  • REGION COUNT in thousands for VM_ALLOCATE = mmap leak
  • SWAPPED SIZE growing = memory pressure

Linux:

cat /proc/<PID>/status | grep -E 'VmRSS|VmSize|Threads'
pmap -x <PID> | tail -5
ls /proc/<PID>/fd | wc -l

File Descriptor Analysis

# Count and breakdown
lsof -p <PID> | wc -l
lsof -p <PID> | awk '{print $5}' | sort | uniq -c | sort -rn

# Find leaked files
lsof -p <PID> | grep REG | awk '{print $9}' | sort | uniq -c | sort -rn | head -20

# Check session file leaks
lsof -p <PID> | grep -c '\.claude/projects'
lsof -p <PID> | grep -c '\.codex/sessions'

# Watch FD count
while true; do echo "$(date): $(lsof -p <PID> 2>/dev/null | wc -l) FDs"; sleep 30; done

Healthy baselines: Total FDs 50-150, REG files 10-30, PIPEs 10-30, DIRs 5-15.

Red flags: 1000+ total FDs, same file opened 4+ times, growing count over time.

Read the full file on GitHub · 251 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 · 251 lines · 57 tokens per session scan B 70bb47171db0

Subscribe to this mod's changes

profile-memory is a skill published in the GitHub repository marcus/sidecar (1,091 stars, last pushed 11d ago), licensed MIT. It adds 57 tokens to every session and 2,142 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 2 findings (reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

cvm-ai-doctor

A health-diagnosis workflow for servers, computers, virtual machines, and containers on Linux, macOS, or Windows.

TencentCloud/Octop · 60 tokens

feedback

Skill "feedback" from Hmbown/Codewhale, covering feedback, when to use, setup, workflow and non-goals.

Hmbown/Codewhale · 0 tokens

rubber-duck

Adversarial "rubber duck" review that turns explaining-out-loud into a hallucination check. The main session is the PRESENTER (it did the work — a design doc, investigation, or analysis — and holds the real reasoning) and reconstructs the topic to a LISTENER — a spawned subagent pinned to a DIFFERENT-vendor model that…

kirodotdev/KiroCrew · 161 tokens

ios-simulator

Verify and debug native, React Native, Expo, or Flutter apps on an iOS Simulator with agent-device. Use when an agent needs to launch an app, inspect its live UI, tap, type, scroll, validate a code change, collect failure evidence, or reproduce a workflow on an iPhone or iPad Simulator.

callstack/agent-device · 69 tokens

ai-discover

Read-only discovery step of the auto-improvement loop. One bounded agent turn per cycle reads the focus files (Read/Grep/Glob only, no shell, no subagents) and replies with a JSON array of testable surfaces {file, line, symbol, rule, message, hypothesis}; the spine authors fixes and verifies them. Discovery only — no…

kirodotdev/KiroCrew · 83 tokens

debug

Debug issues in the MCP Gateway Registry using first-principles thinking. Invoke when something is broken, timing out, returning errors, or behaving unexpectedly. Forces structured root-cause analysis before any code change is proposed.

agentic-community/mcp-gateway-registry · 45 tokens