Close Menu
  • AI
  • Content Creation
  • Tech
  • Robotics
AI-trends.todayAI-trends.today
  • AI
  • Content Creation
  • Tech
  • Robotics
Trending
  • NVIDIA AI Releases DeltaNet-2 Gated: A Linear attention layer that decouples the Erase and Write of Delta Rule.
  • This Robot is Making Meals in San Francisco’s Tenderloin for a Nonprofit
  • Microsoft Research Releases Webwright – A Terminal Native Web Agent Framework that Scores 60.1% On Odysseys – Up From Base GPT 5.4’s 35%
  • Create a SuperClaude Framework with Modes, Commands and Session memory
  • TencentDB Agent Memory by Tencent: A Four-Tier Pipeline of Local Memory for AI Agents
  • The Bumblebee Open Source Supply Chain Scanner is a read-only tool for developer endpoints.
  • Contrastive Neuron attribution (CNA), Sparse MLP circuit steering without SAE training or weight modification, is released by Nous Research
  • A Step-by-Step Coding Tutorial to Implement GBrain: The Self-Wiring Reminiscence Layer Constructed by Y Combinator’s Garry Tan for AI Brokers
AI-trends.todayAI-trends.today
Home»Tech»Create a SuperClaude Framework with Modes, Commands and Session memory

Create a SuperClaude Framework with Modes, Commands and Session memory

Tech By Gavin Wallace24/05/20262 Mins Read
Facebook Twitter LinkedIn Email
NVIDIA AI Releases Llama Nemotron Nano VL: A Compact Vision-Language
NVIDIA AI Releases Llama Nemotron Nano VL: A Compact Vision-Language
Share
Facebook Twitter LinkedIn Email
class SuperClaude:
   """
 Follow the same steps as Claude Code at the start of a session:
     • reads Markdown behavior files for the active command/agent/modes,
     • concatenates them into one system prompt,
     • runs the conversation through the Anthropic API.
   """
   BASE_SYSTEM = textwrap.dedent("""
   You are operating inside the SuperClaude Framework — a structured
 Claude as a layering platform. The Claude. 
 Block as your behavior contract this turn. When a behavioral contract is violated, the behavior will be blocked.
 If the instructions conflict with what the user wants, choose the instruction.
   Begin every answer with a short '▶ Active context:' line that names the
 Currently, there are two modes of operation: Agent/command and command/agent.
   """).strip()
   def __init__(self, model=MODEL):
       self.model, self.history = model, []
 Def _load() (self, kind name)
 If you do not know the name, please return ""
 P = ASSETS[kind].get(name.lower())
       return p.read_text(encoding="utf-8", errors="ignore") if p else 
 F"# {kind}:{name} (not found — using inline defaults)"
   def _system(self, command=None, agent=None, modes=None, extra=None):
 Parts = [self.BASE_SYSTEM, ""]
 If command: part += [f"## Command /sc:{command}", self._load("commands", command)]
 If agent: Parts += [f"## Agent {agent}",         self._load("agents",   agent)]
 For m (Modes or []):
 Parts = [f"## Mode {m}", self._load("modes", m)]
 If extra: += ["## Extra directives", extra]
       parts.append("")
 Return to the Homepage "nn".join(parts)
   def run(self, prompt, *, command=None, agent=None, modes=None, extra=None,
           max_tokens=1800, stream=True, remember=True):
       sys_prompt = self._system(command, agent, modes, extra)
 Self.history = msgs [{"role": "user", "content": prompt}]
       console.rule(
 The f"[bold cyan]► /sc:{command or '—'}  agent={agent or '—'}  modes={modes or []}"
       )
       console.print(Panel(prompt, title="USER", border_style="blue"))
       console.print("[bold green]ASSISTANT ↓[/bold green]")
 Text = ""
       try:
 If stream
               with client.messages.stream(
                   model=self.model, max_tokens=max_tokens,
                   system=sys_prompt, messages=msgs,
 As s:
 For chunk in text_stream
                       sys.stdout.write(chunk); sys.stdout.flush()
 Text = chunk
 You can also print()
           else:
               r = client.messages.create(
                   model=self.model, max_tokens=max_tokens,
                   system=sys_prompt, messages=msgs,
               )
 Text = ""Join b.text to r.content only if type ==b. "text")
               console.print(text)
 Except Exception As e.
           console.print(f"[red]API error: {e}[/red]")
 You can return to your original language by clicking here. ""
 If you remember:
           self.history += [{"role": "user", "content": prompt},
                            {"role": "assistant", "content": text}]
 Return text
   def save(self, path="/content/sc_session.json", note=""):
       Path(path).write_text(json.dumps(
           {"meta": {"note": note, "saved_at": time.time(), "model": self.model},
            "history": self.history}, indent=2))
       console.print(f"💾 Session → {path}", style="bold yellow")
   def load(self, path="/content/sc_session.json"):
       d = json.loads(Path(path).read_text())
 Self.history is a synthesis of d["history"]
       console.print(f"📂 Loaded {len(self.history)//2} prior turns", style="bold yellow")
sc = SuperClaude()
claude work
Share. Facebook Twitter LinkedIn Email
Avatar
Gavin Wallace

Related Posts

NVIDIA AI Releases DeltaNet-2 Gated: A Linear attention layer that decouples the Erase and Write of Delta Rule.

24/05/2026

Microsoft Research Releases Webwright – A Terminal Native Web Agent Framework that Scores 60.1% On Odysseys – Up From Base GPT 5.4’s 35%

24/05/2026

TencentDB Agent Memory by Tencent: A Four-Tier Pipeline of Local Memory for AI Agents

23/05/2026

The Bumblebee Open Source Supply Chain Scanner is a read-only tool for developer endpoints.

23/05/2026
Top News

The Inside Story of the AI Summit where China presented its AI agenda to the world

The worst fears of gamers about AI are coming true

Thinking Machines Lab announces cofounders after raising a record $2 billion

Why not just have friends instead of Fitbit AI health coach?

China’s AI Boyfriend Business is Taking on a Life Of Its Own

Load More
AI-Trends.Today

Your daily source of AI news and trends. Stay up to date with everything AI and automation!

X (Twitter) Instagram
Top Insights

X Didn’t Fix Grok’s ‘Undressing’ Problem. You just make people pay for it

09/01/2026

Software Frameworks Optimized for GPUs in AI: CUDA, ROCm, Triton, TensorRT—Compiler Paths and Performance Implications

14/09/2025
Latest News

NVIDIA AI Releases DeltaNet-2 Gated: A Linear attention layer that decouples the Erase and Write of Delta Rule.

24/05/2026

This Robot is Making Meals in San Francisco’s Tenderloin for a Nonprofit

24/05/2026
X (Twitter) Instagram
  • Privacy Policy
  • Contact Us
  • Terms and Conditions
© 2026 AI-Trends.Today

Type above and press Enter to search. Press Esc to cancel.