mirror of
https://github.com/anthropics/claude-code.git
synced 2026-02-01 22:48:05 +00:00
Compare commits
29 Commits
add-code-r
...
bcherny-pa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d0fcacc05 | ||
|
|
1fe9e369a7 | ||
|
|
b95fa46499 | ||
|
|
7a05427a4b | ||
|
|
84b97165dd | ||
|
|
07dcea57ee | ||
|
|
b42fd9928c | ||
|
|
128de2a75d | ||
|
|
b8a98a8df7 | ||
|
|
ba49573fe1 | ||
|
|
015808d89c | ||
|
|
ae411f8461 | ||
|
|
4310085cb5 | ||
|
|
c509821adc | ||
|
|
d9aa4cf649 | ||
|
|
b935da77db | ||
|
|
0c7d02b56f | ||
|
|
8b47e224a0 | ||
|
|
21bbc9f250 | ||
|
|
7add6863a0 | ||
|
|
5484a86d28 | ||
|
|
10e1d3fe77 | ||
|
|
4dc23d0275 | ||
|
|
8077cdc68c | ||
|
|
207b22de65 | ||
|
|
52fea66ba5 | ||
|
|
4e417747c5 | ||
|
|
1b41969c71 | ||
|
|
5d0e5cf15f |
@@ -68,6 +68,28 @@
|
||||
},
|
||||
"source": "./plugins/code-review",
|
||||
"category": "productivity"
|
||||
},
|
||||
{
|
||||
"name": "explanatory-output-style",
|
||||
"description": "Adds educational insights about implementation choices and codebase patterns (mimics the deprecated Explanatory output style)",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Dickson Tsai",
|
||||
"email": "dickson@anthropic.com"
|
||||
},
|
||||
"source": "./plugins/explanatory-output-style",
|
||||
"category": "learning"
|
||||
},
|
||||
{
|
||||
"name": "learning-output-style",
|
||||
"description": "Interactive learning mode that requests meaningful code contributions at decision points (mimics the unshipped Learning output style)",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Boris Cherny",
|
||||
"email": "boris@anthropic.com"
|
||||
},
|
||||
"source": "./plugins/learning-output-style",
|
||||
"category": "learning"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
40
.claude/commands/oncall-triage.md
Normal file
40
.claude/commands/oncall-triage.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
allowed-tools: Bash(gh issue list:*), Bash(gh issue view:*), Bash(gh issue edit:*), TodoWrite
|
||||
description: Triage GitHub issues and label critical ones for oncall
|
||||
---
|
||||
|
||||
You're an oncall triage assistant for GitHub issues. Your task is to identify critical issues that require immediate oncall attention and apply the "oncall" label.
|
||||
|
||||
Repository: anthropics/claude-code
|
||||
|
||||
Task overview:
|
||||
|
||||
1. First, get all open bugs updated in the last 3 days with at least 50 engagements:
|
||||
```bash
|
||||
gh issue list --repo anthropics/claude-code --state open --label bug --limit 1000 --json number,title,updatedAt,comments,reactions | jq -r '.[] | select((.updatedAt >= (now - 259200 | strftime("%Y-%m-%dT%H:%M:%SZ"))) and ((.comments | length) + ([.reactions[].content] | length) >= 50)) | "\(.number)"'
|
||||
```
|
||||
|
||||
2. Save the list of issue numbers and create a TODO list with ALL of them. This ensures you process every single one.
|
||||
|
||||
3. For each issue in your TODO list:
|
||||
- Use `gh issue view <number> --repo anthropics/claude-code --json title,body,labels,comments` to get full details
|
||||
- Read and understand the full issue content and comments to determine actual user impact
|
||||
- Evaluate: Is this truly blocking users from using Claude Code?
|
||||
- Consider: "crash", "stuck", "frozen", "hang", "unresponsive", "cannot use", "blocked", "broken"
|
||||
- Does it prevent core functionality? Can users work around it?
|
||||
- Be conservative - only flag issues that truly prevent users from getting work done
|
||||
|
||||
4. For issues that are truly blocking and don't already have the "oncall" label:
|
||||
- Use `gh issue edit <number> --repo anthropics/claude-code --add-label "oncall"`
|
||||
- Mark the issue as complete in your TODO list
|
||||
|
||||
5. After processing all issues, provide a summary:
|
||||
- List each issue number that received the "oncall" label
|
||||
- Include the issue title and brief reason why it qualified
|
||||
- If no issues qualified, state that clearly
|
||||
|
||||
Important:
|
||||
- Process ALL issues in your TODO list systematically
|
||||
- Don't post any comments to issues
|
||||
- Only add the "oncall" label, never remove it
|
||||
- Use individual `gh issue view` commands instead of bash for loops to avoid approval prompts
|
||||
2
.github/workflows/oncall-triage.yml
vendored
2
.github/workflows/oncall-triage.yml
vendored
@@ -54,7 +54,7 @@ jobs:
|
||||
- Use mcp__github__get_issue_comments to read all comments
|
||||
- Evaluate whether this issue needs the oncall label:
|
||||
a) Is it a bug? (has "bug" label or describes bug behavior)
|
||||
b) Does it have at least 5 engagements? (count comments + reactions)
|
||||
b) Does it have at least 50 engagements? (count comments + reactions)
|
||||
c) Is it truly blocking? Read and understand the full content to determine:
|
||||
- Does this prevent core functionality from working?
|
||||
- Can users work around it?
|
||||
|
||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
.DS_Store
|
||||
|
||||
83
CHANGELOG.md
83
CHANGELOG.md
@@ -1,5 +1,87 @@
|
||||
# Changelog
|
||||
|
||||
## 2.0.36
|
||||
|
||||
- Fixed: DISABLE_AUTOUPDATER environment variable now properly disables package manager update notifications
|
||||
- Fixed queued messages being incorrectly executed as bash commands
|
||||
- Fixed input being lost when typing while a queued message is processed
|
||||
|
||||
## 2.0.35
|
||||
|
||||
- Improve fuzzy search results when searching commands
|
||||
- Improved VS Code extension to respect `chat.fontSize` and `chat.fontFamily` settings throughout the entire UI, and apply font changes immediately without requiring reload
|
||||
- Added `CLAUDE_CODE_EXIT_AFTER_STOP_DELAY` environment variable to automatically exit SDK mode after a specified idle duration, useful for automated workflows and scripts
|
||||
- Migrated `ignorePatterns` from project config to deny permissions in the localSettings.
|
||||
- Fixed messages returning null `stop_reason` and `stop_sequence` values
|
||||
- Fixed menu navigation getting stuck on items with empty string or other falsy values (e.g., in the `/hooks` menu)
|
||||
|
||||
## 2.0.34
|
||||
|
||||
- VSCode Extension: Added setting to configure the initial permission mode for new conversations
|
||||
- Improved file path suggestion performance with native Rust-based fuzzy finder
|
||||
- Fixed infinite token refresh loop that caused MCP servers with OAuth (e.g., Slack) to hang during connection
|
||||
- Fixed memory crash when reading or writing large files (especially base64-encoded images)
|
||||
|
||||
## 2.0.33
|
||||
|
||||
- Native binary installs now launch quicker.
|
||||
- Fixed `claude doctor` incorrectly detecting Homebrew vs npm-global installations by properly resolving symlinks
|
||||
- Fixed `claude mcp serve` exposing tools with incompatible outputSchemas
|
||||
|
||||
## 2.0.32
|
||||
|
||||
- Un-deprecate output styles based on community feedback
|
||||
- Added `companyAnnouncements` setting for displaying announcements on startup
|
||||
- Fixed hook progress messages not updating correctly during PostToolUse hook execution
|
||||
|
||||
## 2.0.31
|
||||
|
||||
- Windows: native installation uses shift+tab as shortcut for mode switching, instead of alt+m
|
||||
- Vertex: add support for Web Search on supported models
|
||||
- VSCode: Adding the respectGitIgnore configuration to include .gitignored files in file searches (defaults to true)
|
||||
- Fixed a bug with subagents and MCP servers related to "Tool names must be unique" error
|
||||
- Fixed issue causing `/compact` to fail with `prompt_too_long` by making it respect existing compact boundaries
|
||||
- Fixed plugin uninstall not removing plugins
|
||||
|
||||
## 2.0.30
|
||||
|
||||
- Added helpful hint to run `security unlock-keychain` when encountering API key errors on macOS with locked keychain
|
||||
- Added `allowUnsandboxedCommands` sandbox setting to disable the dangerouslyDisableSandbox escape hatch at policy level
|
||||
- Added `disallowedTools` field to custom agent definitions for explicit tool blocking
|
||||
- Added prompt-based stop hooks
|
||||
- VSCode: Added respectGitIgnore configuration to include .gitignored files in file searches (defaults to true)
|
||||
- Enabled SSE MCP servers on native build
|
||||
- Deprecated output styles. Review options in `/output-style` and use --system-prompt-file, --system-prompt, --append-system-prompt, CLAUDE.md, or plugins instead
|
||||
- Removed support for custom ripgrep configuration, resolving an issue where Search returns no results and config discovery fails
|
||||
- Fixed Explore agent creating unwanted .md investigation files during codebase exploration
|
||||
- Fixed a bug where `/context` would sometimes fail with "max_tokens must be greater than thinking.budget_tokens" error message
|
||||
- Fixed `--mcp-config` flag to correctly override file-based MCP configurations
|
||||
- Fixed bug that saved session permissions to local settings
|
||||
- Fixed MCP tools not being available to sub-agents
|
||||
- Fixed hooks and plugins not executing when using --dangerously-skip-permissions flag
|
||||
- Fixed delay when navigating through typeahead suggestions with arrow keys
|
||||
- VSCode: Restored selection indicator in input footer showing current file or code selection status
|
||||
|
||||
## 2.0.28
|
||||
|
||||
- Plan mode: introduced new Plan subagent
|
||||
- Subagents: claude can now choose to resume subagents
|
||||
- Subagents: claude can dynamically choose the model used by its subagents
|
||||
- SDK: added --max-budget-usd flag
|
||||
- Discovery of custom slash commands, subagents, and output styles no longer respects .gitignore
|
||||
- Stop `/terminal-setup` from adding backslash to `Shift + Enter` in VS Code
|
||||
- Add branch and tag support for git-based plugins and marketplaces using fragment syntax (e.g., `owner/repo#branch`)
|
||||
- Fixed a bug where macOS permission prompts would show up upon initial launch when launching from home directory
|
||||
- Various other bug fixes
|
||||
|
||||
## 2.0.27
|
||||
|
||||
- New UI for permission prompts
|
||||
- Added current branch filtering and search to session resume screen for easier navigation
|
||||
- Fixed directory @-mention causing "No assistant message found" error
|
||||
- VSCode Extension: Add config setting to include .gitignored files in file searches
|
||||
- VSCode Extension: Bug fixes for unrelated 'Warmup' conversations, and configuration/settings occasionally being reset to defaults
|
||||
|
||||
## 2.0.25
|
||||
|
||||
- Removed legacy SDK entrypoint. Please migrate to @anthropic-ai/claude-agent-sdk for future SDK updates: https://docs.claude.com/en/docs/claude-code/sdk/migration-guide
|
||||
@@ -9,6 +91,7 @@
|
||||
- Fixed a bug where project-level skills were not loading when --setting-sources 'project' was specified
|
||||
- Claude Code Web: Support for Web -> CLI teleport
|
||||
- Sandbox: Releasing a sandbox mode for the BashTool on Linux & Mac
|
||||
- Bedrock: Display awsAuthRefresh output when auth is required
|
||||
|
||||
## 2.0.22
|
||||
|
||||
|
||||
10
plugins/code-review/.claude-plugin/plugin.json
Normal file
10
plugins/code-review/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "code-review",
|
||||
"description": "Automated code review for pull requests using multiple specialized agents with confidence-based scoring",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Boris Cherny",
|
||||
"email": "boris@anthropic.com"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ Examples of false positives, for steps 4 and 5:
|
||||
- Pre-existing issues
|
||||
- Something that looks like a bug but is not actually a bug
|
||||
- Pedantic nitpicks that a senior engineer wouldn't call out
|
||||
- Issues that a linter will catch (no need to run the linter to verify)
|
||||
- Issues that a linter, typechecker, or test runner will catch (eg. failing tests, lint errors, type errors). Do not run these to verify; assume that they will be run as part of CI.
|
||||
- General code quality issues (eg. lack of test coverage, general security issues), unless explicitly required in CLAUDE.md
|
||||
- Issues that are called out in CLAUDE.md, but explicitly silenced in the code (eg. due to a lint ignore comment)
|
||||
|
||||
@@ -62,9 +62,7 @@ Found 3 issues:
|
||||
|
||||
🤖 Generated with [Claude Code](https://claude.ai/code)
|
||||
|
||||
<sub>[ANT-ONLY]</sub>
|
||||
<sub>- If this code review was useful, please react with 👍. Otherwise, react with 👎.</sub>
|
||||
<sub>- To improve the quality of this code review, update the relevant CLAUDE.md with better guidance or post in #claude-code-feedback on Slack for advice.</sub>
|
||||
|
||||
---
|
||||
|
||||
|
||||
10
plugins/commit-commands/.claude-plugin/plugin.json
Normal file
10
plugins/commit-commands/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "commit-commands",
|
||||
"description": "Streamline your git workflow with simple commands for committing, pushing, and creating pull requests",
|
||||
"version": "1.0.0",
|
||||
"author": {
|
||||
"name": "Anthropic",
|
||||
"email": "support@anthropic.com"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "explanatory-output-style",
|
||||
"version": "1.0.0",
|
||||
"description": "Adds educational insights about implementation choices and codebase patterns (mimics the deprecated Explanatory output style)",
|
||||
"author": {
|
||||
"name": "Dickson Tsai",
|
||||
"email": "dickson@anthropic.com"
|
||||
}
|
||||
}
|
||||
72
plugins/explanatory-output-style/README.md
Normal file
72
plugins/explanatory-output-style/README.md
Normal file
@@ -0,0 +1,72 @@
|
||||
# Explanatory Output Style Plugin
|
||||
|
||||
This plugin recreates the deprecated Explanatory output style as a SessionStart
|
||||
hook.
|
||||
|
||||
WARNING: Do not install this plugin unless you are fine with incurring the token
|
||||
cost of this plugin's additional instructions and output.
|
||||
|
||||
## What it does
|
||||
|
||||
When enabled, this plugin automatically adds instructions at the start of each
|
||||
session that encourage Claude to:
|
||||
|
||||
1. Provide educational insights about implementation choices
|
||||
2. Explain codebase patterns and decisions
|
||||
3. Balance task completion with learning opportunities
|
||||
|
||||
## How it works
|
||||
|
||||
The plugin uses a SessionStart hook to inject additional context into every
|
||||
session. This context instructs Claude to provide brief educational explanations
|
||||
before and after writing code, formatted as:
|
||||
|
||||
```
|
||||
`★ Insight ─────────────────────────────────────`
|
||||
[2-3 key educational points]
|
||||
`─────────────────────────────────────────────────`
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Once installed, the plugin activates automatically at the start of every
|
||||
session. No additional configuration is needed.
|
||||
|
||||
The insights focus on:
|
||||
|
||||
- Specific implementation choices for your codebase
|
||||
- Patterns and conventions in your code
|
||||
- Trade-offs and design decisions
|
||||
- Codebase-specific details rather than general programming concepts
|
||||
|
||||
## Migration from Output Styles
|
||||
|
||||
This plugin replaces the deprecated "Explanatory" output style setting. If you
|
||||
previously used:
|
||||
|
||||
```json
|
||||
{
|
||||
"outputStyle": "Explanatory"
|
||||
}
|
||||
```
|
||||
|
||||
You can now achieve the same behavior by installing this plugin instead.
|
||||
|
||||
More generally, this SessionStart hook pattern is roughly equivalent to
|
||||
CLAUDE.md, but it is more flexible and allows for distribution through plugins.
|
||||
|
||||
Note: Output styles that involve tasks besides software development, are better
|
||||
expressed as
|
||||
[subagents](https://docs.claude.com/en/docs/claude-code/sub-agents), not as
|
||||
SessionStart hooks. Subagents change the system prompt while SessionStart hooks
|
||||
add to the default system prompt.
|
||||
|
||||
## Managing changes
|
||||
|
||||
- Disable the plugin - keep the code installed on your device
|
||||
- Uninstall the plugin - remove the code from your device
|
||||
- Update the plugin - create a local copy of this plugin to personalize this
|
||||
plugin
|
||||
- Hint: Ask Claude to read
|
||||
https://docs.claude.com/en/docs/claude-code/plugins.md and set it up for
|
||||
you!
|
||||
15
plugins/explanatory-output-style/hooks-handlers/session-start.sh
Executable file
15
plugins/explanatory-output-style/hooks-handlers/session-start.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Output the explanatory mode instructions as additionalContext
|
||||
# This mimics the deprecated Explanatory output style
|
||||
|
||||
cat << 'EOF'
|
||||
{
|
||||
"hookSpecificOutput": {
|
||||
"hookEventName": "SessionStart",
|
||||
"additionalContext": "You are in 'explanatory' output style mode, where you should provide educational insights about the codebase as you help with the user's task.\n\nYou should be clear and educational, providing helpful explanations while remaining focused on the task. Balance educational content with task completion. When providing insights, you may exceed typical length constraints, but remain focused and relevant.\n\n## Insights\nIn order to encourage learning, before and after writing code, always provide brief educational explanations about implementation choices using (with backticks):\n\"`★ Insight ─────────────────────────────────────`\n[2-3 key educational points]\n`─────────────────────────────────────────────────`\"\n\nThese insights should be included in the conversation, not in the codebase. You should generally focus on interesting insights that are specific to the codebase or the code you just wrote, rather than general programming concepts. Do not wait until the end to provide insights. Provide them as you write code."
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
15
plugins/explanatory-output-style/hooks/hooks.json
Normal file
15
plugins/explanatory-output-style/hooks/hooks.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"description": "Explanatory mode hook that adds educational insights instructions",
|
||||
"hooks": {
|
||||
"SessionStart": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
9
plugins/learning-output-style/.claude-plugin/plugin.json
Normal file
9
plugins/learning-output-style/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "learning-output-style",
|
||||
"version": "1.0.0",
|
||||
"description": "Interactive learning mode that requests meaningful code contributions at decision points (mimics the unshipped Learning output style)",
|
||||
"author": {
|
||||
"name": "Boris Cherny",
|
||||
"email": "boris@anthropic.com"
|
||||
}
|
||||
}
|
||||
93
plugins/learning-output-style/README.md
Normal file
93
plugins/learning-output-style/README.md
Normal file
@@ -0,0 +1,93 @@
|
||||
# Learning Style Plugin
|
||||
|
||||
This plugin combines the unshipped Learning output style with explanatory functionality as a SessionStart hook.
|
||||
|
||||
**Note:** This plugin differs from the original unshipped Learning output style by also incorporating all functionality from the [explanatory-output-style plugin](https://github.com/anthropics/claude-code/tree/main/plugins/explanatory-output-style), providing both interactive learning and educational insights.
|
||||
|
||||
WARNING: Do not install this plugin unless you are fine with incurring the token cost of this plugin's additional instructions and the interactive nature of learning mode.
|
||||
|
||||
## What it does
|
||||
|
||||
When enabled, this plugin automatically adds instructions at the start of each session that encourage Claude to:
|
||||
|
||||
1. **Learning Mode:** Engage you in active learning by requesting meaningful code contributions at decision points
|
||||
2. **Explanatory Mode:** Provide educational insights about implementation choices and codebase patterns
|
||||
|
||||
Instead of implementing everything automatically, Claude will:
|
||||
|
||||
1. Identify opportunities where you can write 5-10 lines of meaningful code
|
||||
2. Focus on business logic and design choices where your input truly matters
|
||||
3. Prepare the context and location for your contribution
|
||||
4. Explain trade-offs and guide your implementation
|
||||
5. Provide educational insights before and after writing code
|
||||
|
||||
## How it works
|
||||
|
||||
The plugin uses a SessionStart hook to inject additional context into every session. This context instructs Claude to adopt an interactive teaching approach where you actively participate in writing key parts of the code.
|
||||
|
||||
## When Claude requests contributions
|
||||
|
||||
Claude will ask you to write code for:
|
||||
- Business logic with multiple valid approaches
|
||||
- Error handling strategies
|
||||
- Algorithm implementation choices
|
||||
- Data structure decisions
|
||||
- User experience decisions
|
||||
- Design patterns and architecture choices
|
||||
|
||||
## When Claude won't request contributions
|
||||
|
||||
Claude will implement directly:
|
||||
- Boilerplate or repetitive code
|
||||
- Obvious implementations with no meaningful choices
|
||||
- Configuration or setup code
|
||||
- Simple CRUD operations
|
||||
|
||||
## Example interaction
|
||||
|
||||
**Claude:** I've set up the authentication middleware. The session timeout behavior is a security vs. UX trade-off - should sessions auto-extend on activity, or have a hard timeout?
|
||||
|
||||
In `auth/middleware.ts`, implement the `handleSessionTimeout()` function to define the timeout behavior.
|
||||
|
||||
Consider: auto-extending improves UX but may leave sessions open longer; hard timeouts are more secure but might frustrate active users.
|
||||
|
||||
**You:** [Write 5-10 lines implementing your preferred approach]
|
||||
|
||||
## Educational insights
|
||||
|
||||
In addition to interactive learning, Claude will provide educational insights about implementation choices using this format:
|
||||
|
||||
```
|
||||
`★ Insight ─────────────────────────────────────`
|
||||
[2-3 key educational points about the codebase or implementation]
|
||||
`─────────────────────────────────────────────────`
|
||||
```
|
||||
|
||||
These insights focus on:
|
||||
- Specific implementation choices for your codebase
|
||||
- Patterns and conventions in your code
|
||||
- Trade-offs and design decisions
|
||||
- Codebase-specific details rather than general programming concepts
|
||||
|
||||
## Usage
|
||||
|
||||
Once installed, the plugin activates automatically at the start of every session. No additional configuration is needed.
|
||||
|
||||
## Migration from Output Styles
|
||||
|
||||
This plugin combines the unshipped "Learning" output style with the deprecated "Explanatory" output style. It provides an interactive learning experience where you actively contribute code at meaningful decision points, while also receiving educational insights about implementation choices.
|
||||
|
||||
If you previously used the explanatory-output-style plugin, this learning plugin includes all of that functionality plus interactive learning features.
|
||||
|
||||
This SessionStart hook pattern is roughly equivalent to CLAUDE.md, but it is more flexible and allows for distribution through plugins.
|
||||
|
||||
## Managing changes
|
||||
|
||||
- Disable the plugin - keep the code installed on your device
|
||||
- Uninstall the plugin - remove the code from your device
|
||||
- Update the plugin - create a local copy of this plugin to personalize it
|
||||
- Hint: Ask Claude to read https://docs.claude.com/en/docs/claude-code/plugins.md and set it up for you!
|
||||
|
||||
## Philosophy
|
||||
|
||||
Learning by doing is more effective than passive observation. This plugin transforms your interaction with Claude from "watch and learn" to "build and understand," ensuring you develop practical skills through hands-on coding of meaningful logic.
|
||||
15
plugins/learning-output-style/hooks-handlers/session-start.sh
Executable file
15
plugins/learning-output-style/hooks-handlers/session-start.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Output the learning mode instructions as additionalContext
|
||||
# This combines the unshipped Learning output style with explanatory functionality
|
||||
|
||||
cat << 'EOF'
|
||||
{
|
||||
"hookSpecificOutput": {
|
||||
"hookEventName": "SessionStart",
|
||||
"additionalContext": "You are in 'learning' output style mode, which combines interactive learning with educational explanations. This mode differs from the original unshipped Learning output style by also incorporating explanatory functionality.\n\n## Learning Mode Philosophy\n\nInstead of implementing everything yourself, identify opportunities where the user can write 5-10 lines of meaningful code that shapes the solution. Focus on business logic, design choices, and implementation strategies where their input truly matters.\n\n## When to Request User Contributions\n\nRequest code contributions for:\n- Business logic with multiple valid approaches\n- Error handling strategies\n- Algorithm implementation choices\n- Data structure decisions\n- User experience decisions\n- Design patterns and architecture choices\n\n## How to Request Contributions\n\nBefore requesting code:\n1. Create the file with surrounding context\n2. Add function signature with clear parameters/return type\n3. Include comments explaining the purpose\n4. Mark the location with TODO or clear placeholder\n\nWhen requesting:\n- Explain what you've built and WHY this decision matters\n- Reference the exact file and prepared location\n- Describe trade-offs to consider, constraints, or approaches\n- Frame it as valuable input that shapes the feature, not busy work\n- Keep requests focused (5-10 lines of code)\n\n## Example Request Pattern\n\nContext: I've set up the authentication middleware. The session timeout behavior is a security vs. UX trade-off - should sessions auto-extend on activity, or have a hard timeout? This affects both security posture and user experience.\n\nRequest: In auth/middleware.ts, implement the handleSessionTimeout() function to define the timeout behavior.\n\nGuidance: Consider: auto-extending improves UX but may leave sessions open longer; hard timeouts are more secure but might frustrate active users.\n\n## Balance\n\nDon't request contributions for:\n- Boilerplate or repetitive code\n- Obvious implementations with no meaningful choices\n- Configuration or setup code\n- Simple CRUD operations\n\nDo request contributions when:\n- There are meaningful trade-offs to consider\n- The decision shapes the feature's behavior\n- Multiple valid approaches exist\n- The user's domain knowledge would improve the solution\n\n## Explanatory Mode\n\nAdditionally, provide educational insights about the codebase as you help with tasks. Be clear and educational, providing helpful explanations while remaining focused on the task. Balance educational content with task completion.\n\n### Insights\nBefore and after writing code, provide brief educational explanations about implementation choices using:\n\n\"`★ Insight ─────────────────────────────────────`\n[2-3 key educational points]\n`─────────────────────────────────────────────────`\"\n\nThese insights should be included in the conversation, not in the codebase. Focus on interesting insights specific to the codebase or the code you just wrote, rather than general programming concepts. Provide insights as you write code, not just at the end."
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
exit 0
|
||||
15
plugins/learning-output-style/hooks/hooks.json
Normal file
15
plugins/learning-output-style/hooks/hooks.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"description": "Learning mode hook that adds interactive learning instructions",
|
||||
"hooks": {
|
||||
"SessionStart": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "${CLAUDE_PLUGIN_ROOT}/hooks-handlers/session-start.sh"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user