Feature Request: Systematic Directory Organization for Claude Code Projects
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Dear Anthropic Development Team,
I hope this message finds you well. I'm writing to suggest an enhancement to Claude Code that would improve project organization and maintainability as codebases grow in complexity.
Issue Overview
While working with Claude Code on multiple projects, I've observed a consistent pattern: initial projects maintain clean, organized directory structures. However, as projects grow and become more dynamic, new files increasingly get created in the home directory rather than being placed in logically organized subdirectories. This creates maintenance challenges and reduces code discoverability as projects scale.
Current Behavior
- Early-stage projects: Files are properly organized by function (e.g., /src, /tests, /config, /utils)
- - Mature/growing projects: New files default to placement in the working directory or home directory, breaking the established structure
- - - Result: Directory bloat and reduced project coherence
Suggested Improvement
Implement systematic directory organization logic in Claude Code that:
- Analyzes existing project structure at the start of each session to understand the established organizational pattern
- 2. Enforces structural consistency by defaulting new file creation to appropriate subdirectories based on file type and purpose (e.g., utilities → /utils, tests → /tests, configurations → /config)
- 3. Provides user control through optional parameters to override default placement when needed
- 4. Documents placement decisions so users understand why files were created in specific locations
Impact
This enhancement would significantly improve:
- Long-term project maintainability
- - Code discoverability and navigation
- - - Consistency across Claude Code sessions
- - - - Developer productivity when working with complex, growing projects
Thank you for considering this feature request. I'm happy to provide additional context or examples if helpful.
Proposed Solution
The implementation should work as follows:
- Project Structure Analysis: When Claude Code initializes a session with an existing project, it would scan the directory structure to identify the established organizational pattern. For example, it would recognize directories like
/src,/tests,/utils,/config, etc. - File Type Mapping: Establish intelligent mapping between file types/purposes and appropriate subdirectories:
- - Test files →
/testsor/test - - Utility functions →
/utilsor/lib - - Configuration files →
/config - - Source code →
/src - - Documentation →
/docs - Smart File Creation: When creating new files, Claude Code would default to placing them in the appropriate subdirectory based on both the file type and the project's existing structure.
- User Override: Provide clear options for users to override the default placement when needed, without losing the organizational benefits for future files.
- Transparency: Log and display placement decisions so users understand the reasoning.
Alternative Solutions
Currently, I work around this issue by:
- Manual File Organization: Manually moving files to appropriate directories after they're created, which is time-consuming and error-prone
- 2. Custom Naming Conventions: Using verbose naming patterns in file names to indicate their purpose, which clutters the codebase
- 3. Project Templates: Creating project templates with pre-established structure, though this doesn't help with growing projects that deviate from the template
These workarounds are inefficient and don't fully solve the problem of maintaining organization as projects evolve over time.
Priority
Critical - Blocking my work
Feature Category
File operations
Use Case Example
Scenario: Growing a Node.js backend project
- I start a new backend project with Claude Code, establishing a clean structure:
- -
/src- main application code - -
/tests- test files - -
/utils- utility functions - -
/config- configuration files - As the project grows, I ask Claude Code to:
- - Add a new utility function for authentication
- - Create a test file for a new API endpoint
- - Add an environment configuration file
- Current behavior: All these files get created in the home directory, requiring me to manually move them to the correct folders after creation.
- With this feature: Claude Code would automatically place:
- - The utility function in
/utils - - The test file in
/tests - - The config file in
/config - Result: Project structure remains clean and organized without manual intervention. As I continue adding files over weeks or months, the organization is maintained automatically.
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