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 ayushcodes10/echo-mem --skill source-command-hooks-session-endgit clone --depth 1 https://github.com/ayushcodes10/echo-memWrote 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/ayushcodes10/echo-mem/source-command-hooks-session-end)<a href="https://agentmods.dev/skills/ayushcodes10/echo-mem/source-command-hooks-session-end"><img src="https://agentmods.dev/badge/skills/ayushcodes10/echo-mem/source-command-hooks-session-end/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/ayushcodes10/echo-mem/source-command-hooks-session-end"><img src="https://agentmods.dev/badge/skills/ayushcodes10/echo-mem/source-command-hooks-session-end.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00015 | $0.00607 |
| Opus 5.5 | $0.00006 | $0.00243 |
| Sonnet 5.5 | $0.00003 | $0.00121 |
| Haiku 4.5 | $0.00002 | $0.00061 |
Grade A, and why
source-command-hooks-session-end 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 2mo 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 — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.
source-command-hooks-session-end
Use this skill when the user asks to run the migrated source command hooks-session-end.
Command Template
hook session-end
Cleanup and persist session state before ending work.
Usage
npx Codex-flow hook session-end [options]
Options
--session-id, -s <id>- Session identifier to end--save-state- Save current session state (default: true)--export-metrics- Export session metrics--generate-summary- Create session summary--cleanup-temp- Remove temporary files
Examples
Basic session end
npx Codex-flow hook session-end --session-id "dev-session-2024"
With full export
npx Codex-flow hook session-end -s "feature-auth" --export-metrics --generate-summary
Quick close
npx Codex-flow hook session-end -s "quick-fix" --save-state false --cleanup-temp
Complete persistence
npx Codex-flow hook session-end -s "major-refactor" --save-state --export-metrics --generate-summary
Features
State Persistence
- Saves current context
- Stores open files
- Preserves task progress
- Maintains decisions
Metric Export
- Session duration
- Commands executed
- Files modified
- Tokens consumed
- Performance data
Summary Generation
- Work accomplished
- Key decisions made
- Problems solved
- Next steps identified
Cleanup Operations
- Removes temp files
- Clears caches
- Frees resources
- Optimizes storage
Integration
This hook is automatically called by Codex when:
- Ending a conversation
- Closing work session
- Before shutdown
- Switching contexts
Manual usage in agents:
# At session end
npx Codex-flow hook session-end --session-id "your-session" --generate-summary
Output
Returns JSON with:
{
"sessionId": "dev-session-2024",
"duration": 7200000,
"saved": true,
"metrics": {
"commandsRun": 145,
"filesModified": 23,
"tokensUsed": 85000,
"tasksCompleted": 8
},
"summaryPath": "/sessions/dev-session-2024-summary.md",
"cleanedUp": true,
"nextSession": "dev-session-2025"
}
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.
- 2mo ago First seen · 130 lines · 15 tokens per session scan A c7dab27a51f5
source-command-hooks-session-end is a skill published in the GitHub repository ayushcodes10/echo-mem (2 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 15 tokens to every session and 607 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-09-12.
source-command-hooks-session-end compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| source-command-hooks-session-endayushcodes10/echo-mem | Skill | 2 | 2mo ago | Apache-2.0 | A | 15 | Claude Code, Codex |
| squishmichielhdoteth/squish-memory | Skill | 12 | yesterday | MIT | A | 157 | Claude Code, Codex |
| postgramivo-toby/postgram | Skill | 11 | 16d ago | AGPL-3.0 | A | 184 | Claude Code, Codex |
| memanto-companionmoorcheh-ai/memanto | Skill | 2.4k | today | Apache-2.0 | A | 72 | Claude Code |
| openloreaakarim/OpenLore | Skill | 2.0k | today | Apache-2.0 | A | 42 | Claude Code, Codex |
| remindb-setupradimsem/remindb | Skill | 129 | today | MIT | A | 202 | Claude Code |
| company-agent-infrastructurelobu-ai/lobu | Skill | 240 | today | Apache-2.0 | A | 70 | Claude Code |