Skip to main content
Glama

Compress Memory Bank (CLAUDE.md, .cortex/memory-bank/*.md)

compress_memory_bank

Compress project memory files to reduce session token costs. Creates .original backups and validates structural integrity before overwriting, returning per-file compression ratios.

Instructions

Compress project memory files (CLAUDE.md, .cortex/memory-bank/*.md) to reduce session token cost. Creates .original backups; validates structural integrity before overwriting. Returns per-file compression ratios.

USE WHEN: Attached projects need shorter CLAUDE.md / memory-bank prose after cortex://analysis flags compression candidates, or before long sessions.

DO NOT: Run on source code, tests, or user-facing docs outside memory paths.

EXAMPLES:

  • compress_memory_bank() — zero-arg uses MCP workspace root

  • compress_memory_bank(project_root="/path/to/project")

RETURNS: JSON with status and result (CompressMemoryBankResult fields).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_rootNo
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Discloses backup creation (.original), structural integrity validation before overwrite, and return of per-file compression ratios. Annotations (readOnlyHint=false, destructiveHint=false) are consistent; description adds behavioral context beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with sections (USE WHEN, DO NOT, EXAMPLES, RETURNS). Every sentence adds value; no redundant or vague statements. Front-loads purpose and usage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given simple parameter schema and lack of output schema, description covers all relevant aspects: file scoping, safety mechanisms, return structure. Sufficient for correct invocation without additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single optional parameter project_root is explained via examples: zero-arg uses workspace root; explicit path sets project_root. Schema has no descriptions (0% coverage), so description compensates well, though more detail on expected format could be added.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it compresses memory bank files (CLAUDE.md, .cortex/memory-bank/*.md) to reduce session token cost. Specifies action, resource, and benefit. Distinguishes from siblings like autofix or memory_wal by targeting memory files.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Includes explicit 'USE WHEN' and 'DO NOT' sections, providing clear context for when to use (after analysis flags candidates, before long sessions) and when not to use (source code, tests, docs outside memory paths). Examples further clarify invocation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/igrechuhin/Cortex'

If you have feedback or need assistance with the MCP directory API, please join our Discord server