ce

A session-closing command that checks code changes, runs the project's build, type checks, and lint checks, then records the results. It can also complete tracked tasks and save useful knowledge when the related tools are available.

In plain words
What is it for?
Use it before ending a coding session to inspect uncommitted changes, run quality checks, report the outcome, complete in-progress tasks, and capture reusable notes.
Why use it?
It gives the session a consistent final checklist, so unfinished work, failed checks, and unrecorded results are less likely to be missed.

Command for Claude Code

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.

agentmods
npx agentmods add commands/lktiep/cortex-hub/ce
Clone the repo
git clone --depth 1 https://github.com/lktiep/cortex-hub

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 566 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00000 $0.00566
Opus 5 $0.00000 $0.00283
Sonnet 5 $0.00000 $0.00113
Haiku 4.5 $0.00000 $0.00057

Measured 3d ago against content hash 1176481ff305, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ce 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 3d 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.

.claude/commands/ce.md · 68 lines

How it starts

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

/ce — Cortex End v0.7.0

Version: 0.7.0 | Updated: 2026-04-11 Changelog: v0.7.0 — unified versioning, session_end auto-saves memory, removed STATE.md, streamlined steps Changelog: v2.0 — added detect_changes, tool stats, task completion, recipe capture check

Run ALL steps IN ORDER before ending the session.

Step 1: Pre-commit Check

If uncommitted changes exist:

  • cortex_detect_changes(scope: "all") — verify blast radius
  • If HIGH risk → warn user before proceeding

Step 2: Quality Gates

pnpm build && pnpm typecheck && pnpm lint

Record pass/fail for each.

Step 3: Quality Report

cortex_quality_report(
  gate_name: "Session Quality",
  passed: <true if all gates pass>,
  score: <0-100>,
  details: "<build/typecheck/lint results>"
)

Step 4: Complete Conductor Tasks (Optional)

If cortex_task_list and cortex_task_update tools are available: cortex_task_list(status: "in_progress") — find tasks worked on this session. For each: cortex_task_update(taskId, status: "completed", result: { summary: "..." }) If the tools are not available, skip this step.

Step 5: Store Knowledge (if applicable)

If this session involved any of these, call cortex_knowledge_store:

  • Bug fix with non-obvious root cause
  • Architecture decision or tradeoff
  • Workflow pattern that worked well
  • Error + solution that others might encounter

Step 6: Store Memory

cortex_memory_store with:

  • What was done this session
  • Key decisions made
  • Context for resuming next session
  • Any user preferences discovered

Step 7: End Session

cortex_session_end(
  sessionId: "<from session_start>",
  summary: "<concise: what was done, what's next>"
)

The backend automatically saves this summary as searchable memory — a safety net even if Step 6 was skipped.

Step 8: Final Report

## Session Complete
- **Work done**: <brief summary>
- **Quality gates**: build pass/fail | typecheck pass/fail | lint pass/fail
- **Knowledge stored**: <N docs> or none
- **Tasks completed**: <list> or none
- **Next steps**: <what should be done next session>

Read the full file on GitHub · 68 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. 3d ago First seen · 68 lines · 0 tokens per session scan A 1176481ff305

Subscribe to this mod's changes

ce is a command published in the GitHub repository lktiep/cortex-hub (58 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 566 tokens. 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-30.