This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This repository uses Nix flakes for development environment management with direnv integration. The development environment is automatically activated via direnv.
gh- GitHub CLI for repository operationsgit- Version control operations
- At the start of each new session, ask the user if they wish to log this session to GitHub. Also, infer a GitHub issue title from the user's initial prompt and confirm the GitHub issue title with them.
- Create a GitHub issue using
gh issue create --title "<user's goal>" --body "" - Note the issue number for reference throughout the session
When a user prompt represents a new goal (distinct from the current tracked issue):
- Recognize the new goal and infer an appropriate GitHub issue title
- Ask the user if they want to create a new issue for this goal
- If yes, create a new GitHub issue and switch tracking to the new issue number
- Examples of new goals: "let's prove that...", "now implement...", "create a new feature for...", "fix the bug in..."
- Before answering any user prompt, first save the previous prompt and your responses to a markdown file in folder
logsnamed with the current timestamp (format:YYYY-MM-DD-HHMMSS.md) - Log the conversation in this format (detect actual GitHub username using
gh api user --jq .login):(@username) User's prompt/question (claude) Your complete response including tool usage and output - Create a GitHub issue comment from the log file using
gh issue comment <issue-number> --body-file <timestamp-file.md> - Then proceed to answer the current user prompt
When a goal has been completed:
- Suggest a commit title and message to the user
- Include a line in the commit message to link to the relevant issue: "Closes #"
- If the user accepts the proposed commit:
- Stage files with
git add - Commit with the approved message
- Push to GitHub using
git push origin "$(git branch --show-current)"
- Stage files with
gh issue create --title "Goal Title" --body ""- Create tracking issuedate +"%Y-%m-%d-%H%M%S"- Generate timestamp for log filesgh api user --jq .login- Get current GitHub usernamegh issue comment <issue-number> --body-file <timestamp-file.md>- Add conversation log as issue commentgit add- Stage files for commitgit commit -m "message"- Commit with messagegit push origin "$(git branch --show-current)"- Push to current branch