Expand description
Claude Code CLAUDE.md prompt-level guidance installer.
The PreToolUse hook (.claude/settings.local.json) only intercepts
Bash-tool commands. Claude Code’s built-in Read/Grep/Glob
tools bypass shell hooks entirely — confirmed in
github.com/anthropics/claude-code/issues/4544. That means a heavy
session (file reads, searches, directory listings) can pass through
Claude Code without sqz ever seeing a single byte.
Reported in issue #12 by @JCKodel:
Running claude on a long session don’t show anything in the dashboard […] In practice, both Cursor and claude cli shows 0.
This module installs prompt-level guidance into the project’s
CLAUDE.md file. Claude Code reads CLAUDE.md at session start,
so the agent sees the instructions on every turn.
The guidance block:
- recommends
sqz_read_file/sqz_grep/sqz_list_dirMCP tools (registered viasqz init’s MCP config merge) for any file I/O larger than ~2KB or that might be repeated; - keeps the built-in
Readavailable for tiny configs and byte-exact needs (lockfiles, signatures); - documents the
§ref:HASH§escape hatch so the agent doesn’t thrash on a token it can’t parse.
Same install/uninstall semantics as
codex_integration::install_agents_md_guidance:
- If
CLAUDE.mddoesn’t exist → create it with sqz’s block. - If it exists without the sqz block → append with a blank-line separator.
- If it exists with an outdated sqz block → replace the block in place; with the current one → no-op (idempotent).
The block is wrapped in HTML comment sentinels so uninstall can
excise it byte-exact.
Functions§
- claude_
mcp_ config_ managed - Whether
~/.claude.jsonholds themcpServers.sqzentry sqz installed. - claude_
md_ block_ outdated - Whether
sqz initwould replace the sqz block inCLAUDE.mdforsqz_path. - claude_
md_ guidance_ block - Build the markdown block that sqz appends to
CLAUDE.md. - claude_
md_ guidance_ state - Compare the
CLAUDE.mdblock against what this version writes for the same binary. - claude_
md_ has_ guidance - Whether the project’s
CLAUDE.mdholds a sqz block uninstall can remove. - claude_
md_ path - Compute the path where
CLAUDE.mdlives for the given project. - claude_
user_ json_ path - Compute the path of the user-level
~/.claude.jsonconfig. - install_
claude_ mcp_ config - Register sqz-mcp as an MCP server in
~/.claude.json. - install_
claude_ md_ guidance - Install sqz’s guidance block into
CLAUDE.mdatproject_dir. - refresh_
claude_ md_ guidance - Rewrite a stale
CLAUDE.mdblock in place, keeping its sqz binary while that resolves. - remove_
claude_ mcp_ config - Remove sqz’s
mcpServers.sqzentry from~/.claude.jsonif we installed it (detected by the_sqz_managedsentinel). Leaves user-customised entries alone. - remove_
claude_ md_ guidance - Remove sqz’s guidance block from
CLAUDE.mdif present.