Skip to content

KatsuJinCode/DeClaude

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeClaude

Take control of Claude Code. Save tokens. Work smarter.

Claude Code is incredible, but it comes with overhead. Every tool, every capability, every feature costs tokens - before you even type your first message.

DeClaude fixes that.


Table of Contents


The Problem: Your Context Window is Already Half Gone

An extremely lean Claude Code setup still uses 49k tokens

This screenshot shows an extremely lean setup - no MCP servers, no complex CLAUDE.md files, minimal configuration. Even then:

  • 49k tokens already used (24% of your context)
  • System prompt: 2.2k tokens
  • Memory files: 1.7k tokens
  • Autocompact buffer: 45k tokens
  • Free space: only 151k (75.6%)

Most users are far worse off. Add MCP servers, skills, custom CLAUDE.md files, plugins, and multiple tools? You're looking at 60-80k tokens consumed before you start. Some power users report starting conversations with 100,000+ tokens already used - half their context gone before typing a single message.

That's every compacting event. Every context refresh. Every new conversation.

If you're burning through hundreds of millions or billions of tokens a week, that overhead is costing you real money and real productivity.



The Solution: 18 Tokens. Total.

DeClaude extreme setup

With DeClaude's extreme configuration (Bash-only + custom system prompt):

  • 0k/200k tokens (0%)
  • System prompt: 10 tokens
  • Messages: 8 tokens
  • Free space: 200k (100.0%)

That's essentially zero overhead. Your entire context window is yours.

The math:

  • Standard Claude Code: 49,000 tokens used before you start
  • DeClaude extreme: 18 tokens
  • Savings: 49,000 tokens. Every. Single. Time.

At scale, this is transformative. If you're hitting context limits, if you're watching costs climb, if you're tired of Claude forgetting things mid-conversation - this is why.

