cogsession
CogSession MCP server manages persistent, project-local session memory for AI coding agents โ recording decisions, dead ends, tasks, and claims, then making them searchable and verifying them over time.
Start and manage sessions: initialize new sessions, attach to parent sessions, load prior handoffs, and save checkpoints with context percentage and summaries.
Record session knowledge: log decisions, dead ends, assumptions, tasks, danger zones, resolved errors, and environment setup details.
Search and explore history: search across all sessions by query and type, view the session tree, get a git-log-style event timeline, and inspect/regenerate an architecture diagram.
Monitor context and status: get current session status and trigger warnings based on context-window usage.
Track claims with proofs: record assertions plus a shell command that verifies them, then re-check claims and report any that no longer hold true.
๐ณ CogSession
Session memory for AI coding agents. Your agent forgets everything when the context window fills. CogSession remembers the parts worth keeping, and tells you when they stop being true.
The problem
Session 1 (context fills) โ Session 2 starts fresh โ Session 3 starts fresh
Everything lost. Repeats the mistakes. Starts blind again.You explain the codebase again. The agent tries the approach that already failed. The constraint you agreed on in session 1 is gone by session 3.
The usual answer is "write better notes", which fails for the same reason all documentation fails: it is true when written and nobody notices when it stops being true.
Related MCP server: claude-memory-mcp
What CogSession does
Three things, and the third is the one that does not exist elsewhere.
1. It records without being asked. A session opens on its own. Decisions, dead ends,
assumptions and errors are written as they happen, each stamped with the local time and the
repo state it happened at (main@a1b2c3d+2, where +2 is dirty files).
2. It makes that searchable without loading it. Every session keeps a session.md:
append-only, one block per event, every entry line self-describing. So one grep answers a
question without pulling a file into context.
grep -A4 "dead_end" .cogsessions/*/session.md # what already failed
grep "2026-08-27 01:" .cogsessions/*/session.md # what happened that hour
grep "main@a1b2c3d" .cogsessions/*/session.md # what happened at that commit3. It tells you when what you wrote stops being true. Record a claim with the command that proves it. When the files it watches change, the proof is re-run:
[CogSession] 1 claim(s) no longer hold:
โ the composite key includes the tenant column
expected '1', got '0'
asserted in: PR description, line 26
proof: grep -c 'UNIQUE (a, b, c)' migrations/007_schema.sqlNo model judgement involved. It stores the command that proved something and re-runs it. Silence means everything still holds.
Why the third one matters
Every expensive failure in three weeks of daily use reduced to one sentence: something was true when it was written and stopped being true. A pull request description explaining a schema the code no longer had. A comment naming a constraint that moved. A test asserting a shape the implementation had dropped. A docstring contradicting its own function.
An agent cannot notice that from a transcript. A human notices it in review, which is the expensive place. A stored proof notices it for free.
Is this the thing you are looking for?
You are probably here because of one of these:
Claude Code hit its context limit and the next session knows nothing about the last one
Your agent retried an approach that already failed, because nothing recorded that it failed
A constraint you agreed on in one session was gone three sessions later
You keep re-explaining the same codebase at the start of every session
A comment, a doc or a PR description described the code as it used to be, and review caught it rather than you
The first four are what any agent-memory tool is for. The fifth is the one CogSession was actually built to solve, and it is the reason for the claims feature above.
How this differs from just writing notes
Notes go stale silently. That is the entire problem, and no amount of discipline fixes it, because the failure is not that you forgot to write something down โ it is that what you wrote stopped being true and nothing told you.
A claim is a note with a proof attached. When the proof stops passing, you hear about it.
How this differs from your agent's built-in memory
Built-in memory decides what to keep. This records what happened, in a plain file you own, in your repo's directory, greppable with tools you already have. It works the same whether the agent is Claude Code today or something else next year, because the output is markdown and JSONL rather than a vendor's store.
What a session looks like on disk
.cogsessions/
โโโ sess_001_discover/
โ โโโ session.md โ greppable timeline, every entry timestamped + git-stamped
โ โโโ handoff.md โ the brief the next session reads first
โ โโโ claims.json โ assertions with the commands that prove them
โ โโโ dead_ends.md โ what failed and why, so it is not retried
โ โโโ assumptions.md โ what was assumed but never verified
โ โโโ tasks.json โ done / remaining / blocked
โ โโโ decisions.json โ flagged when made under high context pressure
โ โโโ environment.json โ the commands that restore a working state
โ โโโ architecture.mermaidโ auto-generated dependency diagram
โ โโโ session_log.jsonl โ append-only machine log
โโโ sess_002_auth/ (parent: sess_001)
โโโ sess_003_payments/ (parent: sess_001, sibling of sess_002)Sessions form a tree, like branches, because work does. session_tree shows it; session_log
is a git log --oneline across all of them.
Requirements
Python 3.11+
uvfor the install scriptAn MCP-capable agent. Built against Claude Code; also usable from Codex (see below)
gitis optional. Without it the journal recordsno-gitand stays useful
Install
pip install cogsession # or: uv tool install cogsession
cogsession-admin installTwo commands on purpose. The first installs the MCP server; the second wires the
hooks, which is what makes CogSession record without being asked. A package
cannot write to ~/.claude/settings.json on its own, so without the second command
you get eleven tools you must call by hand and none of the recording.
cogsession-admin install backs up your settings first, adds the six hooks
alongside anything already there, and will not overwrite a status line you
already set.
git clone https://github.com/premanand8800/cogsession.git
cd cogsession
uv sync
uv run cogsession-admin install --repo .--repo points the hooks at your checkout through uv, so edits take effect
without reinstalling.
The installer syncs dependencies with uv, registers the MCP server with Claude Code, and
writes the hooks that let it observe a session without being asked. It touches
~/.claude/settings.json and nothing inside your projects.
It will not write to a file git tracks. The handoff goes to CLAUDE.local.md, which is
auto-loaded the same way CLAUDE.md is but never committed. If that filename happens to be
tracked in your repo, CogSession refuses to write rather than dirtying your tree, and tells
you where the handoff is on disk instead. Add .cogsessions/ to your .gitignore.
The tools
Eleven MCP tools, in four groups:
Group | Tools |
Lifecycle |
|
Recording |
|
Searching |
|
Claims |
|
Plus six hooks (SessionStart, UserPromptSubmit, PreToolUse, PostToolUse,
PreCompact, SessionEnd) that do the recording you never have to ask for.
What it does not do
Worth saying plainly, because it is the first thing people assume:
CogSession does not store your conversations. It reads the transcript only to measure how full the context window is. What it keeps is conclusions โ decisions, dead ends, assumptions, claims โ plus the mechanical events from the hooks. That is deliberate: a memory made of every word said is a memory nobody re-reads. But it does mean the quality of a session's memory depends on things being recorded as they are decided.
Usage
Start of every session: nothing. The SessionStart hook opens a session and
loads the previous handoff on its own. Tracking that depends on someone
remembering to turn it on is tracking that silently does not happen.
Name the session when you know what it is about โ the focus line is the only part a tool cannot infer:
session_update(type="focus", content="auth module")session_init still exists for a session you want to start deliberately, or to
attach to a parent:
session_init(project_root="/your/project", focus="auth module")
session_load(project_root="/your/project") # load a previous handoff by handThroughout the session:
session_update(type="decision", content="Use python-jose for JWT", reasoning="Handles RS256 edge cases")
session_update(type="dead_end", content="Using httpx for auth", why_failed="Breaks streaming in /login", use_instead="Use requests library")
session_update(type="assumption", content="users table has hashed_password column", risk_level="HIGH", how_to_verify="Run \\d users in psql")
session_update(type="task_complete", content="Build /register endpoint")
session_update(type="task_add", content="Build /refresh endpoint")
session_update(type="danger_zone", content="Don't touch middleware.py โ custom CORS order line 45")
session_status(context_pct=67)At 70-80% context:
session_checkpoint(context_pct=78, one_liner="Built JWT auth. Refresh token next.")Look something up without loading anything. Every session keeps a
session.md: append-only, one block per event, each header carrying its own
local timestamp, event type, and the repo state it happened at
(branch@commit+dirty). So one grep answers a question:
grep -n -A4 "dead_end" .cogsessions/<session>/session.md # what already failed
grep -n "2026-08-27 01:" .cogsessions/<session>/session.md # what happened that hour
grep -n "main@a1b2c3d" .cogsessions/<session>/session.md # what happened at that commitEvery entry line is self-describing, which is what makes a bare grep useful:
a match tells you when, what kind, and against which state of the code, with no
need to scroll for context. Tool calls are deliberately left out โ hundreds per
session would bury the decisions someone is actually searching for; they stay in
session_log.jsonl.
Scan history like git log:
session_log() # newest first, all sessions
session_log(type_filter="dead_end") # what has already failed herewhen what repo session
2026-08-27 01:43:57 +0545 error master@3d4d1fd+2 sess_20260827_...
2026-08-27 01:43:57 +0545 dead_end master@3d4d1fd+1 sess_20260827_...Scan, then grep the journal for the entry that matters. The commit id is the
join back to real git log, so a decision can be lined up with the state of
the code that produced it.
Claims โ for anything you write down that could go stale:
claim_record(
claim="the composite key includes the tenant column",
verified_by="grep -c 'UNIQUE (a, b, c)' migrations/007_schema.sql",
expect="1",
watches=["migrations/007_schema.sql"],
asserted_in="PR description, line 26",
)
claim_check() # re-runs the proofs whose files movedA claim stores the command that proved it, not a note about how to check it. When the file changes, the next session is told which statements stopped being true, where they were asserted, and how they were checked. Silence means everything still holds.
This exists because the most expensive failure is not a wrong decision. It is a right one that quietly stopped being true โ a description of a schema the code no longer has, a comment naming a constraint that moved, a test asserting a shape the implementation dropped.
Explore history:
session_tree(project_root="/your/project")
session_search(project_root="/your/project", query="httpx", type_filter="dead_end")
session_diagram(project_root="/your/project")How It Works: Inverted Control (Observer-First)
CogSession operates automatically via agent hooks and transcript inspection. You don't need to manually report token percentages or call tools.
Automatic Context Measurement: Context load is read directly from Claude Code session transcripts (
input_tokens + cache_creation + cache_read + output_tokens).Automatic Injection:
SessionStart: Injects L0 manifest & L1 handoff unprompted.UserPromptSubmit: Nudges at 65%โ74%, recommends at 75%โ79%, and mandates checkpoints at $\ge$80%. Surfaces prompt-relevant dead ends and danger zones.PreToolUse: Blocks file edits targeting recorded danger zones.
Deterministic Distillation: Tracks file edits, git operations, commands, and test failures without relying on LLM guesses.
What Makes It Different
Feature | Other Systems | CogSession |
Dead ends tracking | โ | โ Automatic extraction of failed approaches & reasons |
Context load measurement | โ Guesswork | โ Ground truth token measurement from transcript |
Decision quality flags | โ | โ Automatically flagged if made at >75% context |
Tree structure | โ linear | โ Branches like git |
Token-aware warnings | โ | โ Automatic: 65% nudge, 75% alert, 80% mandate |
Auto CLAUDE.md handoff | โ | โ Handoff written automatically at checkpoint |
Architecture diagram | โ | โ Auto-generated Mermaid |
Environment snapshot | โ | โ Exact start commands, ports, env vars |
Connect
CogSession is an MCP stdio server. If cogsession is installed in the
environment where your agent runs, register it with uv run cogsession.
Codex CLI:
codex mcp add cogsession -- uv run cogsessionIf you are running CogSession directly from a local source checkout, point uv
at that checkout:
codex mcp add cogsession -- uv --directory /path/to/cogsession run cogsessionVerify the server is registered:
codex mcp list
codex mcp get cogsessionRestart Codex after adding the MCP server. Codex loads MCP tools when a new Codex session starts.
Claude Code:
claude mcp add cogsession -- uv run cogsessionFor a local source checkout:
claude mcp add cogsession -- uv --directory /path/to/cogsession run cogsessionCursor (.cursor/mcp.json):
{"mcpServers": {"cogsession": {"command": "uv", "args": ["run", "cogsession"]}}}For a local source checkout:
{
"mcpServers": {
"cogsession": {
"command": "uv",
"args": ["--directory", "/path/to/cogsession", "run", "cogsession"]
}
}
}Disable for a project:
echo '{"enabled": false}' > .cogsession.jsonUsing CogSession with Codex
CogSession is project-local. It stores session data inside the target project:
/your/project/.cogsessions/Start Codex from the project you want to remember:
cd /your/project
codexThen ask Codex to use CogSession in plain language:
load the session and handoff from cogsessionor be explicit:
Use cogsession to load the latest handoff for this project.If this is the first session for the project:
Use cogsession to initialize a session for this project with focus "initial setup".During work, record important facts:
Use cogsession to record a decision: "Use the existing service layer for account updates" because "It keeps validation and audit logging in one place".Use cogsession to record a dead end: "Calling the external API directly from the route handler" because "It bypassed retries and request tracing" and use instead "Call the existing API client wrapper".Before stopping, checkpoint the session:
Use cogsession to checkpoint this session with context 64% and summary "Implemented account update flow; remaining work is integration tests."Codex Example
developer@workstation:~/projects/example-app$ codex
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ >_ OpenAI Codex (v0.130.0) โ
โ โ
โ model: gpt-5.5 /model to change โ
โ directory: ~/projects/example-app โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โบ load the session and handoff from cogsession
โข Called
โ cogsession.session_load({
"project_root": "/home/developer/projects/example-app",
"load_level": "handoff"
})
[CogSession] Handoff from sess_20260513_101500_account_updates_a1b2:
# Handoff: sess_20260513_101500_account_updates_a1b2
**Focus:** Account update flow
**Closed:** 64% context | 2026-05-13 23:33
**Parent:** root
## Summary
Account update flow is implemented, validation is wired through the existing
service layer, and lint/type checks are passing. Remaining work is integration
test coverage for error cases.After loading the handoff, Codex can continue with the saved context:
I implemented the account update flow using the existing service layer:
- Added src/services/account_service.py for update orchestration.
- Updated src/api/account_routes.py to call the service layer.
- Added validation in src/schemas/account.py.
- Documented required environment variables in .env.example.
Verification:
pytest passed
ruff check . passed
mypy src passed
Remaining work:
- Add integration tests for validation failures.
- Confirm production environment variables before release.Project-Local vs Global
CogSession does not use one global memory store by default. Each project gets
its own .cogsessions/ directory.
For this project:
/home/developer/projects/example-app/.cogsessions/For another project:
/home/developer/projects/admin-tool/.cogsessions/Those are separate histories. To inspect a specific project, ask Codex:
Use cogsession to show the session tree for /home/developer/projects/example-app.Codex may show an approval prompt before running a CogSession tool:
Allow the cogsession MCP server to run tool "session_tree"?
1. Allow
2. Allow for this session
3. Always allow
4. CancelChoose Allow for this session or Always allow if you want fewer prompts.
Useful Codex Prompts
Use cogsession to load the latest handoff for this project.Use cogsession to initialize a new session for this project with focus "auth fixes".Use cogsession to show the session tree for this project.Use cogsession to search this project for "account update".Use cogsession to checkpoint this session with context 70% and summary "Implemented auth changes and recorded build blocker."Available Tools
11 toolsclaim_checkA
Re-run recorded claims and report only the ones that no longer hold. Silence means everything still checks out.
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Check every claim, not only those whose files changed |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden, and it discloses the key behavioral outcome: it reports only failures and remains silent when all claims still hold. This is meaningful beyond the tool name, though it does not mention side effects or permission requirements.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences carry the full purpose, behavior, and result interpretation. The most important information is front-loaded, and there is no filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one optional boolean parameter and no output schema, the description is complete: it explains what the tool does, what its output looks like, and how to interpret silence. An agent can call this tool correctly with the information provided.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already documents the single boolean parameter 'all' with 100% coverage, so the description does not need to add much. It provides no extra detail about the parameter beyond what the schema states, which is acceptable given the high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('re-run'), a clear resource ('recorded claims'), and states exactly what it reports (only those that no longer hold). It distinguishes itself from the sibling claim_record by focusing on verification rather than creation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description makes the usage context clear: verifying previously recorded claims by re-running them. It does not explicitly name alternatives or exclusion criteria, but the contrast with claim_record is evident and the behavior is unambiguous enough for an agent to know when to call it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
claim_recordA
Record a claim together with the command that PROVES it, so a later session is told when it stops being true. Use this for any factual statement you write somewhere durable โ a PR description, a code comment, a doc, a status report. The proof must be a cheap read-only shell command whose output can be compared.
| Name | Required | Description | Default |
|---|---|---|---|
| claim | Yes | The assertion, as you would write it to a human | |
| expect | No | Expected stdout, stripped. Omit to mean 'must exit 0' | |
| watches | No | Paths whose change should trigger a re-check | |
| asserted_in | No | Where the claim was made, e.g. 'PR #48 body, line 26' | |
| verified_by | Yes | Shell command that proves it, e.g. "grep -c 'X' path" |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden and does well: it states that claims persist across sessions, are re-checked, and that the proof command must be cheap and read-only so its output can be compared. It does not describe failure modes or notification mechanics, but it discloses the core side-effecting behavior and constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences with no filler: the primary action is front-loaded, followed by usage guidance and a key constraint. Nothing repeats the schema verbatim.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has five parameters, no annotations, and no output schema, so the description needs to cover purpose, selection context, and behavioral constraints, which it does. It omits explicit return-value and error information, but an agent still has enough to invoke it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds meaningful value by constraining verified_by to be a cheap read-only shell command and explaining how its output is compared. It also grounds asserted_in in durable locations, though expect and watches are left to the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a concrete verb and object: record a claim together with the proving command, and clarifies that the claim will be monitored in later sessions. It clearly differentiates the tool from session management siblings and implies the counterpart relationship with claim_check.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly tells the agent when to use it: for any factual statement written in a durable artifact such as a PR description, code comment, doc, or status report. It does not name alternatives directly or list exclusions, but the sibling context and the 'Use this for' phrasing make the intended scope clear.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_checkpointA
Save the current session state to disk. CALL THIS at 70-80% context. Writes: handoff.md, tasks.json, dead_ends.md, assumptions.md, environment.json, architecture.mermaid, session_log.jsonl. Also auto-writes handoff.md to CLAUDE.md so next session loads it.
| Name | Required | Description | Default |
|---|---|---|---|
| trigger | No | manual | |
| one_liner | No | One sentence summary of what happened this session | |
| context_pct | No | Current context window usage percentage |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It clearly reveals the side effects: it writes several specific files and auto-writes handoff.md to CLAUDE.md so the next session loads it. This gives an agent a solid mental model of what the call does to disk, even without a dedicated effects section.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is tight and front-loaded: a one-line purpose, a prominent usage directive, and a compact file list. Every sentence contributes, and the critical 'CALL THIS at 70-80% context' guidance appears near the beginning rather than buried. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers the essential call rationale, the exact persistence artifacts, and a key auto-write side effect. A small gap is that it does not state what the tool returns or whether files are overwritten, but the listed outputs and input schema already give enough context for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is moderate: one_liner and context_pct are described in the input schema, while trigger has only an enum/default. The description adds a little context-pct meaning via the '70-80% context' guidance, but it does not explain trigger values or elaborate on one_liner usage beyond the schema. It mostly relies on the schema for parameter meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Save'), a clear resource ('current session state to disk'), and enumerates the exact files written, making its purpose unmistakable. It also distinguishes itself from sibing tools like session_search or session_status by emphasizing a full persistent dump rather than inspection or incremental update.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly tells the agent when to call this: 'CALL THIS at 70-80% context'. This is a concrete trigger condition. It does not, however, contrast this tool with session_update or session_log, so exclusions and alternatives are left implicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_diagramB
Show or regenerate the architecture diagram (Mermaid format). Auto-scans the project files to build a dependency graph. Pass to a Mermaid renderer to visualize.
| Name | Required | Description | Default |
|---|---|---|---|
| regenerate | No | Force regenerate from current files | |
| session_id | No | Session to get diagram from (default: latest) | latest |
| project_root | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description bears the full disclosure burden. It does add genuinely useful behavioral context: the tool auto-scans project files to build the dependency graph, and the output must be 'passed to a Mermaid renderer to visualize' (i.e., the tool does not render itself). However, it does not disclose whether `regenerate` is destructive, whether sessions cache diagrams, or any side effects from the auto-scan โ gaps that matter for a mutation-ish tool with zero annotation coverage.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences, each earning its place: the main purpose is front-loaded, the auto-scan behavior follows, and the renderer hand-off closes. No filler or redundancy. It loses one point only because the session-based behavior implied by `session_id` is never mentioned, leaving a small completeness gap in an otherwise efficient structure.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 3 params, no output schema, and no annotations, the description is serviceable but incomplete. It explains the auto-scan and Mermaid output but never mentions the session dimension that `session_id` depends on, gives no return-format detail (Mermaid string length, cache behavior), and leaves the required `project_root`'s role only loosely implied. What is needed to call the tool correctly is mostly covered; the session semantics and output expectations are not.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 67%: `regenerate` and `session_id` are already well-documented in the schema, leaving the required `project_root` undocumented. The description's 'Auto-scans the project files' gives `project_root` useful context (it is the root scanned to build the graph), which partially compensates. But the description never ties the `session_id`/session-cache concept to the schema, so it adds only marginal value over what the schema already states.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clear verb+resource pairing: 'Show or regenerate the architecture diagram' in 'Mermaid format', with the auto-scan behavior explicitly stated. All sibling tools are session lifecycle operations (init, checkpoint, load, update, status, log) or claims, so the diagram focus is self-evidently distinct even though no sibling is named โ unlike a high-5 there's no explicit 'use X instead' comparison, so it stops at 4.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit when-to-use or when-not-to-use guidance, and no alternatives are named. Usage must be inferred from the purpose statement ('Show or regenerate the architecture diagram'). The sibling tools are all session operations so confusion is unlikely, but the description does not actively route the agent โ this is implied usage at best, meriting a 3.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_initA
Initialize a new CogSession for the current project. Call this at the START of a Claude Code session. Provide parent_session_id to continue from a previous session (tree structure). Provide focus to describe what this session is about.
| Name | Required | Description | Default |
|---|---|---|---|
| focus | No | What this session is about (e.g. 'auth module JWT implementation') | |
| project_root | Yes | Absolute path to project root | |
| parent_session_id | No | ID of the session to continue from (for tree structure) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the behavioral burden. It discloses a new session is created, that it supports tree structure via parent_session_id, and that it is intended as the start of a session. However, it does not reveal the return value (likely a session ID), whether it persists state, or what happens if a session already exists.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, with the core action and timing front-loaded. Every sentence adds useful context and there is no redundancy or filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description adequately covers why, when, and with what parameters to call the tool. But with no output schema and no annotations, it should also tell the agent what the tool returns (e.g. a session ID to use with sibling tools) โ that is missing, leaving the definition short of complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3 even without extra parameter detail. The description adds only light rephrasing โ 'current project' for project_root and 'continue from a previous session (tree structure)' for parent_session_id โ without adding new constraints or formats.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (Initialize), resource (CogSession), and scope (current project). The word 'new' and phrase 't the START' clearly separate this from siblings like sesssion_load, sesssion_update, and sesssion_checkpoint.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says to call this at the START of a Claude Code session, which gives a clear invocation context. It also explains when to provide parent_session_id (continue from previous session) and focus (session topic), though it does not name alternative tools for non-start cases.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_loadA
Load the handoff from a previous session. Call at the START of a new session to get context from the last one. Returns the handoff brief (~250 tokens) โ exactly what the new session needs.
| Name | Required | Description | Default |
|---|---|---|---|
| load_level | No | How much to load. 'handoff' = minimal (~250t). 'full' = everything. | handoff |
| session_id | No | Session ID to load (default: latest) | latest |
| project_root | Yes | Absolute path to project root |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden. It discloses that this is a load/retrieval action, returns a handoff brief of roughly 250 tokens, and is intended as the session-start context retrieval mechanism. It does not explicitly state 'read-only' or discuss side effects, but 'load' strongly implies non-mutating behavior and the return-size hint adds useful precision.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two tight sentences with no filler. Key information is front-loaded: the action, the timing, and the expected return size. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with three parameters, full schema coverage, and no output schema, the description covers the essential operational context: when to call, what it loads, and what the returned content looks like. It could be more explicit about load_level variations, but the schema already handles those.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all three parameters are already documented. The description adds no new parameter-level detail beyond aligning with the default 'handoff' load level via the phrase 'handoff brief,' which is only marginal added value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Load the handoff from a previous session.' It clearly identifies the tool's core purpose and differentiates it from siblings like session_status or session_search through the 'handoff' and 'new session' framing, though it does not explicitly name an alternative.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear timing guidance: 'Call at the START of a new session to get context from the last one.' This tells an agent when to use the tool, but it does not explicitly state when not to use it or compare it with sibling loading/checkpoint tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_logA
A git log for this project's sessions: one line per recorded event, newest first, with local timestamp, event type and the repo state (branch@commit+dirty) it happened at. Use it to scan history fast, then grep the session's own session.md for the entry that matters. Filter by type to answer 'what has already failed here' in one call.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max lines (default 40) | |
| session_id | No | One session only. Omit to walk newest-first across all | |
| type_filter | No | Only this event type, e.g. decision, dead_end, error |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are present, so the description carries the transparency burden. It discloses ordering, per-line fields, and filtering behavior, and the 'git log' analogy implies a read-only operation. It does not explicitly state the side-effect profile, but nothing about the description suggests mutation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two dense sentences front-load the return format and then add usage guidance. There is no filler, repetition of schema details, or vague phrasing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple optional-parameter log reader with no output schema, the description supplies the necessary return fields, ordering, and a decision rule for filtering. It is complete enough for an agent to invoke it correctly without further context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with clear descriptions for limit, session_id, and type_filter. The description only reinforces 'Filter by type', adding little beyond what the schema already says. Baseline 3 is appropriate when the schema carries the parameter documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names the exact resource ('sessions'), the operation mode ('git log'), and the output shape (one line per event, newest first, timestamp, event type, repo state). It is immediately distinguishable from write/status/search siblings by its read-only log framing, even though it does not explicitly name an alternative tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives concrete directives: 'Use it to scan history fast, then grep the session's own session.md' and 'Filter by type to answer what has already failed here'. This establishes a clear primary use case and points to a follow-up resource, but it does not explicitly say when to prefer session_search instead.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_searchA
Search across ALL sessions for a query. Useful for: 'when did we decide X?', 'what errors have we seen?', 'which session touched file Y?', 'what dead ends are there?'
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| type_filter | No | all | |
| project_root | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the burden. It discloses that the search spans ALL sessions and implies semantic, memory-style queries. However, it does not mention result format, pagination, performance characteristics, or whether this is strictly read-only beyond the word 'Search.'
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is short, front-loaded with the core action, and every sentence earns its place. The examples are compact and materially improve understanding without adding noise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description gives clear purpose and realistic usage examples, making it minimally viable for an agent to invoke. However, with no output schema and no annotations, the missing details about return values, handling of empty results, and the relationship between project_root and the 'ALL sessions' scope leave notable gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not explain type_filter or project_root. The example questions hint at query content and possibly filters like error or dead_end, but the agent must infer how project_root relates to 'ALL sessions' and when to use type_filter. The description does not adequately compensate for the lack of schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb and resource: 'Search across ALL sessions for a query.' It also distinguishes itself from session-management siblings by emphasizing the global, cross-session scope, and the concrete example questions clarify exactly what kind of tool this is.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The 'Useful for' examples give strong, concrete guidance on when to call this tool, such as recalling decisions, errors, file edits, and dead ends. It does not explicitly say when not to use it or name alternatives, but the context is clear enough for an agent to select it appropriately.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_statusA
Get the current session's status: what's been recorded, how many dead ends, task progress, context warning level.
| Name | Required | Description | Default |
|---|---|---|---|
| context_pct | No | Current context% for threshold warning |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the behavioral burden, and it does communicate that this is a read-only 'get' operation and names the returned status areas. However, it does not disclose what happens when no session exists, whether the optional context_pct parameter changes the output, or whether any side effects/errors are possible.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single efficient sentence that front-loads the verb and resource, then enumerates the useful output categories. There is no filler or redundant phrasing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple status retrieval with one optional parameter, naming the output areas is mostly sufficient. However, the description does not connect the optional context_pct parameter to the 'context warning level', and with no output schema or annotations, the agent is missing some context about return shape and error or prerequisite behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3 even though the tool description itself never mentions context_pct. The schema says 'Current context% for threshold warning', which gives basic meaning, but the tool description does not clarify how this optional number influences the status ouput.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific action ('Get'), a defined resource ('current session's status'), and then enumerates exactly what is included: recorded items, dead ends, task progress, and context warning level. This is enough to distinguish it from siblings like session_log or session_load, which operate on session content rather than report an aggregate status.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus alternatives such as session_log, session_checkpoint, or session_diagram. The phrase 'Get the current session's status' implies a monitoring use case, but the description never states conditions, prerequisites, or exclusions, so an agent must infer selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_treeB
Show the full session tree for this project. Like 'git log --graph' but for CogSession work history. Shows all sessions, their relationships, and their status.
| Name | Required | Description | Default |
|---|---|---|---|
| project_root | Yes | Absolute path to project root |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. 'Show' implies a read-only operation, and the description provides useful context about output scope (all sessions, relationships, status). However, it does not explicitly state that it is read-only, nor disclose potential caveats like performance on large trees or exact output format.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is compact and impactful, using two clear sentences and a powerful analogy. Every sentence earns its place; the analogy gives immediate mental model without extra wording.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read-only tool with one parameter, the description conveys the core purpose and what is shown. However, with no output schema, it leaves the exact return format unspecified, and it does not discuss output ordering, size limits, or whether the tree is textual or graphical. The description is adequate but not rich.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already describes project_root with full coverage. The description adds no parameter-specific detail beyond mapping 'this project' to project_root, so it does not meaningfully compensate for or extend the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly specifies the action ('Show') and resource ('full session tree'), and adds useful detail about what is shown: all sessions, their relationships, and status. The git log --graph analogy helps convey the tree/graph nature, though it does not explicitly differentiate from sibling tools like session_status or session_diagram.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given about when to use this tool instead of siblings such as session_status, session_log, or session_diagram. The description implies it is for viewing the whole graph, but it does not state exclusions or alternatives, so an agent must infer the appropriate context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_updateB
Add information to the current session. Use this throughout the session to record: decisions made, dead ends found, assumptions made, tasks completed/added, danger zones discovered, errors seen.
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | ||
| content | Yes | Main content | |
| reasoning | No | Why this decision was made [for decision type] | |
| risk_level | No | MEDIUM | |
| why_failed | No | Why it failed [for dead_end type] | |
| context_pct | No | Current context% (for decision quality flagging) | |
| use_instead | No | What to use instead [for dead_end type] | |
| test_command | No | How to run tests | |
| how_to_verify | No | How to verify this assumption [for assumption type] | |
| start_commands | No | Commands to start the project |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
There are no annotations, so the description carries the full behavioral disclosure burden. It states that information is added to a session but does not disclose side effects, whether a session must already exist, whether entries are append-only, or what happens on repeated calls. This is only slightly more informative than the tool name itself.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no filler. The main action is front-loaded, and the list of supported record types is compact yet informative. Every clause earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With 10 parameters, no output schema, and no annotations, the description should provide more guidance about preconditions, session lifecycle, and how this tool relates to session_init, session_checkpoint, and session_log. The description explains high-level intent but leaves an agent uncertain about operational details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is high at 80%, so most parameter meaning is already available. The description adds value by naming the kinds of information that map to the 'type' enum, but it does not explain nuanced parameters like reasoning, risk_level, or context_pct beyond what the schema already says.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description identifies a specific action ('Add information') on a specific resource ('current session') and lists the categories of information it records. Clear enough for an agent to understand the core purpose, though it does not explicitly differentiate itself from siblings like session_log.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear timing guidance ('Use this throughout the session') and enumerates valid content types. It does not state when not to use this tool or contrast with alternatives such as session_checkpoint or session_log, which keeps it from a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
11 tool updates
v0.1.0- First observed
claim_check - First observed
claim_record - First observed
session_checkpoint - First observed
session_diagram - First observed
session_init - First observed
session_load - First observed
session_log - First observed
session_search - First observed
session_status - First observed
session_tree - First observed
session_update
TDQS
Most tools are clearly distinct โ checkpoint/update, tree/search/log/status, and claim_record/claim_check each serve different purposes. The main ambiguity is session_init and session_load, since both are meant to be called at session start and both reference continuation from previous sessions, though their outputs differ.
The session_ prefix gives the set a strong, consistent identity, and all names use lowercase_with_underscores. However, operations mix imperative verbs (init, load, update) with noun-style view commands (tree, status, log, diagram), and the claim_* pair breaks the session_ prefix pattern.
11 tools is well-scoped for a session-management server. Each tool covers a distinct part of the workflow โ lifecycle, history, search, status, claims, and diagram โ and none feels redundant or unnecessary.
The core lifecycle is well covered: init, update, checkpoint, load, plus history, search, status, claims, and diagram. Minor gaps exist โ there is no explicit session_end/archive tool and no way to delete or supersede a claim โ but agents can complete the main workflow without dead ends.
Maintenance
Related MCP Connectors
- mcpOAuthai.butlerbrain
Persistent memory for AI assistants. Save once; recall from Claude, ChatGPT, or any MCP client.
Portable memory for AI agents: capture once, recall across Claude, Cursor, and any MCP client.
Persistent AI memory shared across Claude, ChatGPT, coding agents, and compatible MCP clients.
Persistent memory for AI agents across Claude, ChatGPT and any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenancePersistent memory MCP server that captures coding session context and automatically injects relevant memories into prompts using hybrid search for OpenCode and Claude Code.64MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that gives Claude Code cross-session memory persisted to a plain .claude-memory.md file in your repo.MIT
- AlicenseNot gradedqualityDmaintenancePersistent memory MCP server for Claude Code that captures and recalls project context across sessions, eliminating the need to re-explain architecture and decisions daily.1371MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that captures and recalls coding session memory (failures, decisions, diffs) for AI agents, enabling cross-agent continuity and preventing repeated mistakes.106MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/premanand8800/cogsession'
If you have feedback or need assistance with the MCP directory API, please join our Discord server