What this setup covers#
The setup uses four tools:
| Capability | Purpose | Best used for |
|---|---|---|
| RTK Copilot hook | Reduce output from supported shell commands | Commands RTK recognizes; prefix manually when needed |
| CodeGraph tools | Symbol-level and flow-level code understanding | Non-trivial code navigation and impact analysis |
| Caveman skill | Shorter agent replies | Tasks where concise prose helps |
| Ponytail coding rules | Prefer the smallest complete, tested change | Implementing and reviewing code |
Type /caveman to get shorter replies. Type /caveman off or say stop caveman to return to normal prose. The separate Caveman proxy compresses input; this guide covers only the skill. In VS Code Copilot, Ponytail loads from repository instructions rather than a slash-command plugin.
Prerequisites#
Check that these are available:
# VS Code and Copilot Chat installed
code --version
# Node.js and npm, required for the Caveman skill installer
node --version
npm --version
# Git available (for cloning repos)
git --versionSupported operating systems#
These instructions cover:
- Linux (Debian/Ubuntu/Fedora tested)
- macOS (Homebrew recommended)
- Windows (WSL2 preferred; native Windows requires manual PATH configuration)
1. Install rtk#
RTK filters output from commands it supports. Its Copilot hook can rewrite those shell commands automatically.
Installation#
Install RTK using its official instructions:
# macOS
brew install rtk
# Windows
winget install rtk-ai.rtk
# Linux
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | shOn Linux, the installer puts RTK in ~/.local/bin. Add that directory to your PATH if needed:
export PATH="$HOME/.local/bin:$PATH"On Windows, winget configures the executable path during installation.
Connect RTK to Copilot#
Install the Copilot hook, then restart VS Code:
rtk init -g --copilotVerify installation#
rtk --version
rtk gain
rtk discoverUsage habit#
To filter a command yourself, prefix it with rtk:
rtk git status
rtk git log -10
rtk npm test
rtk docker psThe hook handles supported shell commands automatically. See the RTK command reference for filters and options.
2. Install and initialize CodeGraph#
CodeGraph gives Copilot symbol, call-path, and impact queries without broad text searches.
Installation#
Install the CLI and configure its MCP server using the maintainer’s instructions. Package names vary, so use the source your organization supports. Before continuing, confirm that CodeGraph tools appear in Copilot Chat.
If your distribution provides the codegraph CLI, verify it:
codegraph --helpInitialize in your repository#
From your project root, run:
codegraph init -iThe command creates a .codegraph/ directory and indexes the repository for structural queries.
Keep indexes fresh#
Rebuild the index after major code changes:
codegraph indexOn Linux, watch -n 300 'codegraph index' can rebuild the index every five minutes. Many systems do not include watch, and the command is not portable to macOS or Windows.
3. Install the Caveman skill (concise response style)#
The official Caveman skill asks supported agents to answer briefly while leaving code, commands, and error text unchanged. It reduces output tokens, not command output or other context sent to the model. Caveman’s separate proxy compresses input.
Install it globally with the skills CLI:
npx skills add JuliusBrussee/caveman -gInvoke and stop the style#
In Copilot Chat, type /caveman to start. Type /caveman off or say stop caveman to return to normal prose. The Caveman repository lists supported agents; its install matrix has agent-specific steps.
4. What Ponytail adds#
Ponytail asks the agent to make the smallest complete change. It first reads the affected code and traces its flow, then reuses project patterns and checks for a standard-library or platform option before adding a dependency. Non-trivial logic gets a focused test.
It keeps validation, error handling, security, and accessibility. At the end, Ponytail asks the agent to say what it skipped or did not check and note any risks. See ponytail.dev and the Ponytail repository for its design and benchmarks.
5. Install Ponytail for Copilot Chat#
VS Code Copilot Chat loads Ponytail from an instruction file. Copy the official Copilot instructions to .github/copilot-instructions.md in your repository. If the file already exists, merge the Ponytail rules into it rather than replacing your current instructions.
Copilot applies these rules automatically. This integration does not add Ponytail’s /ponytail modes or commands such as /ponytail-review. Those require a host that supports Ponytail’s plugin or skill commands. The install matrix lists the current options.
Keep the upstream rules in the file, then add project-specific RTK and CodeGraph conventions:
## Repository-specific tooling
### RTK
- Prefix supported shell commands with `rtk` when the hook does not rewrite them.
### CodeGraph
- Use CodeGraph for symbol and call-path queries.
- Run `codegraph index` after major refactors.Commit the combined file so teammates get the same instructions.
6. Validation checklist#
Run these checks to confirm the tools and repository instructions are available:
# Terminal proxy
rtk gain
# Structural tooling
codegraph --help
test -d .codegraph && echo "CodeGraph initialized" || echo "CodeGraph: not initialized"
# Ponytail rules for this repository
test -f .github/copilot-instructions.md && echo "Ponytail Copilot rules: present"Interactive validation#
Try a few requests in Copilot Chat:
| Test | Expected outcome |
|---|---|
/caveman then request a refactor summary | Concise response that preserves code and technical details |
| Ask Copilot to implement a small feature | Reuses project patterns, keeps the change small, tests non-trivial logic, and reports risks |
/caveman off then ask a follow-up | Normal prose resumes |
| Request symbol impact analysis | CodeGraph tools answer using the initialized index |
Recommended workflows#
| Scenario | Recommended configuration |
|---|---|
| Rapid debugging | /caveman + rtk commands + CodeGraph symbol search |
| Implementing a feature | Ponytail’s repository rules + CodeGraph for relevant symbols and callers |
| Code review preparation | Ask Copilot Chat for a review; Ponytail rules are contextual, but /ponytail-review is not available in this adapter |
| Detailed explanations | Ask directly for assumptions, trade-offs, and risks; Ponytail’s Copilot adapter does not expose verbosity modes |
Troubleshooting#
Caveman skill not appearing in Copilot Chat#
Install the upstream skill with npx skills add JuliusBrussee/caveman -g, then open Copilot Chat and check the slash-command menu. See the Caveman install matrix for agent-specific options.
Ponytail rules not applying in Copilot Chat#
Copilot reads Ponytail from .github/copilot-instructions.md; it does not expose a /ponytail command. Check that the active repository has this file and that it includes the official Ponytail rules.
For other agents or Ponytail commands, check the install matrix.
RTK hook not filtering commands#
Reinstall the Copilot hook with rtk init -g --copilot, then restart VS Code. Run rtk git status to check that it works, or rtk gain --history to review recent commands and savings.
CodeGraph index stale#
After significant refactoring, rebuild the graph:
codegraph index --forceQuick reference#
# Terminal filtering
rtk git status # Normal command with filtered output
rtk gain --history # Review recent commands and savings
# CodeGraph operations
codegraph init -i # Initial setup
codegraph index # Rebuild index
codegraph --help # Check commands supported by your distribution
# Copilot response-style tools
/caveman # Activate concise response style
/caveman off # Return to normal prose
# Ponytail rules load from .github/copilot-instructions.md