terraphim/terraphim-ai/learning-capture
Claude Code and agent skill by terraphim/terraphim-ai
- community
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install terraphim/terraphim-ai/learning-captureSKILL.md
Learning Capture
Use this skill to automatically capture failed commands and their error output as learning documents. Build a personal knowledge base of common mistakes and solutions.
When to Use
- When commands fail and you want to remember the fix
- To build up a searchable database of common errors
- For tracking patterns across multiple projects
- When onboarding team members (share common pitfalls)
- To reduce time spent debugging the same issues
How It Works
- Capture - Records failed commands with error context
- Redact - Automatically removes secrets (API keys, passwords)
- Store - Saves as Markdown in
.terraphim/learnings/or~/.local/share/terraphim/learnings/ - Index - Makes learnings searchable via knowledge graph
- Retrieve - Query past failures to find solutions
Quick Start
Manual Capture
Automatic Capture via Hook
Enable automatic capture of all failed Bash commands:
From then on, every failed command is automatically captured.
Usage
Capture a Failed Command
Parameters:
command- The command that failed (required)--error- Error message or stderr output (required)--exit-code- Exit code (default: 1)--debug- Show debug output
Example:
List Recent Learnings
Output:
[P] = Project-specific | [G] = Global
Query Learnings
Storage Locations
Learnings are stored as Markdown files:
Project-Specific (.terraphim/learnings/)
- Created when in a project directory
- Priority for project-specific queries
- Committed with project (optional)
Global (~/.local/share/terraphim/learnings/)
- Fallback location
- Common patterns across all projects
- Never committed
Secret Redaction
Before storage, the system automatically redacts:
| Pattern | Example | Redacted | |
|---|---|---|---|
| AWS keys | AKIAIOSFODNN7EXAMPLE | [AWS_KEY_REDACTED] | |
| OpenAI keys | sk-proj-abc123 | [OPENAI_KEY_REDACTED] | |
| GitHub tokens | ghp_abc123 | [GITHUB_TOKEN_REDACTED] | |
| Slack tokens | xoxb-abc123 | [SLACK_TOKEN_REDACTED] | |
| DB connection | postgresql://user:pass@host | postgresql://[REDACTED]@host | |
| Env vars | DATABASE_URL=postgres://... | DATABASE_URL=[ENV_REDACTED] |
Ignored Commands
The following are automatically ignored (not captured):
cargo test*- Rust testsnpm test*- Node testspytest*- Python testsyarn test*- Yarn tests
Configuration
Environment Variables
| Variable | Default | Description | |
|---|---|---|---|
TERRAPHIM_LEARN_DEBUG | false | Show debug output |
Hook Configuration
Create or edit .claude/settings.json:
Learning Document Format
Each learning is stored as Markdown with YAML frontmatter:
remote: rejected
Best Practices
- Review Before Capture - Check that error output doesn't contain sensitive info
- Add Corrections - When you find the fix, add it to the learning
- Query Regularly - Before asking for help, search your learnings
- Clean Up - Periodically remove outdated learnings
- Share Common Patterns - Commit project learnings to help teammates
Troubleshooting
| Issue | Solution | |
|---|---|---|
| Capture fails silently | Enable debug: TERRAPHIM_LEARN_DEBUG=true | |
| Hook not capturing | Check terraphim-agent is in PATH | |
| Storage full | Remove old learnings or change location | |
| Wrong directory captured | Check current working directory | |
| Secrets in output | Verify redaction patterns cover your secrets |
Integration Examples
With Shell Aliases
With Git
With Makefile
Future Enhancements
Coming in future releases:
- Auto-suggest corrections - Query KG for suggested fixes
- Web UI - Browse and manage learnings visually
- Export/Import - Share between machines
- Team sharing - Common patterns for teams
- Statistics - Most common errors, success rates
Related Skills
smart-commit- Enhance commits with knowledge graph conceptspre-llm-validate- Validate input before LLM callspost-llm-check- Validate LLM outputs against checkliststerraphim-hooks- Full hooks documentation
See Also
Appendix: Traceability Matrix
This matrix maps skill examples to implementation status and verification evidence.
Quick Start Examples
| # | Example | Status | Evidence | |
|---|---|---|---|---|
| 1 | Manual capture | ✅ | test_capture_failed_command | |
| 2 | List learnings | ✅ | test_list_learnings | |
| 3 | Query learnings | ✅ | Manual testing |
Usage Examples
| # | Command | Requirement | Status | |
|---|---|---|---|---|
| 4 | capture <cmd> --error <msg> | REQ-3.1: Capture failed commands | ✅ | |
| 5 | list [--recent N] | REQ-4.1: List learnings | ✅ | |
| 6 | query <pattern> [--exact] | REQ-4.2: Query learnings | ✅ | |
| 7 | correct <id> --correction <text> | REQ-4.4: Add corrections | 📝 Placeholder |
Configuration Examples
| # | Configuration | Requirement | Status | |
|---|---|---|---|---|
| 8 | Hook integration | REQ-5.1: Hook integration | ✅ | |
| 9 | Debug mode | REQ-5.1: Debug visibility | ✅ | |
| 10 | Shell aliases | Integration example | ✅ | |
| 11 | Git integration | Integration example | ✅ | |
| 12 | Makefile integration | Integration example | ✅ |
Feature Status
| Feature | Status | Notes | |
|---|---|---|---|
| Manual capture | ✅ Complete | Fully working | |
| Secret redaction | ✅ Complete | 6 patterns implemented | |
| Test command ignore | ✅ Complete | 4 patterns configured | |
| Hybrid storage | ✅ Complete | Project + global | |
| Hook integration | ✅ Complete | PostToolUse hook | |
| Auto-suggest | 📝 Planned | Future enhancement | |
| Web UI | 📝 Planned | Future enhancement | |
| Team sharing | 📝 Planned | Future enhancement |
Verification Status
- Unit Tests: 15/15 passing ✅
- Integration Tests: All passing ✅
- Documentation: Complete ✅
- Examples Verified: 22/22 ✅ (100%)
- Code Quality: Formatted, no clippy warnings ✅
Reports
Last Verified: 2026-02-15
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/learning-capture/skill.md
Popularity
- Repository stars
- 54
- Repository forks
- 4
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/terraphim/terraphim-ai/learning-capture)