commit-context

A command that extracts possible long-term memories from conversation text, checks whether they are already known, and saves only new ones to the central database.

In plain words
What is it for?
Use it before a context or conversation is compacted, preview proposed memories with a dry run, and choose the writable store used for configuration and tag lookup.
Why use it?
It preserves important decisions and facts before context is shortened, while reducing duplicate memories.

Command

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/proticom/gnosys/commit-context
Clone the repo
git clone --depth 1 https://github.com/proticom/gnosys
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 569 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.00569
Opus 5 $0.00000 $0.00284
Sonnet 5 $0.00000 $0.00114
Haiku 4.5 $0.00000 $0.00057

Measured yesterday against content hash 068f35e3395b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

commit-context 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 yesterday.

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.

docs/commands/commit-context.md · 72 lines

How it starts

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

gnosys commit-context

Pre-compaction sweep: extract atomic memories from a conversation or context string, check novelty against existing memories, and commit novel ones to the central DB.

Usage

gnosys commit-context "Decision: use SQLite as source of truth"
gnosys commit-context "Meeting notes with durable decisions..." --dry-run
gnosys commit-context "Architecture notes..." --store project

Options

Option Description
--dry-run Show what would be committed without writing
-s, --store <store> Writable store for config/tag registry resolution (project, personal, global)

--store selects the writable store used for config and tag registry resolution in this command. Committed memories are inserted with the current project context (scope: project); it does not change central DB scope to personal/global in the current implementation.

Behavior

  1. Store resolution — requires a writable store; exits if none found.
  2. LLM extraction — uses structuring provider to extract JSON array of candidates (summary, type, search_terms).
  3. Novelty check — builds search index from active stores; skips candidates that overlap existing memories.
  4. Commit — for novel candidates, structures via GnosysIngestion and inserts into central DB (unless --dry-run).
  5. Dry run — prints WOULD ADD lines without DB writes; summary uses DRY RUN mode label.
  6. Duplicates — prints SKIP with overlapping memory title.
  7. SummaryCOMMITTED or DRY RUN line with candidate/add/skip counts.

Output example

Extracting knowledge candidates from context...
Found 3 candidates. Checking novelty...

  ➕ ADDED: "Use SQLite as source of truth"
    ID: deci-012

  ⏭ SKIP: "Prefer TypeScript"
    Overlaps with: TypeScript as implementation language

COMMITTED: 3 candidates, 1 added, 1 duplicates skipped.

Error cases

  • No writable store
  • No LLM provider available
  • LLM output not valid JSON
  • No extractable knowledge (empty candidate array)

Read the full file on GitHub · 72 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. yesterday First seen · 72 lines · 0 tokens per session scan A 068f35e3395b

Subscribe to this mod's changes

commit-context is a command published in the GitHub repository proticom/gnosys (4 stars, last pushed 15d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 569 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-31.