Generate Linear Worklog
$ npx claude-code-templates@latest --command="utilities/generate-linear-worklog" --yesRequires Claude Code. The command adds this command to your project's .claudedirectory — nothing runs on ToolZip's servers.
What's inside this command
Component source
Generate Linear Work Log
You are tasked with generating a technical work log comment for a Linear issue based on recent git commits.
Instructions
- Check Linear MCP Availability
- If Linear MCP is not installed, inform the user to install it and provide installation instructions
- Do not proceed with work log generation if Linear MCP is unavailable
- Check for Existing Work Log
- Look for comments with today's date in the format "## Work Completed [TODAY'S DATE]"
- If found, note the existing content to append/update rather than duplicate
- Extract Git Information
- Get recent commits on the current branch (last 10 commits)
- Get commits that are on the current branch but not on main branch
- For each relevant commit, get detailed information including file changes and line counts
- Focus on commits since the last work log update (if any exists)
- Generate Work Log Content
- Focus on factual implementation details
- Structure the log with date, branch, and commit information
- Include quantitative metrics (file counts, line counts) where relevant
- Avoid subjective commentary or promotional language
- Handle Existing Work Log
- If work log exists for today: Replace the existing comment with updated content including all today's work
- Ensure chronological order of commits
- Include both previous and new work completed today
- Format Structure
## Work Completed [TODAY'S DATE]
### Branch: [current-branch-name]
**Commit [short-hash]: [Commit Title]**
- [Technical detail 1]
- [Technical detail 2]
- [Line count] lines of code across [file count] files
[Additional commits in chronological order]
### [Status Section]
- [Current infrastructure/testing status]
- [What is now available/ready]
- Post to Linear
- Post the formatted work log to the specified Linear issue
- If updating, replace the entire existing work log comment
- Confirm successful posting
Git Commands to Use
git branch --show-current- Get current branchgit log --oneline -10- Get recent commitsgit log main..HEAD --oneline- Get branch-specific commitsgit show --stat [commit-hash]- Get detailed commit infogit log --since="[today's date]" --pretty=format:"%h %ad %s" --date=short- Get today's commits
Content Guidelines
- Include commit hashes and descriptive titles
- Provide specific technical implementations
- Include file counts and line counts for significant changes
- Maintain consistent formatting
- Focus on technical accomplishments
- Include current status summary
- No emojis or special characters
Error Handling
- Check if Linear MCP client is available before proceeding
- If Linear MCP is not available, display installation instructions:
Linear MCP client is not installed. To install it:
1. Install the Linear MCP server:
npm install -g @modelcontextprotocol/server-linear
2. Add Linear MCP to your Claude configuration:
Add the following to your Claude MCP settings:
{
"mcpServers": {
"linear": {
"command": "npx",
"args": ["@modelcontextprotocol/server-linear"],
"env": {
"LINEAR_API_KEY": "your_linear_api_key_here"
}
}
}
}
3. Restart Claude Code
4. Get your Linear API key from: https://linear.app/settings/api
- Validate that the Linear ticket ID exists
- Handle cases where no recent commits are found
- Provide clear error messages for git operation failures
- Confirm successful comment posting
Example Usage
When invoked with /generate-linear-worklog BLA2-2, the command should:
- Analyze git commits on the current branch
- Generate a structured work log
- Post the comment to Linear issue BLA2-2
- Confirm successful posting
Related Claude Code Commands
Ultra Think
Multi-framework structured analysis: surfaces hidden assumptions, generates competing solutions, stress-tests each with adversarial reasoning, and delivers confidence-calibrated recommendations
Code Review
Comprehensive code quality review with security, performance, and architecture analysis
Refactor Code
A ready-to-install Claude Code component.
Explain Code
A ready-to-install Claude Code component.
All Tools
A ready-to-install Claude Code component.
Debug Error
A ready-to-install Claude Code component.
Catalog data and component content are sourced from the open-source davila7/claude-code-templates project (MIT license). ToolZip curates the listing and writes original descriptions; every component links back to its original source. Claude Code is a product of Anthropic. ToolZip is an independent catalog and is not affiliated with or endorsed by Anthropic.