Claude Code
How it connects
runmarq adds command hooks to Claude Code's settings: ~/.claude/settings.json for all projects, or .claude/settings.local.json inside one project. The project file is the personal, git-ignored one, so setup never edits settings your team shares. CLAUDE_CONFIG_DIR is respected.
runmarq integrations setup claude
runmarq integrations setup claude --project ./my-repoHooks are registered for SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, Notification, SubagentStart, SubagentStop, PreCompact, Stop, StopFailure and SessionEnd. Each runs runmarq emit --source claude_code, prints nothing and exits 0, so it cannot block a tool call or add text to your conversation.
What happens to each event
- A submitted prompt starts a run. The prompt is classified in the hook process and then discarded.
- A prompt that arrives while Claude is still working continues the same run: a message you typed during the turn, or Claude Code reporting that a background command finished. The first prompt names the task.
- Tool events set the current activity. Shell commands are inspected in memory only to tell tests, builds and installs apart.
- Permission requests and permission notifications pause the estimate and can notify you.
Stopends the run as finished;StopFailureends it as failed.- Claude's task list, or its older to-do list, provides plan progress. Only the counts are kept.
- Each event names the session transcript on your computer. runmarq reads the numbers in it (responses, token counts, context size, compactions and effort level) and keeps neither its text nor its location.
Interrupts
Claude Code does not fire Stop when you interrupt a turn. runmarq treats a tool failure flagged as an interrupt, an idle notification without a preceding stop, or a new prompt after Claude has gone quiet as the end of the run, and marks it cancelled at its last activity. An interrupted run is never shown as finished.
If Claude Code is closed mid-run, for example with its terminal window, runmarq notices within seconds that its process has exited and marks the run cancelled.
Running inside Cursor
Cursor can also run hooks from Claude Code settings files. Those payloads are recognised and ignored, so a Cursor run is counted once, through the native Cursor integration.
Compatibility
| Connection | Claude Code hooks (settings.json) |
| Support | Available |
| Checked against | Claude Code 2.1.143, with live runs |
Capabilities
| Signal | Available |
|---|---|
| Prompt start | Yes |
| Turn completion | Yes |
| Tool start | Yes |
| Tool completion | Yes |
| Plan progress | Yes |
| Approval requests | Yes |
| Errors | Yes |
| Subagents | Yes |
| Model metadata | Yes |
| Token counts | Yes |
| Interrupts reported directly | No |
Known limitations
- Claude Code does not report user interrupts directly. runmarq infers them and marks those runs cancelled, never finished.
- Plan progress is available only when Claude keeps a task list or to-do list.
- Model metadata is reported at session start, not for every prompt.