feat: nudge session-start toward on-demand skill search - #103
Merged
Conversation
Claude Code auto-lists every enabled skill's name+description every session regardless of relevance, which compounds token cost as the skill count grows. agentflare's skill_search/skill_load MCP tools (already scan skill dirs independent of Claude Code's own listing) are the intended replacement for that always-on list, but nothing told the model to actually reach for them. Add one line to session_start's output pointing at skill_search then skill_load before assuming a relevant skill doesn't exist. Extracted the message-building into session_start_message() (mirroring mcp_server.rs's _sync helper pattern) so the nudge text has direct test coverage instead of only an indirect "doesn't panic" check. Note: Claude Code's own `--disable-slash-commands` flag suppresses the always-on skill listing while MCP tools stay fully functional (verified empirically) — but it's a launch-time CLI flag with no persistent settings.json/env-var equivalent found, so making it the default for every session needs a shell-level wrapper around the `claude` binary, outside this repo's scope.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe ChangesSession-start message refactor
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
4 tasks
getappz
added a commit
that referenced
this pull request
Jul 8, 2026
Two independent additions to the init component pattern, both aimed at replacing Claude Code's always-on skill-description listing with agentflare's on-demand skill_search/skill_load (already merged: #102 exposes them as MCP tools, #103 nudges the model toward them): - agentflare-mcp: registers agentflare's own MCP server (skill_search/ skill_load) with claude-code (native `claude mcp add`), cline, continue, and opencode — same 4 hosts + same merge_json/ merge_opencode_mcp/write_if_absent helpers the engram component already uses for its own manual-registration branches. Other hosts report satisfied until their MCP config format is verified here. - skill-overrides-sync: Claude Code only (other agents have no equivalent per-skill mechanism). Scans every skill agentflare's registry knows about (crates/skill-registry gets a new Registry::list_all_names(), since search() requires a query and there was no "list everything" path) and sets settings.json:skillOverrides["<name>"] = "name-only" for any skill missing an entry — Claude Code's own mechanism for listing a skill's name without its description (verified against the live settings schema, not assumed). Never touches a skill the user already configured differently. Not consent-gated, so it also re-syncs on every session-start as new skills appear, not just during `init`. crates/skill-registry's `skills_db_path()` was duplicated between mcp_server.rs and the new component; moved to paths.rs as the single shared definition. Verified end-to-end: fresh `agentflare init --agent claude-code` registered the MCP server (`claude mcp list` shows it connected) and set 57 skills to name-only in one pass; re-running init is a clean no-op on both.
This was referenced Jul 8, 2026
This was referenced Jul 16, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Claude Code auto-lists every enabled skill's name+description on every session regardless of relevance, which compounds token cost as skill count grows.
skill_search/skill_load(agentflare's MCP tools, verified working in dogfooding) already scan skill directories independent of Claude Code's own listing mechanism, making them a viable on-demand replacement for the always-on list — but nothing told the model to actually reach for them.session_start's output: nudge towardskill_search(query)thenskill_load(name)before assuming a relevant skill doesn't exist.session_start_message()(mirrors the_synchelper pattern already used inmcp_server.rs) so the nudge text has direct test coverage instead of only an indirect "doesn't panic" check.Context on the "disable all skills" half of this
Claude Code's
--disable-slash-commandsflag suppresses the always-on skill listing while MCP tools (includingskill_search/skill_load) stay fully functional — verified empirically:shows no skill listing, but
mcp__agentflare__*tools remain available. However, it's a launch-time CLI flag — no persistentsettings.jsonkey or environment variable equivalent was found, so making it the default for every session requires a shell-level wrapper/alias around theclaudebinary, which is outside this repo's scope to configure.Test plan
cargo build --workspace,cargo test --workspace(196 passed, +1 new)cargo clippy --workspace --all-targets— no new findings (pre-existing collapsible-if warnings elsewhere in hook.rs, unrelated to this diff)Summary by CodeRabbit