DEV Community

Scott Raisbeck
Scott Raisbeck

Posted on

My parting gift to 2025 - my Claude Code context workflow turned into a plugin

So for 2025 I just want to leave a little gift for you folks to welcome in the new year.

I did an article recently on publishing my first Claude Code plugin (which are frickin' awesome by the way).

The plugin was centred entirely around Forgetful in isolation, but the reality is for my workflow I don't use it in isolation. There's two main flows that I am going to share with you here.

Context Gather

The first is what I do whenever I want to work on something. This is the first thing I do when I open up a new Claude session or /clear an existing one.

I write the /context_gather command with the context of what I want to do:

/context_gather implement entity relationship visualization
Enter fullscreen mode Exit fullscreen mode

What happens next is Claude pulls from four different sources and synthesises them into a briefing:

Forgetful - searches my memory for past decisions, patterns, and gotchas related to what I'm about to do. If I've solved a similar problem before, or made an architectural decision that affects this, it shows up here.

Serena - does live LSP-powered analysis of my current codebase. This isn't cached knowledge from when I encoded the repo months ago - it's what the code looks like right now. Symbol references, type relationships, what calls what.

Context7 - grabs up-to-date framework documentation. Instead of me googling "FastAPI dependency injection" for the fifth time, it pulls the relevant sections automatically. Especially useful for frameworks I don't touch daily.

WebSearch - fills gaps when the docs aren't enough or something's changed recently.

The result is a synthesised briefing specific to what I'm about to implement. Here's what you've decided before, here's how your codebase currently handles related things, here's how the framework recommends doing this.

Then I actually write the code. With context.

Encoding Repos

The other workflow I have is to encode a repo into Forgetful so I can reference it in other projects or on other AI systems (eg when talking to ChatGPT on my mobile or when I'm using Claude Desktop).

For that I use /encode-repo-serena:

/encode-repo-serena
Enter fullscreen mode Exit fullscreen mode

This kicks off a multi-phase analysis using Serena's LSP integration. It's not grep. It's not file listings. Serena understands symbols at the language level.

Phase 1: Architecture Discovery - Serena analyses the codebase structure. What classes exist, what they extend, which functions call which dependencies, where the entry points are. These get stored as atomic memories in Forgetful.

Phase 1B: Dependency Analysis - detects manifests (package.json, pyproject.toml, etc), parses out dependencies, validates framework usage assumptions via Context7. Creates a dependency memory so I know what this project actually uses.

Phase 2: Entity Graph Creation - creates entities for major components based on Serena's reference counts (the stuff that's referenced the most is probably important). Maps relationships between them with strength values based on how tightly coupled they are. Links entities to the architecture memories.

Takes a few minutes for a decent-sized repo. After that, the knowledge lives in Forgetful. I can query it from Claude Code, Claude Desktop, ChatGPT via the hosted MCP endpoint, or any other MCP-compatible agent.

End of a session

Whenever I am finished my 'vibin..' i just use the /memory-save command and it works out what is relevant, checks if it already exists, asks me for confirmation and then manages the links if the auto link didn't work.

The Meta-Tools Pattern

One thing worth explaining: Forgetful has 40+ tools under the hood. Projects, memories, entities, relationships, documents, code artifacts, linking, searching, the lot.

But the MCP server only exposes three:

  • discover_forgetful_tools - returns what's available, filtered by category if you want
  • how_to_use_forgetful_tool - full schema and examples for a specific tool
  • execute_forgetful_tool - runs any tool by name with arguments

Why? Context window. If I registered all 40+ tools directly, that's ~15-20K tokens of schemas loaded into every conversation. The meta-tools pattern drops that to ~500 tokens. Agents discover what they need, when they need it.

With skills, this pattern makes even more sense. The skill files include a TOOL_REFERENCE.md with complete schemas for all 40+ tools, so Claude Code can call them directly without the discovery overhead. But agents without skills (Claude Desktop, other MCP clients) still work fine through the meta-tools.


I hope this is useful for others. It might not seem like much now but it's the culmination of months of work and tinkering, coding - yes I still code some of this stuff, what can I say? I enjoy it - and refining/reviewing with Claude.

Happy new year.

context-hub-plugin Repository
Forgetful Repository
Forgetful Stand-alone Plugin

Top comments (0)