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 agentmods add commands/shaheerkhawaja/productionos/session-validategit clone --depth 1 https://github.com/ShaheerKhawaja/ProductionOSWrote 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/commands/shaheerkhawaja/productionos/session-validate)<a href="https://agentmods.dev/commands/shaheerkhawaja/productionos/session-validate"><img src="https://agentmods.dev/badge/commands/shaheerkhawaja/productionos/session-validate.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00036 | $0.01047 |
| Opus 5 | $0.00018 | $0.00524 |
| Sonnet 5 | $0.00007 | $0.00209 |
| Haiku 4.5 | $0.00004 | $0.00105 |
Grade A, and why
session-validate 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 5d 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.
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.
How it starts
The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Session Validate — End-of-Session Self-Training
You are the Session Validator. After every ProductionOS session, you capture what happened, extract what was learned, and prepare the system to be better next time.
This is the feedback loop that makes ProductionOS compound. Without session validation, each run starts from zero. With it, run #N inherits all the wisdom of runs #1 through #N-1.
Step 0: Preamble
Before executing, run the shared ProductionOS preamble (templates/PREAMBLE.md).
Step 1: Capture Session Metrics
Read the session artifacts:
# Session analytics
cat ~/.productionos/analytics/skill-usage.jsonl | tail -50
# Active session markers
ls ~/.productionos/sessions/
# Git commits this session
git log --oneline --since="$(date -v-2H +%Y-%m-%dT%H:%M:%S)" 2>/dev/null || git log --oneline -20
# Self-eval results (if any)
ls .productionos/SELF-EVAL-*.md 2>/dev/null
cat .productionos/SELF-EVAL-*.md 2>/dev/null | tail -30
# Convergence data
cat .productionos/CONVERGENCE-LOG.md 2>/dev/null | tail -20
Compute:
SESSION METRICS:
duration: {estimated from first/last analytics entries}
commits: {count}
files_changed: {count from git diff --stat}
agents_dispatched: {count from skill-usage.jsonl}
self_eval_score: {average from SELF-EVAL results}
convergence_trajectory: {improving|stalled|declining}
test_pass_rate: {from last bun test}
cost_estimate: {from TOKEN-BUDGET.md or agent count * $0.75}
Step 2: Extract Lessons (standard + deep modes)
Dispatch the metaclaw-learner agent to analyze session artifacts:
Read agents/metaclaw-learner.md, extract its <role> and <instructions>.
Dispatch via Agent tool:
prompt: "Analyze the session artifacts in .productionos/ and extract lessons. Focus on: what worked well, what failed, what patterns emerged, what should be done differently next time."
run_in_background: false (wait for results)
The metaclaw-learner will:
- Read all
.productionos/artifacts from this session - Extract structured lessons (trigger → lesson → rule)
- Write to
~/.productionos/instincts/project/{hash}/lessons.json - Promote high-confidence patterns (>0.8) to global instincts
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.
- 5d ago First seen · 126 lines · 36 tokens per session scan A 2f64ff27eeb0
session-validate is a command published in the GitHub repository ShaheerKhawaja/ProductionOS (8 stars, last pushed 4mo ago), licensed MIT. It adds 36 tokens to every session and 1,047 once invoked, about $0.0002 per session on Opus 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-08-31.
Other commands, from other repositories
rekindle
Recover a fellowship after a session crash. Scans worktrees and state files, presents a recovery dashboard, and re-spawns Gandalf with recovered quest context. Use when returning to a crashed or expired fellowship session.
resume
Resume a previous session. Reads recent session logs, open tasks, and last decisions — gives Claude full context without re-explaining the project.
recall
Search what this project knows about a concept — session history, and the documents written about it. Usage: /recall.
learn
Manually run the continuous-learner. Extract patterns from this session and write to .greatcto/lessons.md. Use when SessionEnd hook missed something or you want to capture a lesson mid-session.
ccr
CCR (Compressed Context with Retrieval) — recall the full original of context that greatcto compressed/filtered out, by its short id. The retrieval half of the compression layer.
settings
View or edit fellowship configuration (/.claude/fellowship.json). Run /settings to see current settings, change values, or reset to defaults.