Onboarding commands
cogniscape init
Save your customer key to the machine-level config.
Your Cogniscape customer key. Find it in the Cogniscape dashboard under Settings → API Keys.
Creates ~/.cogniscape/config.json
Saves the customer key at the machine level — shared across all projects on this machine.
cogniscape init again overwrites the existing key (idempotent).
The install script runs
cogniscape init automatically when you pass your customer key. You only need to run this manually if you installed the binary without a key or want to change keys.cogniscape update-key
Update the customer key for the current project.
cogniscape init first.
cogniscape setup-hooks
Install Claude Code hooks manually.
~/.claude/settings.json, preserving any existing third-party hooks. Creates a backup at ~/.claude/settings.cogniscape-backup.json before modifying. Idempotent — will not duplicate hooks already present.
cogniscape init runs this automatically. Use cogniscape setup-hooks directly only if you need to repair or re-install hooks without changing your customer key.| Event | Matcher | What it captures |
|---|---|---|
SessionStart | — | Session lifecycle begin |
Stop | — | Session summary + token usage |
PostToolUse | ExitPlanMode | Plan approval |
PostToolUse | TaskCreate | Task creation |
PostToolUse | TaskUpdate | Task completion |
~/.cursor/hooks.json, auto-detected when ~/.cursor/ exists):
| Event | What it captures |
|---|---|
sessionStart | Session lifecycle begin |
stop | Session summary (full conversation content) |
sessionEnd | Session lifecycle end |
cogniscape mcp update
Scan your machine for all AI tools with Cogniscape MCP configurations and update them to the latest format.
| Flag | Description |
|---|---|
--dry-run | Preview what would change without modifying any files |
--verbose | Show file paths of modified configs |
--only "<tool>" | Update only a specific tool (e.g., --only "Claude Desktop") |
cogniscape mcp setup
Configure the Cogniscape MCP server in Claude Desktop — zero manual JSON editing.
The old
cogniscape setup mcp command still works as an alias.Injects the MCP server entry
Adds or updates the
cogniscape-reader entry in Claude Desktop’s config at the platform-specific location:- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
| Scenario | Behavior |
|---|---|
| Config file does not exist | Creates it |
| Cogniscape entry already exists | Updates in place |
| Other MCP servers configured | Preserved |
| Invalid/corrupted JSON | Backs up the file and starts fresh |
| Customer key not set | Error with guidance to run cogniscape init first |
cogniscape-reader entry from Claude Desktop’s config, preserving all other MCP servers.
On Windows, the running binary cannot be deleted by the OS.
cogniscape uninstall will remove hooks but print a message asking you to delete the binary manually.cogniscape uninstall
Remove hooks and the binary.
~/.claude/settings.json and ~/.cursor/hooks.json, then deletes the binary. Idempotent. On Windows, the binary cannot be self-deleted while running — a message will indicate the path for manual removal.
cogniscape version
Authentication
All commands that call the API require a customer key, resolved in this order:--customer-keyflagCOGNISCAPE_CUSTOMER_KEYenvironment variable~/.cogniscape/config.json(machine-level, set bycogniscape init)- Error if none of the above is set
X-Cogniscape-Customer-Key HTTP header on all requests.
Local files
| Path | Purpose |
|---|---|
~/.cogniscape/config.json | Machine-level customer key. Created by cogniscape init. Shared across all projects. |
~/.cogniscape/hooks.log | Hook execution log. Rotated to the last 1000 lines when it exceeds 80 KB. |
~/.cogniscape/hooks-debug.jsonl | Raw hook payloads in JSONL format (debug). Same rotation policy. |
~/.cogniscape/task-cache/<id>.json | Ephemeral task metadata for create→complete correlation. Purged on session end. |
~/.claude/settings.json | Global Claude Code settings. cogniscape setup-hooks adds hooks here. |
~/.cursor/hooks.json | Cursor hooks config. Created automatically by cogniscape init when Cursor is detected. |
~/.cursor/hooks.cogniscape-backup.json | Backup of Cursor hooks before modification. |
| Claude Desktop config | cogniscape mcp setup adds the MCP server here. Path varies by OS: macOS ~/Library/Application Support/Claude/, Windows %APPDATA%\Claude\, Linux ~/.config/Claude/. |