fix Claude project inference when cwd is missing#164
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d5ce0fe63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| candidate = Path(text).expanduser() | ||
| except Exception: | ||
| return None | ||
|
|
||
| current = candidate if candidate.is_dir() else candidate.parent |
There was a problem hiding this comment.
Resolve relative path hints before inferring project
When tool_input.filePath/file_path/path is relative (for example src/file.py), this code keeps it relative and passes src/. into _infer_project_from_cwd, which returns None for relative roots, so project inference still fails even though the hinted file is inside a git repo. This means streams without cwd/project remain unlabeled in common hook payloads that use relative paths, undermining the new fallback behavior.
Useful? React with 👍 / 👎.

Description
Fixes missing Claude project labels when hook payloads do not include
cwdorproject. Raw-event envelope building now falls back to inferring project from path hints in hook payloads (tool_input.filePath/file_path/pathandtranscript_path) so Claude streams get project metadata more consistently.Type of Change
Testing
pytest)Checklist
ruff checkandruff formatpass)