Skip to content
Back to skills

Source Command Latch Compact

ASecurity

Compact the exact current Cursor conversation into latch. Use when the user invokes latch-compact or /latch-compact in Cursor.

  • 9 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 3, 2026
ai-agentspythonshellnodebackend

Works with

  • cursor
  • mcp

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add open-latch/latch --skill source-command-latch-compact --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Source Command Latch Compact?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Source Command Latch Compact
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/open-latch-source-command-latch-compact-latch/badge)](https://www.skillsdirectory.com/skills/open-latch-source-command-latch-compact-latch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: source-command-latch-compact
description: Compact the exact current Cursor conversation into latch. Use when the user invokes latch-compact or /latch-compact in Cursor.
---

# Latch compact for Cursor

Latch operation id: latch-compact run

Latch Cursor skill boundary: use only the conversation id and
`transcript_path` recorded together by the current `sessionStart` hook. Never
scan Cursor history or fall back to Claude/Codex transcripts.

Read the exact `Latch Cursor current session id` from the current prompt context;
the `beforeSubmitPrompt` hook re-injected it from this chat's payload. Pass it
as the wrapper's first positional argument. Never omit it or reuse an id from
another chat.

Before the Shell call, read the workspace `.cursor/mcp.json` and use
`mcpServers.latch.env.LATCH_PYTHON` when present, otherwise
`mcpServers.latch.command`, as `<CURSOR_MCP_PYTHON>` and `LATCH_PYTHON`. Never fall back to a
PATH `python3`; the MCP interpreter owns latch's native dependencies.
Use `latch_home` only to construct the absolute wrapper path. Do not export
`LATCH_HOME` or `CLAUDE_KB_HOME` in the Shell call; managed Cursor operation
receipts do not allow those environment assignments.

Resolve `latch_home` as `${CURSOR_PLUGIN_ROOT}` when set, otherwise use the
absolute checkout in the project-sync footer. Use backend `cursor` for a plugin
install; a project-synced skill uses the backend in that footer. Run the host-appropriate
`bin/run_cursor_compact_now.sh` or `.ps1` wrapper with
`LATCH_COMPACTOR_BACKEND` and `LATCH_MODEL_BACKEND` set to that backend. Do not
pass `--final`. The first Shell call must request Cursor
`required_permissions: ["all"]`, because compaction writes latch-owned
budget/session/KB state outside the open workspace. Do not make a sandboxed
attempt first and retry with permission: the managed compact receipt is
one-shot and consumed by the first exact attempt. Cursor's normal user-approval
flow still applies. Wait for the JSON result and report `summary_node_id`,
`summary_written`, extracted-node count, and `current_session_only`. Surface any
resolution error without choosing another transcript.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.