### Quick install for OpenClaw adapter Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/adapters/openclaw.md Quick install command that runs scripts/install-openclaw-plugin.sh, which handles building, extension setup, runtime registration, and gateway restart. Requires Node.js in PATH and OpenClaw to have been started once so openclaw.json exists. Pass OPENCLAW_STATE_DIR as an argument if it is not the default /openclaw. ```bash npm run install:openclaw ``` -------------------------------- ### Install hooks with npx context-mode setup Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/jetbrains-copilot.md Run this command to install hooks for the JetBrains Copilot adapter. It creates .github/hooks/context-mode.json in your project. ```bash npx context-mode@latest setup --adapter jetbrains-copilot ``` -------------------------------- ### useEffect Basic Example with Cleanup Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-react-docs.md Basic example of using useEffect to synchronize with an external chat system. The setup function creates a connection and the cleanup function disconnects when dependencies change or the component unmounts. The dependency array includes serverUrl and roomId. ```js import { useState, useEffect } from 'react'; import { createConnection } from './chat.js'; function ChatRoom({ roomId }) { const [serverUrl, setServerUrl] = useState('https://localhost:1234'); useEffect(() => { const connection = createConnection(serverUrl, roomId); connection.connect(); // Cleanup function return () => { connection.disconnect(); }; }, [serverUrl, roomId]); return
Chat Room
; } ``` -------------------------------- ### Agent setup prompt for QuietContext Source: https://github.com/alexcodeplace/quietcontext/blob/main/README.md Use this prompt to instruct an agent to install and configure QuietContext, including verification steps and security constraints. ```text Set up QuietContext for this project using https://github.com/alexcodeplace/quietcontext and its current README. Inspect my OS/architecture, Node/npm and existing MCP or qc installation first. Use the documented release archive and verify its published SHA-256; do not substitute the unrelated upstream context-mode package or assume macOS/ARM has a native qc release. Tell me that the current documented release is an RC. Check qc --version and qc status, map a disposable repository, and prove that indexing a small text file and searching a known phrase returns that content. Configure one stdio quietcontext entry in my selected agent, preserving its other settings. Ask before choosing a client, enabling a shared daemon, turning on Bash routing, or restarting sessions. Keep daemon auth and loopback binding; do not print tokens or index secrets. Finish with usage examples, actual verification results, changed paths, and rollback instructions. ``` -------------------------------- ### Install context-mode plugin Source: https://github.com/alexcodeplace/quietcontext/blob/main/configs/copilot-cli/README.md Installs the context-mode MCP server and routing skill into GitHub Copilot CLI without requiring a context-mode upgrade or agent call. ```sh copilot plugin install mksglu/context-mode:configs/copilot-cli ``` -------------------------------- ### Manual install for OpenClaw adapter Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/adapters/openclaw.md Manual install command for advanced users or custom setups. The optional argument specifies the OpenClaw state directory, which defaults to /openclaw. ```bash bash scripts/install-openclaw-plugin.sh [OPENCLAW_STATE_DIR] ``` -------------------------------- ### Install QuietContext daemon as a logon task Source: https://github.com/alexcodeplace/quietcontext/blob/main/windows/README.md Registers a per-user logon task named 'QuietContext Daemon', starts it, and waits until the daemon is listening. Supports flags: -Port, -NodePath, -TaskName, -NoStart, -Status, -Uninstall. ```powershell powershell -ExecutionPolicy Bypass -File .\windows\Install-QuietContextDaemon.ps1 ``` -------------------------------- ### Install global context-mode binary Source: https://github.com/alexcodeplace/quietcontext/blob/main/configs/copilot-cli/README.md Installs the global context-mode binary, which the MCP server requires for its native better-sqlite3 dependency. ```sh npm install -g context-mode ``` -------------------------------- ### Install context-mode-ops skill Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Use this command to install the recommended skill for TDD enforcement, issue triage, PR review, and release automation. ```bash npx skills add https://github.com/mksglu/context-mode/tree/main/.claude/skills/context-mode-ops ``` -------------------------------- ### Install OpenClaw plugin Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Installs the plugin and handles building, native dependency rebuilds, extension registration, and gateway restarts. Supports an optional custom state directory path. ```bash npm run install:openclaw # Or with a custom state directory: npm run install:openclaw -- /path/to/openclaw-state ``` -------------------------------- ### Verify and Install QuietContext on Linux Source: https://github.com/alexcodeplace/quietcontext/blob/main/README.md Commands to verify the SHA-256 checksum of the downloaded archive, install the package globally, and check the version and status. ```sh sha256sum -c SHA256SUMS npm install -g ./quietcontext-1.1.0-rc.3.tgz qc --version qc status ``` -------------------------------- ### Direct caller query output example Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/specs/2026-09-17-qc-semantic-repository-graph.md Example output for a direct caller query using the qc-callers v1 format. Shows two definitions of saveUser with their callers and call sites. ```text [qc-callers v1] saveUser — 2 definitions saveUser — src/a/user.ts:18 <- submitForm — src/a/form.ts:42 [calls @42] saveUser — src/b/user.ts:11 <- syncUser — src/b/sync.ts:77 [calls @77] ``` -------------------------------- ### Install capture hooks via Copilot Source: https://github.com/alexcodeplace/quietcontext/blob/main/configs/copilot-cli/README.md Runs the context-mode upgrade from inside Copilot to install capture hooks, ensuring it detects copilot-cli via the live MCP client. ```sh copilot -p "Use the context-mode ctx_upgrade tool to install context-mode's hooks." --allow-all ``` -------------------------------- ### Impact query output example Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/specs/2026-09-17-qc-semantic-repository-graph.md Example output for an impact query using the qc-impact v1 format. Shows two definitions of saveUser with depth 3, listing direct and transitive dependencies with their kinds. ```text [qc-impact v1] saveUser — 2 definitions, depth 3 saveUser — src/a/user.ts:18 d1 submitForm — src/a/form.ts:42 [calls] d2 POST /users adapter — src/a/api.ts:30 [references] saveUser — src/b/user.ts:11 d1 syncUser — src/b/sync.ts:77 [calls] ``` -------------------------------- ### useEffect with External System Connection and Cleanup Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-react-docs.md Shows a practical example of using useEffect to establish a connection to an external system (chat room) with proper cleanup. Demonstrates dependency array usage with serverUrl and roomId, and includes a cleanup function that disconnects when dependencies change or component unmounts. ```APIDOC ## useEffect with External System Connection and Cleanup ### Description Shows a practical example of using useEffect to establish a connection to an external system (chat room) with proper cleanup. Demonstrates dependency array usage with serverUrl and roomId, and includes a cleanup function that disconnects when dependencies change or component unmounts. ### Example ```javascript import { useState, useEffect } from 'react'; import { createConnection } from './chat.js'; function ChatRoom({ roomId }) { const [serverUrl, setServerUrl] = useState('https://localhost:1234'); useEffect(() => { const connection = createConnection(serverUrl, roomId); connection.connect(); return () => { connection.disconnect(); }; }, [serverUrl, roomId]); // ... } ``` ``` -------------------------------- ### Generated hook configuration (context-mode.json) Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/jetbrains-copilot.md This JSON is created by the setup command. It defines hooks for PreToolUse, PostToolUse, PreCompact, and SessionStart events. ```json { "hooks": { "PreToolUse": [ { "type": "command", "command": "context-mode hook jetbrains-copilot pretooluse" } ], "PostToolUse": [ { "type": "command", "command": "context-mode hook jetbrains-copilot posttooluse" } ], "PreCompact": [ { "type": "command", "command": "context-mode hook jetbrains-copilot precompact" } ], "SessionStart": [ { "type": "command", "command": "context-mode hook jetbrains-copilot sessionstart" } ] } } ``` -------------------------------- ### Configure MCP client for quietcontext Source: https://github.com/alexcodeplace/quietcontext/blob/main/README.md Example TOML configuration for connecting an MCP client to the quietcontext server via stdio. ```toml [mcp_servers.quietcontext] command = "quietcontext" ``` -------------------------------- ### Canonical tool description template Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/adr/0002-tool-description-style.md The required structure for all ctx_* tool descriptions. Headline must be <= 120 chars, imperative-positive. Sections must appear in order WHEN, WHEN NOT, RETURNS, EXAMPLE. Bullets use markdown '- ' only. Section headers are UPPERCASE with a colon. Two-space bullet indent. One blank line between sections. One canonical EXAMPLE per tool, with optional second EXAMPLE line for tools with two valid input shapes. ```text <1-line headline, <= 120 chars, imperative-positive> WHEN: - WHEN NOT: - RETURNS: EXAMPLE: ``` -------------------------------- ### initPromise pattern for async setup in register() Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/adapters/openclaw.md OpenClaw discards the return value of register(), so async setup must be wrapped in a promise and awaited inside hooks. This snippet shows registering an after_tool_call hook that awaits the initPromise before handling the event. ```typescript register(api): void { const initPromise = (async () => { /* async setup */ })(); api.on("after_tool_call", async (e) => { await initPromise; // handle event }); } ``` -------------------------------- ### FTS5 Pointer Message Example Source: https://github.com/alexcodeplace/quietcontext/blob/main/BENCHMARK.md Example of the pointer message returned when output exceeds 100 KB. It indicates the number of indexed sections and instructs the LLM to use search() to query the content. ```text # execute output > 100 KB: Indexed 42 sections (12 with code) from: execute:shell Use search(queries: ["..."]) to query this content. Use source: "execute:shell" to scope results. ``` -------------------------------- ### Install upstream skills with npx skills add Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/UPSTREAM-CREDITS.md Use this command to install the upstream skills into your local Claude Code. It adds the specified skills from the mattpocock/skills repository with the claude-code adapter and assumes yes to prompts. This is intended for maintainers running /context-mode-ops, not end users. ```bash npx skills add mattpocock/skills \ -s tdd grill-me grill-with-docs diagnose improve-codebase-architecture \ -a claude-code -y ``` -------------------------------- ### Remove server bundle for local development Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Forces the start script to use the compiled build/server.js instead of the pre-built bundle. ```bash rm server.bundle.mjs # forces start.mjs to use build/server.js ``` -------------------------------- ### qc command usage examples Source: https://github.com/alexcodeplace/quietcontext/blob/main/README.md Shows common local qc invocations for running commands, exploring the repository, querying symbols, callers, callees, impact, dependencies, paths, indexing stdin, searching, and checking status/doctor. qc run preserves the child exit code; qc index --stdin accepts at most the normal per-source indexing cap and rejects invalid UTF-8. ```sh qc run -- rg -n "needle" src qc repo explore "how does MyType save records?" qc repo map qc repo symbol MyType qc callers MyType.method qc callees MyType.method --depth 2 qc impact MyType.method --depth 3 qc deps src/service.ts qc path requestHandler saveRecord printf '%s\n' "large reusable context" | qc index --stdin --source notes/demo --project "$PWD" qc search reusable --project "$PWD" --full qc status qc doctor ``` -------------------------------- ### ctx_insight Source: https://github.com/alexcodeplace/quietcontext/blob/main/llms-full.txt Opens the context-mode Insight dashboard in the browser, showing personal analytics. First run installs dependencies (~30s); subsequent runs open instantly. ```APIDOC ## ctx_insight ### Description Opens the context-mode Insight dashboard in the browser. Shows personal analytics: session activity, tool usage, error rate, parallel work patterns, project focus, and actionable insights. First run installs dependencies (~30s); subsequent runs open instantly. ### Method ctx_insight ### Parameters #### Query Parameters - **port** (number) - Optional - Default: 4747 - **sessionDir** (string) - Optional - Override INSIGHT_SESSION_DIR - **contentDir** (string) - Optional - Override INSIGHT_CONTENT_DIR - **insightSessionDir** (string) - Optional - Alias for sessionDir - **insightContentDir** (string) - Optional - Alias for contentDir ### Request Example ``` ctx_insight({ port: 4747, sessionDir: "/path/to/session", contentDir: "/path/to/content" }) ``` ### Response Opens the dashboard in the browser. ``` -------------------------------- ### ctx_insight tool call with optional parameters Source: https://github.com/alexcodeplace/quietcontext/blob/main/llms-full.txt Opens the context-mode Insight dashboard. First run installs dependencies (~30s); subsequent runs open instantly. Optional parameters override defaults: port (default 4747), sessionDir, contentDir, and aliases insightSessionDir and insightContentDir. ```javascript ctx_insight({ port?: number, // default: 4747 sessionDir?: string, // override INSIGHT_SESSION_DIR contentDir?: string, // override INSIGHT_CONTENT_DIR insightSessionDir?: string,// alias for sessionDir insightContentDir?: string // alias for contentDir }) ``` -------------------------------- ### ctx_doctor Source: https://github.com/alexcodeplace/quietcontext/blob/main/llms-full.txt Diagnose context-mode installation. Runs all checks server-side and returns results as a markdown checklist. ```APIDOC ## ctx_doctor ### Description Diagnose context-mode installation. Runs all checks server-side and returns results as a markdown checklist. No CLI execution needed. ### Parameters None. ### Checks - Verifies runtime availability for all 12 languages - Sandbox round-trip - FTS5 / SQLite native module - Hook script presence - Current version ``` -------------------------------- ### Upgrade context-mode to v1.0.148 Source: https://github.com/alexcodeplace/quietcontext/blob/main/release-notes-v1.0.148.md Run the npx command to upgrade context-mode to the latest version, or use the in-plugin /context-mode:ctx-upgrade command if the plugin is already installed. After upgrading, run `ctx_stats` once so the legacy-schema migration runs transparently on first call. ```bash npx context-mode@latest # or, if you have the plugin installed: /context-mode:ctx-upgrade ``` -------------------------------- ### useEffect Hook Syntax Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-react-docs.md Syntax signature for the useEffect Hook. The setup function runs after the component commits to the DOM and may return a cleanup function. The optional dependencies array controls when the Effect re-runs. ```js useEffect(setup, dependencies?) ``` -------------------------------- ### SessionStart Hook XML Routing Block Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/llms-full.txt XML block emitted as additionalContext at session start. Contains priority instructions, tool selection hierarchy, forbidden actions, and output constraints to protect the context window. ```xml Raw tool output floods your context window. You MUST use context-mode MCP tools to keep raw data in the sandbox. 1. GATHER: batch_execute(commands, queries) 2. FOLLOW-UP: search(queries: ["q1", "q2", ...]) 3. PROCESSING: execute(language, code) | execute_file(path, language, code) - DO NOT use Bash for commands producing >20 lines of output. - DO NOT use Read for analysis (use execute_file). - DO NOT use WebFetch (use fetch_and_index instead). - Bash is ONLY for git/mkdir/rm/mv/navigation. Keep final response under 500 words. Write artifacts to FILES, not inline text. ``` -------------------------------- ### JavaScript file analysis with context-mode/exec-file Source: https://github.com/alexcodeplace/quietcontext/blob/main/configs/antigravity-cli/skills/context-mode/SKILL.md Use this JSON payload with context-mode/exec-file to read a file into FILE_CONTENT and run JavaScript code over it. The example reads the first 20 lines of README.md. Never print FILE_CONTENT wholesale unless explicitly requested. ```json { "path": "README.md", "language": "javascript", "code": "const lines = FILE_CONTENT.split(/\r?\n/); console.log(lines.slice(0, 20).join('\n'));" } ``` -------------------------------- ### Invoke Live Supabase Edge Function Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-supabase-edge.md Provides examples for invoking an Edge Function using both cURL and the Supabase JavaScript SDK. ```bash curl --request POST 'https://.supabase.co/functions/v1/hello-world' \ --header 'Authorization: Bearer ANON_KEY' \ --header 'Content-Type: application/json' \ --data '{ "name":"Functions" }' ``` ```js const { data, error } = await supabase.functions.invoke('hello-world', { body: { name: 'Functions' }, }) ``` -------------------------------- ### useEffect External System Connection with Cleanup Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-react-docs.md Practical example of using useEffect to connect to an external chat room with proper cleanup. The cleanup function disconnects when dependencies change or the component unmounts. The dependency array includes serverUrl and roomId. ```javascript import { useState, useEffect } from 'react'; import { createConnection } from './chat.js'; function ChatRoom({ roomId }) { const [serverUrl, setServerUrl] = useState('https://localhost:1234'); useEffect(() => { const connection = createConnection(serverUrl, roomId); connection.connect(); return () => { connection.disconnect(); }; }, [serverUrl, roomId]); // ... } ``` -------------------------------- ### CLI Hook Dispatcher Command Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/platform-support.md The standard command pattern for invoking hook-based platforms, which resolves scripts relative to the installed package. ```bash context-mode hook ``` -------------------------------- ### useEffect Hook Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-react-docs.md A React Hook that synchronizes a component with an external system by running side effects after render commits. It accepts a setup function and an optional dependencies array. ```APIDOC ## useEffect Hook ### Description A React Hook that synchronizes a component with an external system by running side effects after render commits. ### Syntax ```js useEffect(setup, dependencies?) ``` ### Parameters #### setup (Function) - Required The function containing your Effect's logic. May optionally return a cleanup function. - Runs after component commits to DOM - Cleanup function runs before re-runs with new dependencies or before component unmounts - Receives no parameters #### dependencies (Array) - Optional List of all reactive values referenced in setup code (props, state, variables, functions declared in component body). - If omitted: Effect re-runs after every commit - If empty array `[]`: Effect runs once after initial mount - If array with values `[dep1, dep2]`: Effect re-runs when dependencies change - Compared using `Object.is()` comparison - Must have constant number of items and be written inline ### Returns `undefined` ### Basic Example ```js import { useState, useEffect } from 'react'; import { createConnection } from './chat.js'; function ChatRoom({ roomId }) { const [serverUrl, setServerUrl] = useState('https://localhost:1234'); useEffect(() => { const connection = createConnection(serverUrl, roomId); connection.connect(); // Cleanup function return () => { connection.disconnect(); }; }, [serverUrl, roomId]); return
Chat Room
; } ``` ### Important Rules #### Placement - Call at top level of component or custom Hook - Cannot call inside loops or conditions - Extract to new component if conditional Effect needed #### When to Use - Synchronizing with external systems - Do not use if not synchronizing with external system #### Development Behavior - Strict Mode runs extra setup+cleanup cycle before first real setup - Stress-tests that cleanup mirrors setup logic - Only in development, not in production #### Performance Considerations - Object/function dependencies can cause unnecessary re-runs - Remove unnecessary object and function dependencies - Extract state updates outside Effect when possible - Extract non-reactive logic outside Effect #### Rendering Behavior - Effects run on client only, not during server rendering - Non-interaction Effects: browser paints before Effect runs - Interaction Effects: Effect may run before browser paints - Use `useLayoutEffect` if visual Effect needs to run before paint - Use `setTimeout` to defer work until after paint if needed ### Caveats - Effects only run on client, not during server rendering - Strict Mode adds extra setup+cleanup cycle in development - Object/function dependencies may cause excessive re-runs - Visual Effects may need `useLayoutEffect` instead - Browser repaint timing depends on Effect cause (interaction vs non-interaction) ``` -------------------------------- ### Example of two-space bullet indent under WHEN header Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/adr/0002-tool-description-style.md Shows the required two-space indentation for bullets under a section header. The contract test does not assert the literal indent count, but shipped descriptions use two spaces for visual uniformity. ```text WHEN: - First positive cue - Second positive cue ``` -------------------------------- ### Mask position grid layout Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-tailwind-docs.md A complete grid layout showcasing all mask position utilities (top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right). Uses a 3-column grid with responsive design and labeled examples. ```jsx

