ics

A command that opens Integrated Context Studio, an interactive editor for context files. It supports templates, read-only viewing, semantic analysis, and panels for memory, diagnostics, proposals, or gaps.

In plain words
What is it for?
Use it to edit an existing context file or create one from an API, architecture, bug-fix, feature, or refactor template.
Why use it?
It gives you a structured way to create, inspect, and edit the context files used by an agent.

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/rand/mnemosyne/ics
Clone the repo
git clone --depth 1 https://github.com/rand/mnemosyne

Made for: Claude Code.

Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,237 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00019 $0.01237
Opus 5 $0.00010 $0.00619
Sonnet 5 $0.00004 $0.00247
Haiku 4.5 $0.00002 $0.00124

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

Security

Grade B, and why

ics scanned grade B with 1 finding 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

RESULT=$(cat .claude/sessions/edit-result.json)
.claude/commands/ics.md · 168 lines

How it starts

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

I will launch the Integrated Context Studio (ICS) for you to interactively edit a context file.

Parse arguments:

  • First positional arg: file path (optional, creates temp file if not provided)
  • --template <T>: Use template (api|architecture|bugfix|feature|refactor)
  • --readonly: Open in read-only mode (view only, no editing)
  • --panel <P>: Start with panel visible (memory|diagnostics|proposals|holes)

Examples:

/ics context.md
/ics --template api new-api-spec.md
/ics --readonly docs/architecture.md
/ics --panel memory context.md

Steps:

  1. Parse command arguments:

    • Extract file path from first positional argument
    • Extract flags: --template, --readonly, --panel
    • If no file provided: create .claude/context-temp-{timestamp}.md
  2. Prepare file:

    • If file doesn't exist and template requested: note template will be applied by ICS
    • If file doesn't exist and no template: ICS will create empty file
    • If file exists: ICS will load it
  3. Create session directory:

    mkdir -p .claude/sessions
    
  4. Build mnemosyne edit command:

    # Base command
    CMD="mnemosyne edit"
    
    # Add file path
    CMD="$CMD <file_path>"
    
    # Add options
    if [[ -n "$template" ]]; then
      CMD="$CMD --template $template"
    fi
    
    if [[ "$readonly" == "true" ]]; then
      CMD="$CMD --readonly"
    fi
    
    if [[ -n "$panel" ]]; then
      CMD="$CMD --panel $panel"
    fi
    
    # Add session context for handoff (hidden flag)
    CMD="$CMD --session-context .claude/sessions/edit-intent.json"
    
  5. Show launch message:

    🎨 Launching Integrated Context Studio...
    
    File: <file_path>
    Template: <template or "none">
    Mode: <"read-only" or "edit">
    Panel: <panel or "none">
    
    ICS will now take over your terminal.
    Edit your context with full features:
    • Vim mode (if enabled)
    • Syntax highlighting
    • Semantic analysis
    • Memory panel (Ctrl+M)
    • Diagnostics (Ctrl+D)
    • Typed holes (Ctrl+H)
    
    Save (Ctrl+S) and quit (Ctrl+Q) when done.
    
  6. Execute command (this takes over terminal):

    $CMD
    

    Note: The terminal is now controlled by ICS. Wait for user to exit.

  7. After ICS exits, read result:

    # Check if result file exists
    if [ -f .claude/sessions/edit-result.json ]; then
      # Read and parse result
      RESULT=$(cat .claude/sessions/edit-result.json)
    
      # Extract key fields with jq
      STATUS=$(echo "$RESULT" | jq -r '.status')
      CHANGES=$(echo "$RESULT" | jq -r '.changes_made')
      EXIT_REASON=$(echo "$RESULT" | jq -r '.exit_reason')
    
      # Read the edited file content
      CONTENT=$(cat <file_path>)
    else
      # No result file - user may have force-quit
      STATUS="unknown"
      CHANGES="false"
      EXIT_REASON="unknown"
      CONTENT=$(cat <file_path> 2>/dev/null || echo "")
    fi
    
  8. Display result summary:

    ✓ ICS session complete
    
    Status: <status>
    Changes made: <yes/no>
    Exit: <user_saved/user_cancelled/error>
    

    If changes_made == true and result has analysis:

    Semantic Analysis:
    • Filled <N> typed holes
    • Referenced <N> memories
    • Resolved <N> diagnostics
    • Extracted entities: <list>
    
  9. Display edited content (if not readonly):

    Here's your edited context:
    
    <CONTENT>
    
    Shall I proceed with this context?
    
  10. Cleanup:

    # Remove coordination files
    rm -f .claude/sessions/edit-intent.json
    rm -f .claude/sessions/edit-result.json
    
  11. Wait for user response:

    • If user says "yes" or "proceed": continue with the context
    • If user says "edit again" or "refine": Re-run steps 3-11
    • If user says "discard" or "cancel": Discard changes

Error handling:

  • If mnemosyne edit command fails: "Error launching ICS. Please check mnemosyne installation."
  • If user force-quits (Ctrl+C): "ICS session interrupted. File may be partially edited."
  • If timeout (5 min): "ICS session timed out. File saved to {path}."
  • If file is readonly and user tries to edit: ICS will prevent saves automatically

Read the full file on GitHub · 168 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 · 168 lines · 19 tokens per session scan B 1444fd50d57a

Subscribe to this mod's changes

ics is a command published in the GitHub repository rand/mnemosyne (84 stars, last pushed 9mo ago), licensed MIT. It adds 19 tokens to every session and 1,237 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other commands, from other repositories