# Troubleshooting

> What lk doctor checks, what each failure means, and where the logs are.

Start with `lk doctor`. It checks everything Lanekeeper depends on and says what to do about each failure:

```text
  ✓ git ≥ 2.38             git version 2.56.0
  ✓ Node ≥ 22.13           node 26.12.1
  ✓ git repository         /private/tmp/lk-demo/main
  ✓ daemon                 3 lanes, base main
  ✓ config                 .lanekeeper/config.yml valid (or defaults)
  ✓ state dir permissions  /private/tmp/lk-demo/main/.git/lanekeeper (700)
  ✗ Claude Code hooks      not in .claude/settings.json (lk init adds them; fine if you use the plugin)
  ✓ team sync              off (local only)
  ✓ telemetry              off
```

It exits 1 when a check other than the Claude Code hooks fails.

| Check | If it fails |
|---|---|
| git ≥ 2.38 | Lanekeeper needs `git merge-tree --write-tree`. Update git. |
| Node ≥ 22.13 | Update Node. |
| git repository | Run `lk` inside a checkout of the repository (any worktree). |
| daemon | `lk daemon logs` shows why it didn't start. `lk daemon stop` then any command restarts it. |
| config | The message names the invalid field. Until it's fixed Lanekeeper uses the defaults. |
| state dir permissions | Lanekeeper keeps its state in `.git/lanekeeper` with mode 700. Fix ownership if another user created it. |
| Claude Code hooks | Run `lk init`. With the plugin instead, this check stays ✗ (it only reads `.claude/settings.json`), which is fine. Not needed if you only use other agents. |

## Agents aren't told about clashes

- Run `lk status` in the agent's worktree. If the clash is there but the agent didn't hear about it, check that the
  hooks are installed (`lk doctor`) and that `lanekeeper` is on the PATH Claude Code or Cursor sees.
- A clash is announced to a session once. `lk clashes` lists every open one.
- Hooks stay silent when the daemon doesn't answer within 250 ms, for example while it builds the first index of a
  very large repository. The next edit catches up.

## A clash looks wrong

`lk explain <id>` shows the rule, both lanes, the symbols, files and lines involved, and why it fired. If it's a
false positive, `lk suppress <id>` hides that clash for good, and a `lanekeeper-ignore` comment on the line silences
a rule there. Please also report it: precision is the first thing we measure.

## Logs

- The daemon: `lk daemon logs` (rotated at 5 MB, three files kept).
- Hooks: `~/.lanekeeper/logs/hooks.log` (rotated at 1 MB). Hooks never print to the agent when something goes
  wrong; they log here.