mask-top-left

``` -------------------------------- ### SLICE B formula (old) for Without/With context-mode bar Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/adr/0004-stats-strict-compression-formula.md The formula introduced in v1.0.134 SLICE B to fix a degenerate-100% display bug. It adds eventDataBytes to both sides of the ratio, which later caused under-attribution when real bytesAvoided data started flowing. ```text Without = bytesAvoided + bytesReturned + eventDataBytes With = max(1, bytesReturned + eventDataBytes) ``` -------------------------------- ### Codex PreToolUse hook matcher JSON Source: https://github.com/alexcodeplace/quietcontext/blob/main/README.md Exact supported matcher for the Codex adapter's user-level hook. The canonical entry is qc hook codex pretooluse. The packaged Codex plugin keeps its automatic hook manifest empty; installation into hooks.json is an explicit action. ```json { "PreToolUse": [{ "matcher": "local_shell|shell|shell_command|exec_command|Bash|Shell|apply_patch|Edit|Write|grep_files|ctx_execute|ctx_execute_file|ctx_batch_execute|ctx_fetch_and_index|ctx_search|ctx_index|mcp__", "hooks": [{ "type": "command", "command": "qc hook codex pretooluse" }] }] } ``` -------------------------------- ### Clone and build the repository Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Initial steps to clone the repository and compile the source code. ```bash git clone https://github.com/mksglu/context-mode.git cd context-mode npm install npm run build # tsc compiles src/ → build/ ``` -------------------------------- ### fetch_and_index tool parameters Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/llms-full.txt Fetches a URL in a subprocess, converts content based on Content-Type, indexes into the knowledge base, and returns a preview. The source label defaults to the URL. ```javascript fetch_and_index({ url: string, // URL to fetch source?: string // label for indexed content, defaults to URL }) ``` -------------------------------- ### fetch_and_index Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/llms-full.txt Fetches a URL in a subprocess, converts content based on Content-Type, indexes into the knowledge base, and returns a preview. ```APIDOC ## fetch_and_index ### Description Fetches a URL in a subprocess, converts content based on Content-Type, indexes into the knowledge base, and returns a preview. ### Method fetch_and_index ### Parameters #### Request Body - **url** (string) - Required - URL to fetch - **source** (string) - Optional - Label for indexed content, defaults to URL ### Content-type Routing | Content-Type | Processing | Index method | |--------------|-----------|--------------| | HTML (default) | Turndown markdown conversion (removes script, style, nav, header, footer elements) | store.index() (markdown chunking) | | JSON (__CM_CT__:json) | Direct indexing | store.indexJSON() (key-path chunking) | | Plain text (__CM_CT__:text) | Direct indexing | store.indexPlainText() (line-group chunking) | ### Subprocess Isolation The fetch is executed as JavaScript code inside a subprocess. Raw HTML never enters context. The subprocess uses Turndown with GFM plugin and domino for HTML-to-markdown conversion. The Content-Type header is communicated back via a __CM_CT__: prefix on the first line of stdout. ### Preview Returns the first 3072 bytes (PREVIEW_LIMIT) of the converted markdown. Content beyond this is truncated with a "...[truncated -- use search() for full content]" message. ### Timeout 30,000 ms for the fetch subprocess. ``` -------------------------------- ### Manually register context-mode MCP server Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/adapters/openclaw.md Manually registers the context-mode MCP server as a sidecar and restarts the gateway. Use this if the plugin loads but ctx_* tools are missing from the agent's tool list and you configured OpenClaw manually. After the restart, the agent's tool inventory should include context-mode__execute, context-mode__search, context-mode__fetch-index, and the rest of the ctx_* surface. ```bash openclaw mcp set context-mode \ "{\"command\":\"node\",\"args\":[\"/absolute/path/to/context-mode/server.bundle.mjs\"]}" openclaw gateway restart ``` -------------------------------- ### fetch-index Source: https://github.com/alexcodeplace/quietcontext/blob/main/llms-full.txt Fetches a URL in a subprocess, converts content based on Content-Type, indexes into the knowledge base, and returns a preview. ```APIDOC ## fetch-index ### Description Fetches a URL in a subprocess, converts content based on Content-Type, indexes into the knowledge base, and returns a preview. ### Parameters - **url** (string) - Required - URL to fetch. - **source** (string) - Optional - Label for indexed content, defaults to URL. ### Content-type Routing | Content-Type | Processing | Index method | |--------------|-----------|--------------| | HTML (default) | Turndown markdown conversion (removes script, style, nav, header, footer elements) | `store.index()` (markdown chunking) | | JSON (`__CM_CT__:json`) | Direct indexing | `store.indexJSON()` (key-path chunking) | | Plain text (`__CM_CT__:text`) | Direct indexing | `store.indexPlainText()` (line-group chunking) | ### Subprocess Isolation The fetch is executed as JavaScript code inside a subprocess. Raw HTML never enters context. The subprocess uses Turndown with GFM plugin and domino for HTML-to-markdown conversion. The Content-Type header is communicated back via a `__CM_CT__:` prefix on the first line of stdout. ### Preview Returns the first 3072 bytes (`PREVIEW_LIMIT`) of the converted markdown. Content beyond this is truncated with a `"...[truncated -- use search() for full content]"` message. ### Timeout 30,000 ms for the fetch subprocess. ``` -------------------------------- ### Deno Unit Test for Supabase Edge Functions Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-supabase-edge.md Demonstrates how to initialize a Supabase client with environment variables and perform unit tests for database connectivity and function invocation using Deno. ```typescript import { assert, assertEquals } from 'jsr:@std/assert@1' import { createClient, SupabaseClient } from 'npm:@supabase/supabase-js@2' import 'jsr:@std/dotenv/load' const supabaseUrl = Deno.env.get('SUPABASE_URL') ?? '' const supabaseKey = Deno.env.get('SUPABASE_PUBLISHABLE_KEY') ?? '' const options = { auth: { autoRefreshToken: false, persistSession: false, detectSessionInUrl: false, }, } const testClientCreation = async () => { var client: SupabaseClient = createClient(supabaseUrl, supabaseKey, options) if (!supabaseUrl) throw new Error('supabaseUrl is required.') if (!supabaseKey) throw new Error('supabaseKey is required.') const { data: table_data, error: table_error } = await client.from('my_table').select('*').limit(1) if (table_error) throw new Error('Invalid Supabase client: ' + table_error.message) assert(table_data, 'Data should be returned from the query.') } const testHelloWorld = async () => { var client: SupabaseClient = createClient(supabaseUrl, supabaseKey, options) const { data: func_data, error: func_error } = await client.functions.invoke('hello-world', { body: { name: 'bar' } }) if (func_error) throw new Error('Invalid response: ' + func_error.message) console.log(JSON.stringify(func_data, null, 2)) assertEquals(func_data.message, 'Hello bar!') } Deno.test('Client Creation Test', testClientCreation) Deno.test('Hello-world Function Test', testHelloWorld) ``` -------------------------------- ### Create Server Component Page with Data Fetching Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-nextjs-docs.md Shows how to create a page.tsx file in the app directory that acts as a Server Component, fetches data, and passes it to a Client Component. ```typescript // Import your Client Component import HomePage from './home-page' async function getPosts() { const res = await fetch('https://...') const posts = await res.json() return posts } export default async function Page() { // Fetch data directly in a Server Component const recentPosts = await getPosts() // Forward fetched data to your Client Component return } ``` ```javascript // Import your Client Component import HomePage from './home-page' async function getPosts() { const res = await fetch('https://...') const posts = await res.json() return posts } export default async function Page() { // Fetch data directly in a Server Component const recentPosts = await getPosts() // Forward fetched data to your Client Component return } ``` -------------------------------- ### Run QuietContext test suites Source: https://github.com/alexcodeplace/quietcontext/blob/main/BENCHMARK.md Commands to run individual test suites (Executor, FTS5 BM25 store, Ecosystem benchmark), all tests, and a live benchmark that requires a Context7 fixture. ```bash # Run individual test suites npm run test # Executor tests npm run test:store # FTS5 BM25 store tests npm run test:ecosystem # Ecosystem benchmark # Run all tests npm run test:all # Live benchmark (requires Context7 fixture) npx tsx tests/live-benchmark.ts ``` -------------------------------- ### Connect to Postgres in Deno Edge Function Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-supabase-edge.md Shows how to initialize a Supabase client within a Deno server request handler to query a Postgres table while passing the Authorization header. ```typescript import { createClient } from 'npm:@supabase/supabase-js@2' Deno.serve(async (req) => { try { const supabase = createClient( Deno.env.get('SUPABASE_URL') ?? '', Deno.env.get('SUPABASE_PUBLISHABLE_KEY') ?? '', { global: { headers: { Authorization: req.headers.get('Authorization')! } } } ) const { data, error } = await supabase.from('countries').select('*') if (error) throw error return new Response(JSON.stringify({ data }), { headers: { 'Content-Type': 'application/json' }, status: 200 }) } catch (err) { return new Response(String(err?.message ?? err), { status: 500 }) } }) ``` -------------------------------- ### Run QuietContext CLI commands Source: https://github.com/alexcodeplace/quietcontext/blob/main/README.md Basic commands for mapping repositories, running shell commands, indexing files, and searching content. ```sh qc repo map qc run -- git status --short qc index README.md --source project-readme qc search installation --source project-readme --full ``` -------------------------------- ### ctx_upgrade tool call Source: https://github.com/alexcodeplace/quietcontext/blob/main/llms-full.txt Invokes ctx_upgrade with no parameters. Returns a shell command that the host must execute via its shell tool and display output as a checklist. User should restart session after upgrade. ```javascript ctx_upgrade({}) // no parameters ``` -------------------------------- ### Rebuild the project Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Compile the project after making version changes. ```bash npm run build ``` -------------------------------- ### context-mode/exec-file: avoid full dumps, print only derived values Source: https://github.com/alexcodeplace/quietcontext/blob/main/configs/antigravity-cli/rules/context-mode.md Shows the wrong way to dump a whole file and the right ways to print only a specific value, matching lines, or a known line slice using context-mode/exec-file. ```python exec-file(path:"config.yaml", language:"python", code:"print(FILE_CONTENT)") ``` ```python code:"import yaml; d=yaml.safe_load(FILE_CONTENT); print(d['active_strategy'])" ``` ```python code:"import re;[print(i+1,l) for i,l in enumerate(FILE_CONTENT.splitlines()) if 'active_strategies' in l]" ``` ```python code:"print(chr(10).join(FILE_CONTENT.splitlines()[190:230]))" ``` -------------------------------- ### Run OpenClaw adapter tests Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Executes the test suite for the OpenClaw adapter using vitest, which mocks the plugin API without requiring a live instance. ```bash npx vitest run tests/plugins/openclaw.test.ts tests/adapters/openclaw.test.ts ``` -------------------------------- ### Initialize Supabase Client with Auth Context Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-supabase-edge.md Initializes a Supabase client in a Deno Edge Function using the request's Authorization header to maintain auth context. ```typescript import { createClient } from 'npm:@supabase/supabase-js@2' Deno.serve(async (req: Request) => { const supabaseClient = createClient( Deno.env.get('SUPABASE_URL') ?? '', Deno.env.get('SUPABASE_ANON_KEY') ?? '', { global: { headers: { Authorization: req.headers.get('Authorization')! } } } ); }) ``` -------------------------------- ### stats tool parameters Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/llms-full.txt Returns context consumption statistics for the current session. Takes no parameters. ```javascript stats({}) // no parameters ``` -------------------------------- ### Upgrade context-mode Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/jetbrains-copilot.md Updates context-mode to the latest version. Alternatively, type 'ctx upgrade' in a Copilot chat session. ```bash context-mode upgrade ``` -------------------------------- ### Canonical qc commands for semantic graph navigation Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/specs/2026-09-17-qc-semantic-repository-graph.md New command surface for querying callers, callees, impact, dependencies, dependents, and paths. All commands accept optional --depth and file filters. Equivalent qc repo spellings are accepted. ```text qc callers [--file ] [--depth N] qc callees [--file ] [--depth N] qc impact [--file ] [--depth N] qc deps [--depth N] qc dependents [--depth N] qc path [--max-depth N] ``` -------------------------------- ### Plugin registration configuration in .claude-plugin/plugin.json Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/llms-full.txt JSON configuration for the context-mode plugin, registering the MCP server and skills directory. The server runs via node with start.mjs and the skills are located in ./skills/. ```json { "name": "context-mode", "version": "0.9.22", "description": "Claude Code MCP plugin that saves 98% of your context window.", "mcpServers": { "context-mode": { "command": "node", "args": ["${CLAUDE_PLUGIN_ROOT}/start.mjs"] } }, "skills": "./skills/" } ``` -------------------------------- ### Symlink cache to local clone Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Replace the cached plugin directory with a symlink to your local development clone. ```bash # Back up the cache (use your actual version number) mv ~/.claude/plugins/cache/context-mode/context-mode/0.9.23 \ ~/.claude/plugins/cache/context-mode/context-mode/0.9.23.bak # Symlink to your local clone ln -s /path/to/your/clone/context-mode \ ~/.claude/plugins/cache/context-mode/context-mode/0.9.23 ``` -------------------------------- ### Verify local development mode Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Check the version output in Claude Code to confirm the local build is active. ```text npm (MCP): WARN — local v0.9.23-dev, latest v0.9.23 ``` -------------------------------- ### Restore marketplace version Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Remove the symlink and restore the original plugin cache to revert to the marketplace version. ```bash # Remove symlink and restore backup rm ~/.claude/plugins/cache/context-mode/context-mode/0.9.23 mv ~/.claude/plugins/cache/context-mode/context-mode/0.9.23.bak \ ~/.claude/plugins/cache/context-mode/context-mode/0.9.23 ``` -------------------------------- ### ctx_upgrade Source: https://github.com/alexcodeplace/quietcontext/blob/main/llms-full.txt Upgrades context-mode to the latest version. Returns a shell command that the host must execute via its shell tool, then the user should restart their session. ```APIDOC ## ctx_upgrade ### Description Upgrades context-mode to the latest version. Returns a shell command the host must execute via its shell tool (Bash, shell_execute, run_in_terminal, etc.) and display the output as a checklist. Tells the user to restart their session after upgrade. ### Method ctx_upgrade ### Parameters No parameters. ### Request Example ``` ctx_upgrade({}) ``` ### Response Returns a shell command to execute. ``` -------------------------------- ### Add context-mode MCP server without plugin Source: https://github.com/alexcodeplace/quietcontext/blob/main/configs/copilot-cli/README.md Alternative to the plugin: adds the context-mode MCP server to Copilot CLI with the QUIET_CONTEXT_PLATFORM environment variable set to copilot-cli. ```sh copilot mcp add context-mode --env QUIET_CONTEXT_PLATFORM=copilot-cli -- context-mode ``` -------------------------------- ### Hook Registration Configuration (hooks/hooks.json) Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/llms-full.txt JSON configuration registering PreToolUse hooks for Bash, WebFetch, Read, Grep, Task, and context-mode MCP tools, plus a SessionStart hook with an empty matcher. Uses ${CLAUDE_PLUGIN_ROOT} for hook paths. ```json { "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.mjs" }] }, { "matcher": "WebFetch", "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.mjs" }] }, { "matcher": "Read", "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.mjs" }] }, { "matcher": "Grep", "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.mjs" }] }, { "matcher": "Task", "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.mjs" }] }, { "matcher": "mcp__plugin_context-mode_context-mode__execute", "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.mjs" }] }, { "matcher": "mcp__plugin_context-mode_context-mode__execute_file", "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.mjs" }] }, { "matcher": "mcp__plugin_context-mode_context-mode__batch_execute", "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/pretooluse.mjs" }] } ], "SessionStart": [ { "matcher": "", "hooks": [{ "type": "command", "command": "node ${CLAUDE_PLUGIN_ROOT}/hooks/sessionstart.mjs" }] } ] } } ``` -------------------------------- ### Run build and test commands Source: https://github.com/alexcodeplace/quietcontext/blob/main/CONTRIBUTING.md Use these commands to compile TypeScript, run tests, perform type checking, or enter watch mode during development. ```bash # TypeScript compilation npm run build # Run all tests (parallel via Vitest) npm test # Type checking only npm run typecheck # Watch mode npm run test:watch ``` -------------------------------- ### Multi-column layout with columns utilities Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-tailwind-docs.md Creates a responsive multi-column layout using columns-1 on mobile and sm:columns-3 on small screens and above, with gap-6 spacing, justified text, and serif font. Useful for newspaper-style layouts and footer navigation. ```html

