Skip to content

feat(plugins): add claudecode plugin #13168

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

clearclown
Copy link

This pull request introduces a new plugin for Claude Code CLI (claude), the agentic coding assistant from Anthropic.

This plugin aims to provide a first-class experience for claude users within the Oh My Zsh ecosystem, significantly improving productivity and workflow efficiency through powerful autocompletions, convenient aliases, and advanced helper functions.

The design is heavily inspired by other robust plugins like gh, particularly in its use of a caching mechanism for completions to ensure minimal impact on shell startup time.

Standards checklist:

  • The PR title is descriptive.
  • The PR doesn't replicate another PR which is already open.
  • I have read the contribution guide and followed all the instructions.
  • The code follows the code style guide detailed in the wiki.
  • The code is mine or it's from somewhere with an MIT-compatible license.
  • The code is efficient, to the best of my ability, and does not waste computer resources.
  • The code is stable and I have tested it myself, to the best of my abilities.
  • If the code introduces new aliases, I provide a valid use case for all plugin users down below.

Changes:

This PR adds the claudecode plugin, which includes the following files:

  • plugins/claudecode/claudecode.plugin.zsh: The main plugin file.
  • plugins/claudecode/README.md: A comprehensive README with installation and usage instructions.

Key features include:

  • Comprehensive Autocompletion:

    • Completes all CLI commands (update, mcp), flags (--model, --add-dir), and their short forms (-p, -c).
    • Provides dynamic suggestions for values like model names, output formats, and even recently used session IDs.
    • Includes a robust caching system that regenerates completions only when the claude CLI is updated, ensuring a fast shell startup.
  • Convenient Aliases:

    • Provides short aliases for common commands (cc, ccp, ccc) to speed up daily use.
    • Includes aliases for development workflows like Git operations (cccommit, ccpr) and model selection (ccsonnet, ccopus).
  • Advanced Helper Functions:

    • claude-quick: Offers quick access to common tasks like explain, debug, refactor, and test.
    • claude-git: Deeply integrates claude with Git workflows, allowing users to generate commit messages, review diffs, and get help with merge conflicts.
    • claude-project: Provides high-level project analysis capabilities, such as dependency checks, security audits, and architecture reviews.
    • claude-pipe-enhanced: A powerful pipe utility that can preprocess input based on its format (e.g., code, log, error).

Other comments:

As AI-powered coding assistants become more integrated into development workflows, providing seamless shell integration is crucial. This plugin makes using Claude Code in the terminal significantly more powerful and intuitive.

I have included a detailed README.md and a test_plugin.zsh script (though not part of the PR) to ensure quality and ease of use.

For reference, the official Claude Code documentation can be found here: https://docs.anthropic.com/en/docs/claude-code

I'm open to any feedback and happy to make adjustments as needed. Thank you for considering this contribution

…liases

- Introduced a new plugin for the Claude Code CLI, providing autocompletion for commands and flags.
- Added useful aliases for quick access to common commands and functionalities.
- Implemented helper functions for session management, project analysis, and enhanced piping capabilities.
- Included a README file detailing features, installation instructions, and usage examples.
…lugin

- Introduced a new examples.zsh file demonstrating various usage scenarios for the ClaudeCode Oh My Zsh plugin, including basic commands, model selection, Git integration, and advanced workflows.
- Added a test_plugin.zsh script to validate the functionality of the plugin, including alias and function definitions, as well as specific command tests.
- Enhanced the testing framework to ensure robust functionality and user experience.
@ohmyzsh ohmyzsh bot added Area: plugin Issue or PR related to a plugin Topic: alias Pull Request or issue regarding aliases Type: documentation Documentation issue or Pull Request New: plugin Request for a plugin or Pull Request that adds one labels Jun 15, 2025
@ohmyzsh ohmyzsh bot added this to Main project Jun 15, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Main project Jun 15, 2025
- Added new actions for `claude-quick` including 'optimize', 'refactor', 'test', and 'docs'.
- Removed redundant code from the `_claude_quick` function to streamline the completion process.
- Cleaned up the README by removing outdated usage examples for `claude-quick` to reflect the latest features.
@alexrah
Copy link

alexrah commented Jul 4, 2025

Since I wanted to try this plugin ASAP, I forked your fork, stripped down everything and kept only the plugin which can be installed as standalone inside ohmyzsh/plugins folder.
Of course this is only a temp solution in the meantime while the pull requests get eventually merged.
if someone is interested the repo is https://github.com/alexrah/zsh-claudecode-plugin

### Aliases

#### Basic Aliases
- `cc` → `claude` (short alias for quick access)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will shadow /usr/bin/cc for many people, which is likely to have undesired side effects for people using the C compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: plugin Issue or PR related to a plugin New: plugin Request for a plugin or Pull Request that adds one Topic: alias Pull Request or issue regarding aliases Type: documentation Documentation issue or Pull Request
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

3 participants