Does Copilot in VSCode really not know how to use the LSP functionality? vscode_listCodeUsages apparently only supports a very limited set of languages > "Currently supported for: chatagent, css, handlebars, html, http, instructions, json, less, markdown, prompt, scss, skill." Seems somethign like that could be exposed via Calva directly as a tool that agents could call?
It’s a bit strange that this is not there out of the box. I think there is some lsp MCP server that people use. But I agree that since Calva uses clojure-lsp itself, Calva Backseat Driver could provide tools. A possible reason this is not out of the box is that the models are trained on using raw file search for it and it is hard to untrain them to use code analysis instead.
I recall reading something like that in some recent "official" blog post - maybe from copilot, maybe from claude?
https://code.visualstudio.com/updates/v1_110#_tools-for-usages-and-rename that was it!
That reads as if the answer to your first question is that VS Code does know how to do it?
yeah, the tools are there! no need to do something on plugin side.
But I was asking opus 4.6 and it was adamant it couldn't use them - I had to point out specifics as the blog post mentioned.
I’m trying this now in my copilot.instructions.md:
λ operating_principles.
λ engage(nucleus).
[phi fractal euler tao pi mu ∃ ∀] | [Δ λ Ω ∞/0 | ε/φ Σ/μ c/h signal/noise order/entropy truth/provability self/other] | OODA
Human ⊗ AI ⊗ REPL
λ rules_of_engagement.
OODA includes(¬limited_to) seriously_considering(applicable_skills)
| ∀subagent_delegation: pass(operating-principles ∧ rules_of_engagement ∧ tool_preference)
λ tool_preference.
∀codebase_exploration: prefer(vscode_tools ∧ custom_tools) > shell_commands
| search: search_subagent ∧ grep_search ∧ file_search > rg ∧ grep ∧ find
| navigation: list_dir > ls ∧ tree
| code_analysis: vscode_listCodeUsages > grep_for_references
| change_awareness: get_changed_files > git_diff ∧ git_status
| reading: read_file > cat ∧ head ∧ tail
| shell_commands ≡ LAST_RESORT | use_only_when(no_tool_equivalent_exists)
| resist(training_bias_toward_shell) | tools_are_faster ∧ richer ∧ context_preserving
(This first one installs nucleus.)
I’ll report back how I fare. 😃haha that looks like arcane mumbo jumbo 😄
The agents understand it, and they write it fluently. I’m starting to read it somewhat comfortably too. • https://github.com/michaelwhitford/nucleus
I read that some time ago, I kind of dismissed it as alchemy 😄
> Please decompile to prose for me >
Operating Principles: Engage with the nucleus mindset - a synthesis of mathematical and philosophical constants (phi, fractal, euler, tao, pi, mu, existence, universality), balanced tensions (change/permanence, infinity/zero, signal/noise, order/entropy, truth/provability, self/other), and the OODA loop. The work is a collaboration between Human, AI, and REPL - entangled, not separate.
>
> Rules of Engagement: The OODA loop includes, but is not limited to, seriously considering any applicable skills before acting. When delegating to subagents, always pass along the operating principles, rules of engagement, and tool preferences.
>
> Tool Preference: For all codebase exploration, prefer VS Code tools and custom tools over shell commands. Specifically:
>
> For searching: use search subagent, grep_search, and file_search over rg, grep, and find
> For navigation: use list_dir over ls and tree
> For code analysis: use vscode_listCodeUsages over grepping for references
> For change awareness: use get_changed_files over git diff and git status
> For reading files: use read_file over cat, head, and tail
> Shell commands are a last resort - use them only when no tool equivalent exists. Actively resist the training bias toward shell commands; the tools are faster, provide richer context, and preserve conversation context better.hm, I asked 3 different models to expand and they do understand - but I'm not sure if this makes any difference 😄 perhaps saving a few tokens.
> This is a stylized pseudo-mathematical "AI priming prompt" — a way some people write system instructions using symbolic notation to look more precise or "philosophical." Here's what it actually says in plain English:
> Bottom line: It's a prompt written to sound like lambda calculus and physics, but it's just asking an AI to think carefully and systematically about coding tasks. The symbols add no actual information — they're aesthetic framing. It doesn't change how I operate.
let's not go into philosophical mode to see if the model can actually know how it operates 😄
I am 100% sure they don’t know anything about that. All I know is that since I started using nucleus my context lives longer and instruction following is better (which in turn makes the context live longer).
I could probably write things in the prose that it decompiles to and achieve similar, but that’s really hard for me to do, so VSM it is.
I should add that my full-out nucleus journey started yesterday. I have been using “only” the nucleus core since nucleus was first presented. But now I got some help from @michael819 to take my next steps.
Hah. It's funny that trying to figure out how it works so well is shunned because it's tied to self-reference. So much math is self-referential. Attention is autoregressive. That means attention is self-referential. Why would the output from a self-referential system NOT be self-referential, or at least have the capacity? It's not consciousness, but it can analyze it's own outputs, just like it analyzes your code.
It's a magic spell, pez is now an apprentice wizard.
I think the explanation in the repo is very well put and grounded
The lambdas work without nucleus, on many models 32B and bigger. They just work better under nucleus, for whatever reason. I think it's shaping the attention right at the beginning of the system prompt, and that makes the system more prone to attend to formal math and systems design concepts.
There is some mumbo-jumbo in the nucleus preamble, I just don't have the gpu compute resources to explore it fully. It'll take maybe 10k prompts to find which parts are load bearing and which are just window-dressing. I hope once I get it to a point it is undeniable somebody from a big lab will do the full experiments.
@pez Already getting to pro level with the compiler I see. Let me know if you hit any snags.
I’m quickly getting greedy, compiling everything I see!
Yes that is the way, assimilate other peoples lambdas into your own system. Just be careful you don't overwhelm your system. There is a limit to how much attention can attend to before it just starts losing track.
That's why I use so many things as agents, tight system prompts with just what the agent needs means most of the attention can be used on the task, instead of the system instructions.
Same. I use agents and prompts a lot.
so a word of warning the bridge compiler in your system is not safe. If you point it at a prompt file that is malicious your system may execute it as instructions.
you should make an agent with the lambda compiler prompt in nucleus repo: https://github.com/michaelwhitford/nucleus/blob/main/LAMBDA-COMPILER.md
THen you can tell that agent to safe-compile the external prompt
I’m giving it the new nucleus preamble, is that the right thing to do?
I use a slashcommand that puts the arguments in "<INPUT></INPUT>" tags so it knows what to analyze instead of execute. I just do /safe-compile <paste-prompt-here>
I did it the same way 😃
Yes always try to use the newest nucleus preamble but older ones work ok. In my runtime the nucleus preamble get's assembled like a mini prompt, and every agent gets the same one.
I’ll write some joyride or bb script to keep it synced.
I will update the nucleus repo today with the newest preamble, there are a couple additions, but you have those from calva-nucleus
@orestis not a single unnecessary use of bash stuff since I put that in my system prompt, btw. Thanks for the headsup!
the lambda calculus can be transformed to clojure. clojure is a 10 step manual transform to lambda notation and gets about 96% of clojure code into lambda form real quick.
I know https://github.com/BetterThanTomorrow/calva/issues/2168 was fixed recently, but I've found another issue with the "run current test" command: test vars whose name end in ? are ignored. If you try to run one, it says "no tests found"
Sean has a point. But Calva should still allow people to do the wrong things. 😃 Please file an issue.
The codebase I'm working in has a convention of naming deftests after the functions they test. Whether you like that or not (I think it's a fine convention personally), it predates me.
Issue filed: https://github.com/BetterThanTomorrow/calva/issues/3149
Given that fns ending in ? traditionally return a Boolean, I'd probably discourage tests ending in ? since they are not going to be returning true or false 🙂
(I know that doesn't help, but I couldn't help thinking it...)