Claude Code and GitHub Copilot: token-saving tips tested

Learn which token-saving tips help Claude Code and GitHub Copilot, including an LSP refactoring test with 20 to 30% lower costs.

Player not loading? Watch on YouTube

This video examines token costs in Claude Code and GitHub Copilot, with advice on managing context in a coding assistant. The speaker explains how repeated chat history adds input tokens and demonstrates prompt caching through the Anthropic API. The example writes 3,923 tokens to the cache, then reuses them on a subsequent request. Cache reads still cost money, and changing the context prefix can prevent reuse.

The MCP discussion separates tool definitions from tool responses. According to the speaker, deferred schema loading reduces definition overhead in Claude Code, while verbose tool results can still fill the context. The video demonstrates disabling unused tools in VS Code and assigning tools to particular agents. It also compares MCP with familiar command-line tools without treating either approach as universally better.

For LSP versus text search, the speaker reports a refactoring test in a repository of about 30,000 lines. Across repeated runs, LSP lowered costs by 20 to 30%, a smaller gain than the headline claims discussed in the video. Further advice covers compacting history, rewinding conversations and starting fresh when changing tasks.

The closing sections discuss model selection and the Caveman skill. The speaker cautions that shorter replies do not produce equivalent savings across an entire coding workflow, where code and tool calls still consume tokens. A paid Telnyx segment demonstrates a hosted voice agent.