Installation
Install the Coding Friend CLI and plugin for Claude Code or Codex CLI.
Prerequisites
- Node.js 20+ installed
- Claude Code or Codex CLI installed
- curl and jq for statusline rate limit display
- (Optional) GitHub CLI for PR-related skills:
brew install gh && gh auth login
Install
# 1. Install the CLI globally
npm i -g coding-friend-cli
# 2a. Install the plugin into Claude Code
cf install
# 2b. Or install for Codex CLI
cf install --agent codex
cf name conflict? If another tool (e.g. Cloudflare's cf) already uses
that binary name, you can use cdf instead — it's an alias pointing to the
same CLI: bash cdf install cdf init cdf memory status # etc.
Claude Code users who prefer to install without the CLI (you will lose almost 50% the power of CF, see CLI Requirements for more) can add the marketplace and install the plugin manually:
claude plugin marketplace add dinhanhthi/coding-friend
claude plugin install coding-friend@coding-friend-marketplace
# Or inside Claude Code session:
/plugin marketplace add dinhanhthi/coding-friend
/plugin install coding-friend@coding-friend-marketplace
Then continue from step 3 below (skip cf install).
Codex CLI users: cf install --agent codex registers the marketplace and
deploys generated agents. Codex CLI 0.130.0 still requires one manual plugin
install step: open codex, run /plugins, then install coding-friend. See
the Codex CLI guide for details.
# 3a. Initialize your workspace for Claude Code
cf init
# 3b. Or initialize for Codex CLI
cf init --agent codex --trust-project
# 4. Restart your host session to load the plugin.
# Claude: type "/cf-plan". Codex: type "$cf-plan".
# 5. Verify
cf status
# 6. Change configs
cf config
Linux users: You may need sudo for global installs (e.g., sudo npm i -g coding-friend-cli), or configure
npm
to use a directory you own.
Update
Just run cf update to update the plugin and CLI (Sometimes, you need to run cf update twice to make it work). In case of any issues, you can try manually:
- Plugin — auto-update is enabled already. If it wasn't (e.g., file permission issues), enable manually via
/plugin→ Marketplace →coding-friend-marketplace→ auto-update. - CLI: Run
npm update -g coding-friend-cli(npm) oryarn global upgrade coding-friend-cli(yarn) orpnpm update -g coding-friend-cli(pnpm).
Custom config directory (CLAUDE_CONFIG_DIR)
Claude Code lets you override its global config directory (default ~/.claude) with the CLAUDE_CONFIG_DIR environment variable — useful for running multiple accounts side by side. Coding Friend honors it everywhere: the cf CLI, the plugin hooks, and skill scripts all read/write under the directory you set instead of ~/.claude.
# Everything in this session uses ~/.claude-work instead of ~/.claude
CLAUDE_CONFIG_DIR=~/.claude-work claude
Inside that session you don't have to do anything extra — hooks, skills, and any cf command you run all inherit the variable automatically.
What moves with CLAUDE_CONFIG_DIR, and what does not:
- Relocated —
settings.json,plugins/(the Coding Friend plugin cache and marketplace registration),projects/(session history), and.credentials.jsonall live under the custom directory. - Not relocated —
~/.claude.json(your account/MCP file) stays at your home directory, and Coding Friend's own~/.coding-friend/directory (config, memory) is never moved. Project-local.claude/directories are also untouched.
Each config directory is a separate install
A custom CLAUDE_CONFIG_DIR starts empty — the marketplace and plugin you already installed in the default ~/.claude do not carry over. Treat each config directory like a fresh machine: run the install steps once, with the variable set.
# One-time setup for the new config directory
CLAUDE_CONFIG_DIR=~/.claude-work cf install # register marketplace + install plugin
CLAUDE_CONFIG_DIR=~/.claude-work cf statusline # (optional) set up the statusline
# Then launch sessions with the same variable
CLAUDE_CONFIG_DIR=~/.claude-work claude
Only the steps that write into .claude/ need repeating per config directory — cf install (plugin + marketplace) and cf statusline (writes to <dir>/settings.json). Project-level setup is not tied to the config directory and does not need redoing: cf init, cf memory init, and your global ~/.coding-friend/config.json are shared across every config directory.
Always use the same CLAUDE_CONFIG_DIR for install and for launching
Claude Code. If you install with the variable set but start claude without
it (or vice versa), the session looks in a different directory and won't see
the plugin. Use an export or alias (below) to avoid the mismatch.
Running cf outside a Claude Code session? Commands like cf install,
cf update, cf memory, and cf dev read the variable fresh each time, so
set it in your shell to keep them aligned with the session you launch — e.g.
add export CLAUDE_CONFIG_DIR="$HOME/.claude-work" to your ~/.zshrc, or use
per-command aliases.
Example aliases:
alias claude-work='CLAUDE_CONFIG_DIR=$HOME/.claude-work claude'
alias cf-work='CLAUDE_CONFIG_DIR=$HOME/.claude-work cf'
cf dev honors it too — just make sure cf dev and claude run with the
same CLAUDE_CONFIG_DIR so the dev plugin lands where the session looks for it.
Next Steps
Read the Quick Start guide to learn the core workflow.