...

``` ```jsx

Expedita quo ea quod laborum ullam ipsum enim. Deleniti commodi et. Nam id laborum placeat natus eum.

Eligendi error nisi recusandae velit numquam nihil aperiam enim. Eum et molestias.

``` -------------------------------- ### Fetch Data with Cache Options in App Router Source: https://github.com/alexcodeplace/quietcontext/blob/main/tests/fixtures/context7-nextjs-docs.md Demonstrates caching strategies for data fetching in async React Server Components using fetch with cache and next options. ```typescript export default async function Page() { // This request should be cached until manually invalidated. // Similar to `getStaticProps`. // `force-cache` is the default and can be omitted. const staticData = await fetch(`https://...`, { cache: 'force-cache' }) // This request should be refetched on every request. // Similar to `getServerSideProps`. const dynamicData = await fetch(`https://...`, { cache: 'no-store' }) // This request should be cached with a lifetime of 10 seconds. // Similar to `getStaticProps` with the `revalidate` option. const revalidatedData = await fetch(`https://...`, { next: { revalidate: 10 }, }) return
...
} ``` ```javascript export default async function Page() { // This request should be cached until manually invalidated. // Similar to `getStaticProps`. // `force-cache` is the default and can be omitted. const staticData = await fetch(`https://...`, { cache: 'force-cache' }) // This request should be refetched on every request. // Similar to `getServerSideProps`. const dynamicData = await fetch(`https://...`, { cache: 'no-store' }) // This request should be cached with a lifetime of 10 seconds. // Similar to `getStaticProps` with the `revalidate` option. const revalidatedData = await fetch(`https://...`, { next: { revalidate: 10 }, }) return
...
} ``` -------------------------------- ### context-mode tool argument shapes Source: https://github.com/alexcodeplace/quietcontext/blob/main/configs/antigravity-cli/rules/context-mode.md Argument shapes for context-mode tools: execute, exec-file, batch, fetch-index, search, and index. Use these instead of reading cached schemas. ```json {"language":"python","code":"..."} ``` ```json {"path":"path/to/file","language":"python","code":"..."} ``` ```json {"commands":[{"label":"...","command":"..."}],"queries":["..."]} ``` ```json {"url":"https://...","source":"..."} ``` ```json {"queries":["q1","q2"]} ``` ```json {"path":"path/to/file-or-dir","source":"..."} ``` ```json {"content":"...","source":"..."} ``` -------------------------------- ### fetch-index tool parameter signature Source: https://github.com/alexcodeplace/quietcontext/blob/main/llms-full.txt Defines the input object for the fetch-index tool. Requires a URL to fetch; optional source label defaults to the URL. Content-Type routing determines indexing method. ```javascript fetch-index({ url: string, // URL to fetch source?: string // label for indexed content, defaults to URL }) ``` -------------------------------- ### Run context-mode doctor Source: https://github.com/alexcodeplace/quietcontext/blob/main/docs/jetbrains-copilot.md Runs diagnostics to verify everything is working. All checks should show [x]. Validates runtimes, hooks, FTS5, and MCP registration. ```bash context-mode doctor ```