(The --system-prompt flag lets you override Claude's default prompt. Combined with using the Bash tool as an all-in-one tool to accomplish almost anything via simple commands, you get virtually unlimited context.)



What is DeClaude?

Did you know Claude Code has flags to control which tools it can use?

Most people don't. Buried in the CLI documentation are --allowedTools and --disallowedTools flags that let you specify exactly which of Claude's 18 tools are available. Want Claude to only use Bash? Want to disable file editing? Want a read-only research mode? The capability exists - it's just nearly impossible to use.

DeClaude makes it usable. It's a visual command generator that creates custom Claude Code shell functions:

  1. Check boxes for the tools you want
  2. Set your flags
  3. Copy one command
  4. Now declaude runs your custom config, declaude RESET restores full access

It's the missing control panel for Claude Code's tool system.


Why This Tool Needs to Exist

Claude Code's built-in tool management is... a nightmare. The flags exist (--allowedTools, --disallowedTools), but actually using them?

The Persistence Problem

Here's what most people don't realize: these flags are permanent. When you run claude --disallowedTools "Bash", Bash doesn't just get disabled for that session - it gets added to your config. Permanently. Until you explicitly re-enable it.

This means:

  • Disable a tool once, it stays disabled forever
  • To re-enable it, you need to know the exact flag syntax
  • There's no command to check which tools are currently disabled - you only find out when you try to use a tool and it fails
  • The only way to verify your setup is to try each tool individually
  • No visual indicator, no status command, nothing

The workflow for manually managing tools:

  1. Remember which of the 18 tools you want enabled
  2. Remember which you want disabled
  3. Type them all correctly (one typo and it silently fails)
  4. Launch Claude
  5. Try to use a tool... did it work? Is it disabled? Who knows?
  6. Realize something's wrong mid-conversation
  7. Close Claude
  8. Retype the entire command with a guess at the fix
  9. Repeat until you give up

Nobody is doing this. I guarantee less than 1% of Claude Code users even know these flags exist, let alone use them regularly. And nobody is going to manually type --allowedTools "Bash,Read,Edit,Write,Glob,Grep" --disallowedTools "Task,TaskOutput,KillShell,WebFetch,WebSearch..." every time they want to switch workflows.

What DeClaude Does

  • Visual toggles - see exactly what's enabled/disabled at a glance
  • Profile system - save configurations, switch workflows with a single word
  • Both flags always set - every command sets a complete, known state - no surprises, no persistence issues
  • RESET profile - one command to restore full Claude Code functionality
  • Automated installation - one-liner install scripts that detect your shell, back up your config, and set everything up
  • Export/Import - save your profiles as JSON, share them, restore them when things change
  • Explain Mode - a full panel that tokenizes and explains every element of the generated command so you know exactly what it's doing
  • Read-only environments - disable editing tools and Claude outputs commands as text instead of executing them - you become the filter, reviewing and running each command yourself
  • No memorization required - the tool knows all 18 tool names so you don't have to

DeClaude makes tool management actually usable.

Our secret dream? Anthropic sees this, realizes how poorly designed their current system is, improves it, and makes DeClaude obsolete. That would be a win for everyone.


Features

Profile System

Profile management

Organize your configurations into groups and profiles:

Built-in Groups:

  • DeClaude: Restriction levels from DEFCON1 (full access) to DECLAUDE (Bash-only) to RESET (restore all)
  • Use Case: Code Review, Documentation, Debugging, Research - each tuned for the task
  • Workflow: Explore, Prototype, Implement, Test - match your development phase

Each profile stores:

  • Which tools are enabled/disabled
  • Which CLI flags are set
  • A custom name that becomes your command flag

Management features:

  • Inline editing (click the pencil to rename)
  • Star button to set default profile
  • Export/Import for backup and sharing
  • Create custom groups and profiles

18 Tools, Your Choice

Tools and flags

Bonus points to anyone who can make these tool/flag elements flow nicely in CSS. I tried everything and gave up. PRs welcome. 😅

Every Claude Code tool can be toggled independently:

Category Tools Why You'd Disable
System Bash, Task, TaskOutput, KillShell Prevent shell access, background tasks
File Read, Edit, Write, Glob, Grep Read-only mode, prevent modifications
Web WebFetch, WebSearch Offline mode, prevent external calls
Advanced NotebookEdit, Skill, SlashCommand Limit advanced capabilities
User TodoWrite, AskUserQuestion Streamline interaction
Mode EnterPlanMode, ExitPlanMode Control planning behavior

Example configurations:

  • Code Review: Enable Read, Glob, Grep. Disable everything else. Claude can search and read but can't modify anything.
  • Research Mode: Enable WebFetch, WebSearch, Read. Claude can research but can't touch your files.
  • Paranoid Mode: Bash only. Claude has to ask you to do everything else through the terminal.

The app shows redundancy warnings when disabling one tool affects others.


CLI Flags with Real Options

Not just checkboxes. DeClaude supports:

  • Boolean flags: --verbose, --dangerously-skip-permissions
  • Flags with predefined options: Model selection with radio buttons
  • Flags with free-text input: Custom values where you need them
  • Risk indicators: Dangerous flags are visually marked

Plus additional tools fields - if there's a tool we don't know about, add it to the allowed/disallowed list manually.


Six Shells, Six Agents (Aspirational)

Platform selection

🚧 This section is aspirational. We've built the architecture for broad compatibility, but only PowerShell + Claude Code is fully tested. We need your help to validate the rest and bring this vision to life. See Contributing.

DeClaude generates actual, proper shell syntax - not string templates:

Shell What You Get Status
PowerShell Real functions with param blocks and switch statements ✅ Tested
Bash Proper functions with case statements ⚠️ Untested
Zsh Native zsh syntax ⚠️ Untested
Fish Fish shell functions ⚠️ Untested
Nushell Modern def and match syntax ⚠️ Untested
CMD Batch files with IF/ELSE chains ⚠️ Untested

And support for multiple AI coding agents:

Agent Tool Restrictions Status
Claude Code --allowedTools / --disallowedTools ✅ Tested
Gemini CLI Config-based (settings.json) ⚠️ Untested
OpenCode --allowedTools / --excludedTools ⚠️ Untested
Aider Config file (~/.aider.conf.yml) ⚠️ Untested
Codex CLI Documentation varies ⚠️ Untested
Continue Config-based (config.yaml) ⚠️ Untested

Select your OS, shell, and agent - get code that actually works. PowerShell + Claude Code is fully tested; everything else needs community validation - please report issues if you encounter problems.


Smart Install Script

Don't want to manually edit your shell config? Enable "Install Script" and get a one-liner that:

  1. Detects your shell's config file location
  2. Checks if the function already exists
  3. Creates a backup if needed
  4. Appends the function
  5. Sources the config

Paste one command, restart your terminal, done.


Explain Mode

Explain mode

Hover over any segment of the generated command and see exactly what it does. The entire command is tokenized and color-coded:

  • Function declarations and syntax
  • Parameter blocks and defaults
  • Flag names and their values
  • Tool lists (allowed and disallowed)
  • String delimiters and escaping

Perfect for learning shell syntax, or for verifying that the command does what you think it does.


Beginner vs Expert Mode

DeClaude adapts to your experience level:

Beginner Mode

Beginner mode
  • Every hint and tooltip visible
  • Explanations for each section
  • "What's this?" help text
  • Full command explanation panel
  • Guided experience

Expert Mode

Expert mode
  • Streamlined interface
  • No hand-holding
  • Compact layout
  • Cheeky tooltips
Expert tooltip

"Experts write their own install scripts"

Toggle between them with one click:

Expertise toggle


Quick Start

  1. Open DeClaude - 👉 katsujincode.github.io/DeClaude 👈 or open index.html locally
  2. Pick a profile - Start with DECLAUDE (Bash-only) for maximum token savings
  3. Customize if needed - Toggle tools, set flags
  4. Copy the command - Click Copy, paste into terminal
  5. Use it:
declaude              # Your default profile (Bash-only)
declaude DEFCON1      # Full access when you need it
declaude RESET        # Restore all tools
declaude CodeReview   # Read-only mode (no spaces = no quotes needed)

(Tip: Profile names with spaces require quotes. Use underscores or camelCase to keep your commands clean.)


We Need Your Help: Multi-Agent Support

DeClaude currently supports Claude Code fully. We've also built the architecture for other AI coding agents:

Agent Status
Claude Code Fully tested and working
Gemini CLI Alpha - needs community validation
OpenCode Alpha - needs community validation
Aider Alpha - needs community validation
Codex CLI Alpha - needs community validation
Continue Alpha - needs community validation

The tool configurations for non-Claude agents were built from documentation research, but haven't been battle-tested in real workflows. Each agent has different CLI patterns, different flag names, different behaviors.

If you use any of these agents, your testing would be invaluable. Even a simple "this worked" or "this flag is wrong" helps make this tool better for everyone.

Open an Issue | Submit a PR


Privacy & Security

  • 100% client-side - No server, no backend, nothing leaves your browser
  • localStorage only - Profiles saved locally, never transmitted
  • No tracking - Zero analytics, zero cookies, zero telemetry
  • Open source - Read every line of code yourself

Development

git clone https://github.com/KatsuJinCode/DeClaude.git
cd DeClaude
# Open index.html in your browser - that's it

No build step. No npm install. No dependencies. Vanilla HTML/CSS/JS.


Seriously, We Need Contributors

This project took countless hours. The profile system, explain mode, multi-shell support, flag configurations - all crafted with care.

But I'm one person, and I only use Claude Code. The multi-agent support is waiting for validation.

Even if you just:

  • Test one agent and report back
  • Fix a typo
  • Suggest a better default
  • Share it with someone who'd find it useful

That helps. GitHub Issues


License

MIT - Do whatever you want with it. See LICENSE.


Built for developers who want Claude's power with their own guardrails.

49,000 tokens saved. Every time.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors